Skip to contentSkip to conversation

drm/i915: Add a small wrapper to check for CCS modifiers.

PATCH Superseded Dhinakaran Pandiyan 3 participants 10 messages Aug 22, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/i915: Add a small wrapper to check for CCS modifiers.

Code looks cleaner with modifiers hidden inside this wrapper.

---
 drivers/gpu/drm/i915/intel_display.c | 21 +++++++++++----------
 drivers/gpu/drm/i915/intel_display.h |  1 +
 drivers/gpu/drm/i915/intel_sprite.c  |  3 +--
 3 files changed, 13 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/intel_display.c +11 -10
index ad0f0e5389d9..b98eab113330 100644
@@ -2474,6 +2474,12 @@ intel_get_format_info(const struct drm_mode_fb_cmd2 *cmd)
 	}
 }
 
+bool is_ccs_modifier(const u64 modifier)
+{
+	return modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
+	       modifier == I915_FORMAT_MOD_Yf_TILED_CCS;
+}
+
 static int
 intel_fill_fb_info(struct drm_i915_private *dev_priv,
 		   struct drm_framebuffer *fb)
@@ -2504,8 +2510,7 @@ intel_fill_fb_info(struct drm_i915_private *dev_priv,
 			return ret;
 		}
 
-		if ((fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
-		     fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS) && i == 1) {
+		if (is_ccs_modifier(fb->modifier) && i == 1) {
 			int hsub = fb->format->hsub;
 			int vsub = fb->format->vsub;
 			int tile_width, tile_height;
@@ -3054,8 +3059,7 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state,
 	 * CCS AUX surface doesn't have its own x/y offsets, we must make sure
 	 * they match with the main surface x/y offsets.
 	 */
-	if (fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
-	    fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS) {
+	if (is_ccs_modifier(fb->modifier)) {
 		while (!skl_check_main_ccs_coordinates(plane_state, x, y, offset)) {
 			if (offset == 0)
 				break;
@@ -3189,8 +3193,7 @@ int skl_check_plane_surface(const struct intel_crtc_state *crtc_state,
 		ret = skl_check_nv12_aux_surface(plane_state);
 		if (ret)
 			return ret;
-	} else if (fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
-		   fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS) {
+	} else if (is_ccs_modifier(fb->modifier)) {
 		ret = skl_check_ccs_aux_surface(plane_state);
 		if (ret)
 			return ret;
@@ -13399,8 +13402,7 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_XBGR8888:
 	case DRM_FORMAT_ARGB8888:
 	case DRM_FORMAT_ABGR8888:
-		if (modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
-		    modifier == I915_FORMAT_MOD_Y_TILED_CCS)
+		if (is_ccs_modifier(modifier))
 			return true;
 		/* fall through */
 	case DRM_FORMAT_RGB565:
@@ -14596,8 +14598,7 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
 		 * potential runtime errors at plane configuration time.
 		 */
 		if (IS_GEN9(dev_priv) && i == 0 && fb->width > 3840 &&
-		    (fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
-		     fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS))
+		    is_ccs_modifier(fb->modifier))
 			stride_alignment *= 4;
 
 		if (fb->pitches[i] & (stride_alignment - 1)) {
drivers/gpu/drm/i915/intel_display.h +1 -0
index a04c5a495a2b..dbd8b1acf9d6 100644
@@ -381,4 +381,5 @@ void intel_link_compute_m_n(int bpp, int nlanes,
 			    struct intel_link_m_n *m_n,
 			    bool reduce_m_n);
 
+bool is_ccs_modifier(const u64 modifier);
 #endif
drivers/gpu/drm/i915/intel_sprite.c +1 -2
index f7026e887fa9..b49adcd93892 100644
@@ -1407,8 +1407,7 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_XBGR8888:
 	case DRM_FORMAT_ARGB8888:
 	case DRM_FORMAT_ABGR8888:
-		if (modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
-		    modifier == I915_FORMAT_MOD_Y_TILED_CCS)
+		if (is_ccs_modifier(modifier))
 			return true;
 		/* fall through */
 	case DRM_FORMAT_RGB565:
Signature · 6 lines
2.17.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 2/2 drm/i915: Rename PLANE_CTL_DECOMPRESSION_ENABLE

Rename PLANE_CTL_DECOMPRESSION_ENABLE to resemble the bpsec name - PLANE_CTL_RENDER_DECOMPRESSION_ENABLE

---
 drivers/gpu/drm/i915/i915_reg.h      | 2 +-
 drivers/gpu/drm/i915/intel_display.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +1 -1
index 59d06d0055bb..a338aaa2b313 100644
@@ -6515,7 +6515,7 @@ enum {
 #define   PLANE_CTL_YUV422_UYVY			(1 << 16)
 #define   PLANE_CTL_YUV422_YVYU			(2 << 16)
 #define   PLANE_CTL_YUV422_VYUY			(3 << 16)
-#define   PLANE_CTL_DECOMPRESSION_ENABLE	(1 << 15)
+#define   PLANE_CTL_RENDER_DECOMPRESSION_ENABLE	(1 << 15)
 #define   PLANE_CTL_TRICKLE_FEED_DISABLE	(1 << 14)
 #define   PLANE_CTL_PLANE_GAMMA_DISABLE		(1 << 13) /* Pre-GLK */
 #define   PLANE_CTL_TILED_MASK			(0x7 << 10)
drivers/gpu/drm/i915/intel_display.c +4 -4
index b98eab113330..ea2bf9c22ade 100644
@@ -3554,11 +3554,11 @@ static u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
 	case I915_FORMAT_MOD_Y_TILED:
 		return PLANE_CTL_TILED_Y;
 	case I915_FORMAT_MOD_Y_TILED_CCS:
-		return PLANE_CTL_TILED_Y | PLANE_CTL_DECOMPRESSION_ENABLE;
+		return PLANE_CTL_TILED_Y | PLANE_CTL_RENDER_DECOMPRESSION_ENABLE;
 	case I915_FORMAT_MOD_Yf_TILED:
 		return PLANE_CTL_TILED_YF;
 	case I915_FORMAT_MOD_Yf_TILED_CCS:
-		return PLANE_CTL_TILED_YF | PLANE_CTL_DECOMPRESSION_ENABLE;
+		return PLANE_CTL_TILED_YF | PLANE_CTL_RENDER_DECOMPRESSION_ENABLE;
 	default:
 		MISSING_CASE(fb_modifier);
 	}
@@ -8801,13 +8801,13 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
 		fb->modifier = I915_FORMAT_MOD_X_TILED;
 		break;
 	case PLANE_CTL_TILED_Y:
-		if (val & PLANE_CTL_DECOMPRESSION_ENABLE)
+		if (val & PLANE_CTL_RENDER_DECOMPRESSION_ENABLE)
 			fb->modifier = I915_FORMAT_MOD_Y_TILED_CCS;
 		else
 			fb->modifier = I915_FORMAT_MOD_Y_TILED;
 		break;
 	case PLANE_CTL_TILED_YF:
-		if (val & PLANE_CTL_DECOMPRESSION_ENABLE)
+		if (val & PLANE_CTL_RENDER_DECOMPRESSION_ENABLE)
 			fb->modifier = I915_FORMAT_MOD_Yf_TILED_CCS;
 		else
 			fb->modifier = I915_FORMAT_MOD_Yf_TILED;
Signature · 6 lines
2.17.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/i915: Rename PLANE_CTL_DECOMPRESSION_ENABLE

Quoted 6 lines · Dhinakaran Pandiyan

Rename PLANE_CTL_DECOMPRESSION_ENABLE to resemble the bpsec name - PLANE_CTL_RENDER_DECOMPRESSION_ENABLE

Quoted 54 lines
---
 drivers/gpu/drm/i915/i915_reg.h      | 2 +-
 drivers/gpu/drm/i915/intel_display.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +1 -1
index 59d06d0055bb..a338aaa2b313 100644
@@ -6515,7 +6515,7 @@ enum {
 #define   PLANE_CTL_YUV422_UYVY			(1 << 16)
 #define   PLANE_CTL_YUV422_YVYU			(2 << 16)
 #define   PLANE_CTL_YUV422_VYUY			(3 << 16)
-#define   PLANE_CTL_DECOMPRESSION_ENABLE	(1 << 15)
+#define   PLANE_CTL_RENDER_DECOMPRESSION_ENABLE	(1 << 15)
 #define   PLANE_CTL_TRICKLE_FEED_DISABLE	(1 << 14)
 #define   PLANE_CTL_PLANE_GAMMA_DISABLE		(1 << 13) /* Pre-GLK */
 #define   PLANE_CTL_TILED_MASK			(0x7 << 10)
drivers/gpu/drm/i915/intel_display.c +4 -4
index b98eab113330..ea2bf9c22ade 100644
@@ -3554,11 +3554,11 @@ static u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
 	case I915_FORMAT_MOD_Y_TILED:
 		return PLANE_CTL_TILED_Y;
 	case I915_FORMAT_MOD_Y_TILED_CCS:
-		return PLANE_CTL_TILED_Y | PLANE_CTL_DECOMPRESSION_ENABLE;
+		return PLANE_CTL_TILED_Y | PLANE_CTL_RENDER_DECOMPRESSION_ENABLE;
 	case I915_FORMAT_MOD_Yf_TILED:
 		return PLANE_CTL_TILED_YF;
 	case I915_FORMAT_MOD_Yf_TILED_CCS:
-		return PLANE_CTL_TILED_YF | PLANE_CTL_DECOMPRESSION_ENABLE;
+		return PLANE_CTL_TILED_YF | PLANE_CTL_RENDER_DECOMPRESSION_ENABLE;
 	default:
 		MISSING_CASE(fb_modifier);
 	}
@@ -8801,13 +8801,13 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
 		fb->modifier = I915_FORMAT_MOD_X_TILED;
 		break;
 	case PLANE_CTL_TILED_Y:
-		if (val & PLANE_CTL_DECOMPRESSION_ENABLE)
+		if (val & PLANE_CTL_RENDER_DECOMPRESSION_ENABLE)
 			fb->modifier = I915_FORMAT_MOD_Y_TILED_CCS;
 		else
 			fb->modifier = I915_FORMAT_MOD_Y_TILED;
 		break;
 	case PLANE_CTL_TILED_YF:
-		if (val & PLANE_CTL_DECOMPRESSION_ENABLE)
+		if (val & PLANE_CTL_RENDER_DECOMPRESSION_ENABLE)
 			fb->modifier = I915_FORMAT_MOD_Yf_TILED_CCS;
 		else
 			fb->modifier = I915_FORMAT_MOD_Yf_TILED;
Signature · 1 line
2.17.1
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Add a small wrapper to check for CCS modifiers.

In reply to Dhinakaran Pandiyan
== Series Details ==

== Series Details ==

Series: series starting with [1/2] drm/i915: Add a small wrapper to check for CCS modifiers.
URL : https://patchwork.freedesktop.org/series/48524/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4695 -> Patchwork_9986 =

== Summary - SUCCESS ==

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/48524/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in Patchwork_9986:

=== IGT changes ===

    ==== Possible regressions ====

    {igt@pm_rpm@module-reload}:
      fi-byt-j1900:       NOTRUN -> DMESG-WARN

    
    ==== Warnings ====

    {igt@kms_psr@primary_page_flip}:
      fi-cnl-psr:         DMESG-WARN -> DMESG-FAIL

== Known issues ==

Here are the changes found in Patchwork_9986 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@debugfs_test@read_all_entries:
      fi-snb-2520m:       PASS -> INCOMPLETE (fdo#103713)

    igt@drv_selftest@live_hangcheck:
      fi-kbl-7560u:       PASS -> DMESG-FAIL (fdo#106560, fdo#106947)

    igt@gem_exec_parallel@basic:
      fi-byt-j1900:       NOTRUN -> FAIL (fdo#105900)

    igt@kms_pipe_crc_basic@hang-read-crc-pipe-b:
      {fi-byt-clapper}:   PASS -> FAIL (fdo#103191, fdo#107362)

    
    ==== Possible fixes ====

    igt@drv_selftest@live_hangcheck:
      {fi-cfl-8109u}:     DMESG-FAIL (fdo#106560) -> PASS

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#105900 https://bugs.freedesktop.org/show_bug.cgi?id=105900
fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362

== Participating hosts (52 -> 47) ==

Additional (1): fi-byt-j1900
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-bdw-samus

== Build changes ==

* Linux: CI_DRM_4695 -> Patchwork_9986

CI_DRM_4695: f352837700ec39dbaf00cdf727650851993d754b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4608: 94ebd21177feedf03e8f6dd1e73dca1a6ec7a0ac @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9986: e0e5f922c1dcd1f69634fbdafbb7e6cbea810eb8 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

e0e5f922c1dc drm/i915: Rename PLANE_CTL_DECOMPRESSION_ENABLE c0f90d508893 drm/i915: Add a small wrapper to check for CCS modifiers.

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9986/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

✓ Fi.CI.IGT: success for series starting with [1/2] drm/i915: Add a small wrapper to check for CCS modifiers.

In reply to Dhinakaran Pandiyan
== Series Details ==

== Series Details ==

Series: series starting with [1/2] drm/i915: Add a small wrapper to check for CCS modifiers.
URL : https://patchwork.freedesktop.org/series/48524/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4695_full -> Patchwork_9986_full =

== Summary - SUCCESS ==

No regressions found.

== Known issues ==

Here are the changes found in Patchwork_9986_full that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@gem_ctx_isolation@vcs1-s3:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
      shard-glk:          PASS -> FAIL (fdo#105363)

    igt@kms_setmode@basic:
      shard-apl:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-kbl:          INCOMPLETE (fdo#103665, fdo#106023) -> PASS

    igt@kms_flip@flip-vs-expired-vblank:
      shard-glk:          FAIL (fdo#105363) -> PASS

    igt@pm_rpm@system-suspend:
      shard-kbl:          INCOMPLETE (fdo#107556, fdo#103665) -> PASS

fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

== Participating hosts (5 -> 5) ==

No changes in participating hosts

== Build changes ==

* Linux: CI_DRM_4695 -> Patchwork_9986

CI_DRM_4695: f352837700ec39dbaf00cdf727650851993d754b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4608: 94ebd21177feedf03e8f6dd1e73dca1a6ec7a0ac @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9986: e0e5f922c1dcd1f69634fbdafbb7e6cbea810eb8 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9986/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/2
#5 lore raw
In reply to Dhinakaran Pandiyan
Quoted 14 lines · Dhinakaran Pandiyan

Code looks cleaner with modifiers hidden inside this wrapper.

---
 drivers/gpu/drm/i915/intel_display.c | 21 +++++++++++----------
 drivers/gpu/drm/i915/intel_display.h |  1 +
 drivers/gpu/drm/i915/intel_sprite.c  |  3 +--
 3 files changed, 13 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index ad0f0e5389d9..b98eab113330 100644

drivers/gpu/drm/i915/intel_display.c intel_get_format_info(const struct drm_mode_fb_cmd2 *cmd) · line 2477

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -2474,6 +2474,12 @@ intel_get_format_info(const struct drm_mode_fb_cmd2 *cmd)
 	}
 }
 
+bool is_ccs_modifier(const u64 modifier)

const is rather pointless here IMO.

drivers/gpu/drm/i915/intel_display.c intel_get_format_info(const struct drm_mode_fb_cmd2 *cmd) · line 2481

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
+{
+	return modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
+	       modifier == I915_FORMAT_MOD_Yf_TILED_CCS;
+}

IIRC I had a similar thing in my gtt remapping series, though I didn't plug it into all the places that could have used it.

Quoted 80 lines
drivers/gpu/drm/i915/intel_display.c +6 -10
+
 static int
 intel_fill_fb_info(struct drm_i915_private *dev_priv,
 		   struct drm_framebuffer *fb)
@@ -2504,8 +2510,7 @@ intel_fill_fb_info(struct drm_i915_private *dev_priv,
 			return ret;
 		}
 
-		if ((fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
-		     fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS) && i == 1) {
+		if (is_ccs_modifier(fb->modifier) && i == 1) {
 			int hsub = fb->format->hsub;
 			int vsub = fb->format->vsub;
 			int tile_width, tile_height;
@@ -3054,8 +3059,7 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state,
 	 * CCS AUX surface doesn't have its own x/y offsets, we must make sure
 	 * they match with the main surface x/y offsets.
 	 */
-	if (fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
-	    fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS) {
+	if (is_ccs_modifier(fb->modifier)) {
 		while (!skl_check_main_ccs_coordinates(plane_state, x, y, offset)) {
 			if (offset == 0)
 				break;
@@ -3189,8 +3193,7 @@ int skl_check_plane_surface(const struct intel_crtc_state *crtc_state,
 		ret = skl_check_nv12_aux_surface(plane_state);
 		if (ret)
 			return ret;
-	} else if (fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
-		   fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS) {
+	} else if (is_ccs_modifier(fb->modifier)) {
 		ret = skl_check_ccs_aux_surface(plane_state);
 		if (ret)
 			return ret;
@@ -13399,8 +13402,7 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_XBGR8888:
 	case DRM_FORMAT_ARGB8888:
 	case DRM_FORMAT_ABGR8888:
-		if (modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
-		    modifier == I915_FORMAT_MOD_Y_TILED_CCS)
+		if (is_ccs_modifier(modifier))
 			return true;
 		/* fall through */
 	case DRM_FORMAT_RGB565:
@@ -14596,8 +14598,7 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
 		 * potential runtime errors at plane configuration time.
 		 */
 		if (IS_GEN9(dev_priv) && i == 0 && fb->width > 3840 &&
-		    (fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
-		     fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS))
+		    is_ccs_modifier(fb->modifier))
 			stride_alignment *= 4;
 
 		if (fb->pitches[i] & (stride_alignment - 1)) {
drivers/gpu/drm/i915/intel_display.h +1 -0
index a04c5a495a2b..dbd8b1acf9d6 100644
@@ -381,4 +381,5 @@ void intel_link_compute_m_n(int bpp, int nlanes,
 			    struct intel_link_m_n *m_n,
 			    bool reduce_m_n);
 
+bool is_ccs_modifier(const u64 modifier);
 #endif
drivers/gpu/drm/i915/intel_sprite.c +1 -2
index f7026e887fa9..b49adcd93892 100644
@@ -1407,8 +1407,7 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_XBGR8888:
 	case DRM_FORMAT_ARGB8888:
 	case DRM_FORMAT_ABGR8888:
-		if (modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
-		    modifier == I915_FORMAT_MOD_Y_TILED_CCS)
+		if (is_ccs_modifier(modifier))
 			return true;
 		/* fall through */
 	case DRM_FORMAT_RGB565:
Signature · 1 line
2.17.1
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw
Quoted 20 lines · Ville Syrjälä
Quoted 19 lines · Dhinakaran Pandiyan

Code looks cleaner with modifiers hidden inside this wrapper.

---
 drivers/gpu/drm/i915/intel_display.c | 21 +++++++++++----------
 drivers/gpu/drm/i915/intel_display.h |  1 +
 drivers/gpu/drm/i915/intel_sprite.c  |  3 +--
 3 files changed, 13 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index ad0f0e5389d9..b98eab113330 100644
@@ -2474,6 +2474,12 @@ intel_get_format_info(const struct
 drm_mode_fb_cmd2 *cmd)
 	}
 }
 
Quoted 3 lines

drivers/gpu/drm/i915/intel_display.c intel_get_format_info(const struct drm_mode_fb_cmd2 *cmd) · line 2477

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1 -0
+bool is_ccs_modifier(const u64 modifier)

const is rather pointless here IMO.

I thought of it as harmless documentation, will remove and send a v2.

Quoted 10 lines

drivers/gpu/drm/i915/intel_display.c intel_get_format_info(const struct drm_mode_fb_cmd2 *cmd) · line 2481

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
+{
+	return modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
+	       modifier == I915_FORMAT_MOD_Yf_TILED_CCS;
+}

IIRC I had a similar thing in my gtt remapping series, though I didn't
plug it into all the places that could have used it.

Quoted 2 lines

Thanks for the reviews. We have to get your plane refactor series merged soon, I'm hoping I can make some time to start reviewing it this week.

-DK

Quoted 89 lines
Quoted 89 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
+
 static int
 intel_fill_fb_info(struct drm_i915_private *dev_priv,
drivers/gpu/drm/i915/intel_display.c +0 -1
 		   struct drm_framebuffer *fb)
@@ -2504,8 +2510,7 @@ intel_fill_fb_info(struct drm_i915_private
 *dev_priv,
 			return ret;
 		}
 
-		if ((fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS

||

drivers/gpu/drm/i915/intel_display.c +0 -1
-		     fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS)

&& i == 1) {

drivers/gpu/drm/i915/intel_display.c +1 -0
+		if (is_ccs_modifier(fb->modifier) && i == 1) {
 			int hsub = fb->format->hsub;
 			int vsub = fb->format->vsub;
 			int tile_width, tile_height;
@@ -3054,8 +3059,7 @@ static int skl_check_main_surface(const
 struct intel_crtc_state *crtc_state,
 	 * CCS AUX surface doesn't have its own x/y offsets, we

must make sure

drivers/gpu/drm/i915/intel_display.c +1 -2
 	 * they match with the main surface x/y offsets.
 	 */
-	if (fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
-	    fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS) {
+	if (is_ccs_modifier(fb->modifier)) {
 		while

(!skl_check_main_ccs_coordinates(plane_state, x, y, offset)) {

drivers/gpu/drm/i915/intel_display.c +1 -2
 			if (offset == 0)
 				break;
@@ -3189,8 +3193,7 @@ int skl_check_plane_surface(const struct
 intel_crtc_state *crtc_state,
 		ret = skl_check_nv12_aux_surface(plane_state);
 		if (ret)
 			return ret;
-	} else if (fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
-		   fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS) {
+	} else if (is_ccs_modifier(fb->modifier)) {
 		ret = skl_check_ccs_aux_surface(plane_state);
 		if (ret)
drivers/gpu/drm/i915/intel_display.c +1 -2
 			return ret;
@@ -13399,8 +13402,7 @@ static bool
 skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_XBGR8888:
 	case DRM_FORMAT_ARGB8888:
 	case DRM_FORMAT_ABGR8888:
-		if (modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
-		    modifier == I915_FORMAT_MOD_Y_TILED_CCS)
+		if (is_ccs_modifier(modifier))
 			return true;
 		/* fall through */
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_RGB565:
@@ -14596,8 +14598,7 @@ static int intel_framebuffer_init(struct
 intel_framebuffer *intel_fb,
 		 * potential runtime errors at plane configuration

time.

drivers/gpu/drm/i915/intel_display.c +0 -0
 		 */
 		if (IS_GEN9(dev_priv) && i == 0 && fb->width >

3840 &&

drivers/gpu/drm/i915/intel_display.c +0 -1
-		    (fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS

||

drivers/gpu/drm/i915/intel_display.c +0 -1
-		     fb->modifier ==

I915_FORMAT_MOD_Yf_TILED_CCS))

drivers/gpu/drm/i915/intel_display.c +1 -0
+		    is_ccs_modifier(fb->modifier))
 			stride_alignment *= 4;
 
 		if (fb->pitches[i] & (stride_alignment - 1)) {
drivers/gpu/drm/i915/intel_display.h +1 -0
index a04c5a495a2b..dbd8b1acf9d6 100644
@@ -381,4 +381,5 @@ void intel_link_compute_m_n(int bpp, int
 nlanes,
 			    struct intel_link_m_n *m_n,
 			    bool reduce_m_n);
 
+bool is_ccs_modifier(const u64 modifier);

#endif

drivers/gpu/drm/i915/intel_sprite.c +0 -0
index f7026e887fa9..b49adcd93892 100644
@@ -1407,8 +1407,7 @@ static bool
 skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_XBGR8888:
 	case DRM_FORMAT_ARGB8888:
 	case DRM_FORMAT_ABGR8888:
Quoted 10 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_sprite.c +1 -2
-		if (modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
-		    modifier == I915_FORMAT_MOD_Y_TILED_CCS)
+		if (is_ccs_modifier(modifier))
 			return true;
 		/* fall through */

case DRM_FORMAT_RGB565:

Signature · 1 line
2.17.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw

PATCH v2 1/1 drm/i915: Add a small wrapper to check for CCS modifiers.

In reply to Ville Syrjälä

Code looks cleaner with modifiers hidden inside this wrapper.
v2: Remove const qualifier (Ville)

---
 drivers/gpu/drm/i915/intel_display.c | 21 +++++++++++----------
 drivers/gpu/drm/i915/intel_display.h |  1 +
 drivers/gpu/drm/i915/intel_sprite.c  |  3 +--
 3 files changed, 13 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/intel_display.c +11 -10
index ad0f0e5389d9..85062d07b201 100644
@@ -2474,6 +2474,12 @@ intel_get_format_info(const struct drm_mode_fb_cmd2 *cmd)
 	}
 }
 
+bool is_ccs_modifier(u64 modifier)
+{
+	return modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
+	       modifier == I915_FORMAT_MOD_Yf_TILED_CCS;
+}
+
 static int
 intel_fill_fb_info(struct drm_i915_private *dev_priv,
 		   struct drm_framebuffer *fb)
@@ -2504,8 +2510,7 @@ intel_fill_fb_info(struct drm_i915_private *dev_priv,
 			return ret;
 		}
 
-		if ((fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
-		     fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS) && i == 1) {
+		if (is_ccs_modifier(fb->modifier) && i == 1) {
 			int hsub = fb->format->hsub;
 			int vsub = fb->format->vsub;
 			int tile_width, tile_height;
@@ -3054,8 +3059,7 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state,
 	 * CCS AUX surface doesn't have its own x/y offsets, we must make sure
 	 * they match with the main surface x/y offsets.
 	 */
-	if (fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
-	    fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS) {
+	if (is_ccs_modifier(fb->modifier)) {
 		while (!skl_check_main_ccs_coordinates(plane_state, x, y, offset)) {
 			if (offset == 0)
 				break;
@@ -3189,8 +3193,7 @@ int skl_check_plane_surface(const struct intel_crtc_state *crtc_state,
 		ret = skl_check_nv12_aux_surface(plane_state);
 		if (ret)
 			return ret;
-	} else if (fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
-		   fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS) {
+	} else if (is_ccs_modifier(fb->modifier)) {
 		ret = skl_check_ccs_aux_surface(plane_state);
 		if (ret)
 			return ret;
@@ -13399,8 +13402,7 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_XBGR8888:
 	case DRM_FORMAT_ARGB8888:
 	case DRM_FORMAT_ABGR8888:
-		if (modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
-		    modifier == I915_FORMAT_MOD_Y_TILED_CCS)
+		if (is_ccs_modifier(modifier))
 			return true;
 		/* fall through */
 	case DRM_FORMAT_RGB565:
@@ -14596,8 +14598,7 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
 		 * potential runtime errors at plane configuration time.
 		 */
 		if (IS_GEN9(dev_priv) && i == 0 && fb->width > 3840 &&
-		    (fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
-		     fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS))
+		    is_ccs_modifier(fb->modifier))
 			stride_alignment *= 4;
 
 		if (fb->pitches[i] & (stride_alignment - 1)) {
drivers/gpu/drm/i915/intel_display.h +1 -0
index a04c5a495a2b..43f080c6538d 100644
@@ -381,4 +381,5 @@ void intel_link_compute_m_n(int bpp, int nlanes,
 			    struct intel_link_m_n *m_n,
 			    bool reduce_m_n);
 
+bool is_ccs_modifier(u64 modifier);
 #endif
drivers/gpu/drm/i915/intel_sprite.c +1 -2
index 774bfb03c5d9..c286dda625e4 100644
@@ -1409,8 +1409,7 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_XBGR8888:
 	case DRM_FORMAT_ARGB8888:
 	case DRM_FORMAT_ABGR8888:
-		if (modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
-		    modifier == I915_FORMAT_MOD_Y_TILED_CCS)
+		if (is_ccs_modifier(modifier))
 			return true;
 		/* fall through */
 	case DRM_FORMAT_RGB565:
Signature · 6 lines
2.17.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

✓ Fi.CI.BAT: success for series starting with [v2] drm/i915: Add a small wrapper to check for CCS modifiers. (rev2)

In reply to Dhinakaran Pandiyan
== Series Details ==

== Series Details ==

Series: series starting with [v2] drm/i915: Add a small wrapper to check for CCS modifiers. (rev2)
URL : https://patchwork.freedesktop.org/series/48524/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4697 -> Patchwork_9994 =

== Summary - SUCCESS ==

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/48524/revisions/2/mbox/

== Known issues ==

Here are the changes found in Patchwork_9994 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_hangcheck:
      {fi-kbl-8809g}:     PASS -> DMESG-FAIL (fdo#106947, fdo#106560)

    {igt@pm_rpm@module-reload}:
      fi-cnl-psr:         PASS -> WARN (fdo#107602)

    
    ==== Possible fixes ====

    igt@debugfs_test@read_all_entries:
      fi-snb-2520m:       INCOMPLETE (fdo#103713) -> PASS

    igt@drv_selftest@live_coherency:
      fi-gdg-551:         DMESG-FAIL (fdo#107164) -> PASS

    igt@drv_selftest@live_hangcheck:
      fi-bxt-j4205:       DMESG-FAIL (fdo#106560) -> PASS

    igt@kms_frontbuffer_tracking@basic:
      {fi-byt-clapper}:   FAIL (fdo#103167) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      fi-skl-guc:         FAIL (fdo#103191) -> PASS
      fi-bxt-dsi:         INCOMPLETE (fdo#103927) -> PASS

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947
fdo#107164 https://bugs.freedesktop.org/show_bug.cgi?id=107164
fdo#107602 https://bugs.freedesktop.org/show_bug.cgi?id=107602

== Participating hosts (54 -> 48) ==

Missing (6): fi-ilk-m540 fi-hsw-4200u fi-hsw-peppy fi-byt-squawks fi-bsw-cyan fi-ctg-p8600

== Build changes ==

* Linux: CI_DRM_4697 -> Patchwork_9994

CI_DRM_4697: b68c36de381756889dffa2c8de3206c8bf9a66d2 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4608: 94ebd21177feedf03e8f6dd1e73dca1a6ec7a0ac @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9994: 34f47ae1580b75ec1cdc1f5666caba114ca9743c @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

34f47ae1580b drm/i915: Rename PLANE_CTL_DECOMPRESSION_ENABLE d077a8e50b7f drm/i915: Add a small wrapper to check for CCS modifiers.

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9994/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#9 lore raw

✗ Fi.CI.IGT: failure for series starting with [v2] drm/i915: Add a small wrapper to check for CCS modifiers. (rev2)

In reply to Dhinakaran Pandiyan
== Series Details ==

== Series Details ==

Series: series starting with [v2] drm/i915: Add a small wrapper to check for CCS modifiers. (rev2)
URL : https://patchwork.freedesktop.org/series/48524/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4697_full -> Patchwork_9994_full =

== Summary - FAILURE ==

Serious unknown changes coming with Patchwork_9994_full absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_9994_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

== Possible new issues ==

Here are the unknown changes that may have been introduced in Patchwork_9994_full:

=== IGT changes ===

    ==== Possible regressions ====

    igt@gem_eio@reset-stress:
      shard-kbl:          PASS -> FAIL

== Known issues ==

Here are the changes found in Patchwork_9994_full that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@gem_ctx_isolation@vcs1-s3:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@gem_ppgtt@blt-vs-render-ctxn:
      shard-kbl:          PASS -> INCOMPLETE (fdo#106023, fdo#103665)

    igt@kms_setmode@basic:
      shard-kbl:          PASS -> FAIL (fdo#99912)

fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

== Participating hosts (5 -> 5) ==

No changes in participating hosts

== Build changes ==

* Linux: CI_DRM_4697 -> Patchwork_9994

CI_DRM_4697: b68c36de381756889dffa2c8de3206c8bf9a66d2 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4608: 94ebd21177feedf03e8f6dd1e73dca1a6ec7a0ac @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9994: 34f47ae1580b75ec1cdc1f5666caba114ca9743c @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9994/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx