Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [Intel-xe] [PATCH 2/2] drm/xe: Implement xe DPT slightly differently.
Date: Wed, 31 May 2023 17:18:04 +0200	[thread overview]
Message-ID: <20230531151804.2017924-3-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20230531151804.2017924-1-maarten.lankhorst@linux.intel.com>

Just create a dummy to make DPT work.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 .../drm/i915/display/skl_universal_plane.c    |  3 +-
 drivers/gpu/drm/xe/Makefile                   |  1 +
 drivers/gpu/drm/xe/display/xe_dpt.c           | 46 +++++++++++++++++++
 3 files changed, 49 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/xe/display/xe_dpt.c

diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
index acf8e834fe34..fb5d56ca87c0 100644
--- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
+++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
@@ -1002,7 +1002,8 @@ static u32 skl_surf_address(const struct intel_plane_state *plane_state,
 		 * The DPT object contains only one vma, so the VMA's offset
 		 * within the DPT is always 0.
 		 */
-		drm_WARN_ON(&i915->drm, plane_state->dpt_vma->node.start);
+		if (plane_state->dpt_vma)
+			drm_WARN_ON(&i915->drm, plane_state->dpt_vma->node.start);
 		drm_WARN_ON(&i915->drm, offset & 0x1fffff);
 		return offset >> 9;
 	} else {
diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
index ecf37dded78d..84178a8898ce 100644
--- a/drivers/gpu/drm/xe/Makefile
+++ b/drivers/gpu/drm/xe/Makefile
@@ -130,6 +130,7 @@ $(obj)/i915-display/%.o: $(srctree)/drivers/gpu/drm/i915/display/%.c FORCE
 # Display code specific to xe
 xe-$(CONFIG_DRM_XE_DISPLAY) += \
 	xe_display.o \
+	display/xe_dpt.o \
 	display/xe_fb_pin.o \
 	display/xe_hdcp_gsc.o \
 	display/xe_plane_initial.o \
diff --git a/drivers/gpu/drm/xe/display/xe_dpt.c b/drivers/gpu/drm/xe/display/xe_dpt.c
new file mode 100644
index 000000000000..0695886045e3
--- /dev/null
+++ b/drivers/gpu/drm/xe/display/xe_dpt.c
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#include "intel_dpt.h"
+
+#include "i915_reg.h"
+
+#include "intel_de.h"
+#include "intel_display.h"
+#include "intel_display_types.h"
+
+void intel_dpt_destroy(struct i915_address_space *vm)
+{
+}
+
+struct i915_address_space *
+intel_dpt_create(struct intel_framebuffer *fb)
+{
+	return NULL;
+}
+
+void intel_dpt_configure(struct intel_crtc *crtc)
+{
+	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
+
+	if (DISPLAY_VER(i915) == 14) {
+		enum pipe pipe = crtc->pipe;
+		enum plane_id plane_id;
+
+		for_each_plane_id_on_crtc(crtc, plane_id) {
+			if (plane_id == PLANE_CURSOR)
+				continue;
+
+			intel_de_rmw(i915, PLANE_CHICKEN(pipe, plane_id),
+				     PLANE_CHICKEN_DISABLE_DPT,
+				     i915->params.enable_dpt ? 0 : PLANE_CHICKEN_DISABLE_DPT);
+		}
+	} else if (DISPLAY_VER(i915) == 13) {
+		intel_de_rmw(i915, CHICKEN_MISC_2,
+			     CHICKEN_MISC_DISABLE_DPT,
+			     i915->params.enable_dpt ? 0 : CHICKEN_MISC_DISABLE_DPT);
+	}
+}
+
-- 
2.34.1


  parent reply	other threads:[~2023-05-31 15:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 15:18 [Intel-xe] [PATCH 0/2] drm/xe: Small cleanups to DPT code Maarten Lankhorst
2023-05-31 15:18 ` [Intel-xe] [PATCH 1/2] fixup! drm/i915/display: Remaining changes to make xe compile Maarten Lankhorst
2023-06-01  9:13   ` Jani Nikula
2023-05-31 15:18 ` Maarten Lankhorst [this message]
2023-05-31 15:20 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/xe: Small cleanups to DPT code Patchwork
2023-05-31 15:22 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-05-31 15:26 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-05-31 15:56 ` [Intel-xe] ○ CI.BAT: info " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-08-14  8:37 [Intel-xe] [PATCH 1/2] fixup! drm/i915/display: Remaining changes to make xe compile Maarten Lankhorst
2023-08-14  8:37 ` [Intel-xe] [PATCH 2/2] drm/xe: Implement xe DPT slightly differently Maarten Lankhorst
2023-08-14 18:29   ` Rodrigo Vivi
2023-08-15  9:23     ` Jani Nikula
2023-08-15 13:13       ` Maarten Lankhorst
2023-08-15 17:43         ` Jani Nikula
2023-08-16 15:16           ` Shankar, Uma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230531151804.2017924-3-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox