All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com, lucas.demarchi@intel.com
Subject: [Intel-gfx] [PATCH 34/39] drm/i915: split gem quirks from display quirks
Date: Thu, 11 Aug 2022 18:07:45 +0300	[thread overview]
Message-ID: <1ba74f3a30b1f5e7d1705eac6e4c6ee3b95d0d5a.1660230121.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1660230121.git.jani.nikula@intel.com>

The lone gem quirk is an outlier, not even handled by the common quirk
code. Split it to a separate gem_quirks member.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_pages.c                | 2 +-
 drivers/gpu/drm/i915/gem/i915_gem_tiling.c               | 4 ++--
 drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c | 2 +-
 drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c       | 4 ++--
 drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c             | 2 +-
 drivers/gpu/drm/i915/i915_debugfs.c                      | 2 +-
 drivers/gpu/drm/i915/i915_drv.h                          | 4 +++-
 drivers/gpu/drm/i915/i915_gem.c                          | 2 +-
 8 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pages.c b/drivers/gpu/drm/i915/gem/i915_gem_pages.c
index 8357dbdcab5c..e0b39463c1b0 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_pages.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_pages.c
@@ -66,7 +66,7 @@ void __i915_gem_object_set_pages(struct drm_i915_gem_object *obj,
 	shrinkable = i915_gem_object_is_shrinkable(obj);
 
 	if (i915_gem_object_is_tiled(obj) &&
-	    i915->quirks & QUIRK_PIN_SWIZZLED_PAGES) {
+	    i915->gem_quirks & GEM_QUIRK_PIN_SWIZZLED_PAGES) {
 		GEM_BUG_ON(i915_gem_object_has_tiling_quirk(obj));
 		i915_gem_object_set_tiling_quirk(obj);
 		GEM_BUG_ON(!list_empty(&obj->mm.link));
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_tiling.c b/drivers/gpu/drm/i915/gem/i915_gem_tiling.c
index 85518b28cd72..fd42b89b7162 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_tiling.c
@@ -278,7 +278,7 @@ i915_gem_object_set_tiling(struct drm_i915_gem_object *obj,
 	 */
 	if (i915_gem_object_has_pages(obj) &&
 	    obj->mm.madv == I915_MADV_WILLNEED &&
-	    i915->quirks & QUIRK_PIN_SWIZZLED_PAGES) {
+	    i915->gem_quirks & GEM_QUIRK_PIN_SWIZZLED_PAGES) {
 		if (tiling == I915_TILING_NONE) {
 			GEM_BUG_ON(!i915_gem_object_has_tiling_quirk(obj));
 			i915_gem_object_clear_tiling_quirk(obj);
@@ -458,7 +458,7 @@ i915_gem_get_tiling_ioctl(struct drm_device *dev, void *data,
 	}
 
 	/* Hide bit 17 from the user -- see comment in i915_gem_set_tiling */
-	if (dev_priv->quirks & QUIRK_PIN_SWIZZLED_PAGES)
+	if (dev_priv->gem_quirks & GEM_QUIRK_PIN_SWIZZLED_PAGES)
 		args->phys_swizzle_mode = I915_BIT_6_SWIZZLE_UNKNOWN;
 	else
 		args->phys_swizzle_mode = args->swizzle_mode;
diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c
index 3cfc621ef363..9a6a6b5b722b 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c
@@ -711,7 +711,7 @@ static bool bad_swizzling(struct drm_i915_private *i915)
 {
 	struct i915_ggtt *ggtt = to_gt(i915)->ggtt;
 
-	if (i915->quirks & QUIRK_PIN_SWIZZLED_PAGES)
+	if (i915->gem_quirks & GEM_QUIRK_PIN_SWIZZLED_PAGES)
 		return true;
 
 	if (has_bit17_swizzle(ggtt->bit_6_swizzle_x) ||
diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
index 3ced9948a331..25bb3bd4c3fe 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
@@ -367,7 +367,7 @@ static int igt_partial_tiling(void *arg)
 		unsigned int pitch;
 		struct tile tile;
 
-		if (i915->quirks & QUIRK_PIN_SWIZZLED_PAGES)
+		if (i915->gem_quirks & GEM_QUIRK_PIN_SWIZZLED_PAGES)
 			/*
 			 * The swizzling pattern is actually unknown as it
 			 * varies based on physical address of each page.
@@ -464,7 +464,7 @@ static int igt_smoke_tiling(void *arg)
 	 * Remember to look at the st_seed if we see a flip-flop in BAT!
 	 */
 
-	if (i915->quirks & QUIRK_PIN_SWIZZLED_PAGES)
+	if (i915->gem_quirks & GEM_QUIRK_PIN_SWIZZLED_PAGES)
 		return 0;
 
 	obj = huge_gem_object(i915,
diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c b/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
index 6ebda3d65086..cf4a326f5f48 100644
--- a/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
+++ b/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
@@ -727,7 +727,7 @@ static void detect_bit_6_swizzle(struct i915_ggtt *ggtt)
 		 * bit17 dependent, and so we need to also prevent the pages
 		 * from being moved.
 		 */
-		i915->quirks |= QUIRK_PIN_SWIZZLED_PAGES;
+		i915->gem_quirks |= GEM_QUIRK_PIN_SWIZZLED_PAGES;
 		swizzle_x = I915_BIT_6_SWIZZLE_NONE;
 		swizzle_y = I915_BIT_6_SWIZZLE_NONE;
 	}
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index f5c6a0714d79..36cc05150249 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -411,7 +411,7 @@ static int i915_swizzle_info(struct seq_file *m, void *data)
 	seq_printf(m, "bit6 swizzle for Y-tiling = %s\n",
 		   swizzle_string(to_gt(dev_priv)->ggtt->bit_6_swizzle_y));
 
-	if (dev_priv->quirks & QUIRK_PIN_SWIZZLED_PAGES)
+	if (dev_priv->gem_quirks & GEM_QUIRK_PIN_SWIZZLED_PAGES)
 		seq_puts(m, "L-shaped memory detected\n");
 
 	/* On BDW+, swizzling is not used. See detect_bit_6_swizzle() */
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index f9170b45663f..22571f77dc71 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -87,10 +87,11 @@ struct vlv_s0ix_state;
 
 #define I915_COLOR_UNEVICTABLE (-1) /* a non-vma sharing the address space */
 
+#define GEM_QUIRK_PIN_SWIZZLED_PAGES	BIT(0)
+
 #define QUIRK_LVDS_SSC_DISABLE (1<<1)
 #define QUIRK_INVERT_BRIGHTNESS (1<<2)
 #define QUIRK_BACKLIGHT_PRESENT (1<<3)
-#define QUIRK_PIN_SWIZZLED_PAGES (1<<5)
 #define QUIRK_INCREASE_T12_DELAY (1<<6)
 #define QUIRK_INCREASE_DDI_DISABLED_TIME (1<<7)
 #define QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK (1<<8)
@@ -292,6 +293,7 @@ struct drm_i915_private {
 	enum intel_pch pch_type;
 	unsigned short pch_id;
 
+	unsigned long gem_quirks;
 	unsigned long quirks;
 
 	struct drm_atomic_state *modeset_restore_state;
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 0639ec7e5455..ccf8291a00e7 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1035,7 +1035,7 @@ i915_gem_madvise_ioctl(struct drm_device *dev, void *data,
 
 	if (i915_gem_object_has_pages(obj) &&
 	    i915_gem_object_is_tiled(obj) &&
-	    i915->quirks & QUIRK_PIN_SWIZZLED_PAGES) {
+	    i915->gem_quirks & GEM_QUIRK_PIN_SWIZZLED_PAGES) {
 		if (obj->mm.madv == I915_MADV_WILLNEED) {
 			GEM_BUG_ON(!i915_gem_object_has_tiling_quirk(obj));
 			i915_gem_object_clear_tiling_quirk(obj);
-- 
2.34.1


  parent reply	other threads:[~2022-08-11 15:16 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 15:07 [Intel-gfx] [PATCH 00/39] drm/i915: add display sub-struct to drm_i915_private Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 01/39] " Jani Nikula
2022-08-12  4:27   ` Murthy, Arun R
2022-08-12  6:40     ` Jani Nikula
2022-08-16  3:31       ` Murthy, Arun R
2022-08-16  7:37         ` Jani Nikula
2022-08-16  7:40           ` Murthy, Arun R
2022-08-17  1:23   ` Lucas De Marchi
2022-08-17  6:48     ` Jani Nikula
2022-08-17  8:07       ` Jani Nikula
2022-08-18 21:25         ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 02/39] drm/i915: move cdclk_funcs to display.funcs Jani Nikula
2022-08-12  4:32   ` Murthy, Arun R
2022-08-12  6:43     ` Jani Nikula
2022-08-16  3:42       ` Murthy, Arun R
2022-08-11 15:07 ` [Intel-gfx] [PATCH 03/39] drm/i915: move dpll_funcs " Jani Nikula
2022-08-12  4:33   ` Murthy, Arun R
2022-08-11 15:07 ` [Intel-gfx] [PATCH 04/39] drm/i915: move hotplug_funcs " Jani Nikula
2022-08-12  4:37   ` Murthy, Arun R
2022-08-12  6:45     ` Jani Nikula
2022-08-17  1:28   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 05/39] drm/i915: move clock_gating_funcs " Jani Nikula
2022-08-12  4:41   ` Murthy, Arun R
2022-08-12  6:48     ` Jani Nikula
2022-08-12  6:51       ` Jani Nikula
2022-08-16  3:45         ` Murthy, Arun R
2022-08-17  1:38   ` Lucas De Marchi
2022-08-17  6:50     ` Jani Nikula
2022-08-17  7:20       ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 06/39] drm/i915: move wm_disp funcs " Jani Nikula
2022-08-12  4:45   ` Murthy, Arun R
2022-08-12  6:54     ` Jani Nikula
2022-08-16  3:48       ` Murthy, Arun R
2022-08-17  3:50   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 07/39] drm/i915: move fdi_funcs " Jani Nikula
2022-08-12  4:48   ` Murthy, Arun R
2022-08-17  3:51   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 08/39] drm/i915: move color_funcs " Jani Nikula
2022-08-12  4:49   ` Murthy, Arun R
2022-08-17  3:52   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 09/39] drm/i915: move and group gmbus members under display.gmbus Jani Nikula
2022-08-12  4:53   ` Murthy, Arun R
2022-08-12  6:56     ` Jani Nikula
2022-08-16  3:59       ` Murthy, Arun R
2022-08-16  7:50         ` Jani Nikula
2022-08-16  8:04           ` Murthy, Arun R
2022-08-17  3:56   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 10/39] drm/i915: move and group pps members under display.pps Jani Nikula
2022-08-12  4:54   ` Murthy, Arun R
2022-08-12  6:58     ` Jani Nikula
2022-08-16  4:03       ` Murthy, Arun R
2022-08-17  3:57   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 11/39] drm/i915: move dmc to display.dmc Jani Nikula
2022-08-12  4:58   ` Murthy, Arun R
2022-08-12  7:00     ` Jani Nikula
2022-08-16  4:07       ` Murthy, Arun R
2022-08-11 15:07 ` [Intel-gfx] [PATCH 12/39] drm/i915: move and split audio under display.audio and display.funcs Jani Nikula
2022-08-12  5:02   ` Murthy, Arun R
2022-08-12  7:03     ` Jani Nikula
2022-08-16  4:13       ` Murthy, Arun R
2022-08-16  8:02         ` Jani Nikula
2022-08-16  8:28           ` Murthy, Arun R
2022-08-17  4:14   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 13/39] drm/i915: move dpll under display.dpll Jani Nikula
2022-08-17  4:16   ` Lucas De Marchi
2022-08-24 10:35     ` Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 14/39] drm/i915: move and group fbdev under display.fbdev Jani Nikula
2022-08-22  3:58   ` Murthy, Arun R
2022-08-11 15:07 ` [Intel-gfx] [PATCH 15/39] drm/i915: move wm to display.wm Jani Nikula
2022-08-22  4:00   ` Murthy, Arun R
2022-08-11 15:07 ` [Intel-gfx] [PATCH 16/39] drm/i915: move and group hdcp under display.hdcp Jani Nikula
2022-08-22  4:02   ` Murthy, Arun R
2022-08-11 15:07 ` [Intel-gfx] [PATCH 17/39] drm/i915: move hotplug to display.hotplug Jani Nikula
2022-08-17  4:24   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 18/39] drm/i915: move overlay to display.overlay Jani Nikula
2022-08-22  4:10   ` Murthy, Arun R
2022-08-11 15:07 ` [Intel-gfx] [PATCH 19/39] drm/i915: move and group sagv under display.sagv Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 20/39] drm/i915: move and group max_bw and bw_obj under display.bw Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 21/39] drm/i915: move opregion to display.opregion Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 22/39] drm/i915: move and group cdclk under display.cdclk Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 23/39] drm/i915: move backlight to display.backlight Jani Nikula
2022-08-17  4:30   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 24/39] drm/i915: move mipi_mmio_base to display.dsi Jani Nikula
2022-08-17  4:32   ` Lucas De Marchi
2022-08-17  7:00     ` Jani Nikula
2022-08-17  7:21       ` Lucas De Marchi
2022-08-17  7:54         ` Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 25/39] drm/i915: move vbt to display.vbt Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 26/39] drm/i915: move fbc to display.fbc Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 27/39] drm/i915/vrr: drop window2_delay member from i915 Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 28/39] drm/i915: move and group power related members under display.power Jani Nikula
2022-08-17  4:41   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 29/39] drm/i915: move and group fdi members under display.fdi Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 30/39] drm/i915: move fb_tracking under display sub-struct Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 31/39] drm/i915: move INTEL_FRONTBUFFER_* macros to intel_frontbuffer.h Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 32/39] drm/i915: move dbuf under display sub-struct Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 33/39] drm/i915: move and group modeset_wq and flip_wq under display.wq Jani Nikula
2022-08-11 15:07 ` Jani Nikula [this message]
2022-08-11 15:07 ` [Intel-gfx] [PATCH 35/39] drm/i915/quirks: abstract checking for display quirks Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 36/39] drm/i915/quirks: abstract quirks further by making quirk ids an enum Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 37/39] drm/i915: move quirks under display sub-struct Jani Nikula
2022-08-17  4:49   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 38/39] drm/i915: move atomic_helper " Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 39/39] drm/i915: move and group properties under display.properties Jani Nikula
2022-08-11 15:15 ` [Intel-gfx] [PATCH 00/39] drm/i915: add display sub-struct to drm_i915_private Jani Nikula
2022-08-11 15:38 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2022-08-11 15:38 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-08-11 15:58 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-08-12  0:40 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-08-17  4:52 ` [Intel-gfx] [PATCH 00/39] " Lucas De Marchi

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=1ba74f3a30b1f5e7d1705eac6e4c6ee3b95d0d5a.1660230121.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.