Skip to content

Commit 3c542cf

Browse files
committed
drm/i915/dg2: Tile 4 plane format support
TileF(Tile4 in bspec) format is 4K tile organized into 64B subtiles with same basic shape as for legacy TileY which will be supported by Display13. v2: - Fixed wrong case condition(Jani Nikula) - Increased I915_FORMAT_MOD_F_TILED up to 12(Imre Deak) v3: - s/I915_TILING_F/TILING_4/g - s/I915_FORMAT_MOD_F_TILED/I915_FORMAT_MOD_4_TILED/g - Removed unneeded fencing code v4: - Rebased, fixed merge conflict with new table-oriented format modifier checking(Stan) - Replaced the rest of "Tile F" mentions to "Tile 4"(Stan) v5: - Still had to remove some Tile F mentionings - Moved has_4tile from adlp to DG2(Ramalingam C) - Check specifically for DG2, but not the Display13(Imre) v6: - Moved Tile4 associating struct for modifier/display to the beginning(Imre Deak) - Removed unneeded case I915_FORMAT_MOD_4_TILED modifier checks(Imre Deak) - Fixed I915_FORMAT_MOD_4_TILED to be 9 instead of 12 (Imre Deak) v7: - Fixed display_ver to { 13, 13 }(Imre Deak) - Removed redundant newline(Imre Deak) Reviewed-by: Imre Deak <[email protected]> Cc: Imre Deak <[email protected]> Cc: Matt Roper <[email protected]> Cc: Maarten Lankhorst <[email protected]> Signed-off-by: Stanislav Lisovskiy <[email protected]> Signed-off-by: Matt Roper <[email protected]> Signed-off-by: Juha-Pekka Heikkilä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 448cc2f commit 3c542cf

File tree

11 files changed

+37
-8
lines changed

11 files changed

+37
-8
lines changed

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7766,6 +7766,7 @@ static int intel_atomic_check_async(struct intel_atomic_state *state, struct int
77667766
case I915_FORMAT_MOD_X_TILED:
77677767
case I915_FORMAT_MOD_Y_TILED:
77687768
case I915_FORMAT_MOD_Yf_TILED:
7769+
case I915_FORMAT_MOD_4_TILED:
77697770
break;
77707771
default:
77717772
drm_dbg_kms(&i915->drm,

drivers/gpu/drm/i915/display/intel_fb.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ struct intel_modifier_desc {
139139

140140
static const struct intel_modifier_desc intel_modifiers[] = {
141141
{
142+
.modifier = I915_FORMAT_MOD_4_TILED,
143+
.display_ver = { 13, 13 },
144+
}, {
142145
.modifier = I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS,
143146
.display_ver = { 12, 13 },
144147
.plane_caps = INTEL_PLANE_CAP_TILING_Y | INTEL_PLANE_CAP_CCS_MC,
@@ -544,6 +547,12 @@ intel_tile_width_bytes(const struct drm_framebuffer *fb, int color_plane)
544547
return 128;
545548
else
546549
return 512;
550+
case I915_FORMAT_MOD_4_TILED:
551+
/*
552+
* Each 4K tile consists of 64B(8*8) subtiles, with
553+
* same shape as Y Tile(i.e 4*16B OWords)
554+
*/
555+
return 128;
547556
case I915_FORMAT_MOD_Y_TILED_CCS:
548557
if (intel_fb_is_ccs_aux_plane(fb, color_plane))
549558
return 128;

drivers/gpu/drm/i915/display/intel_fbc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,7 @@ static bool tiling_is_valid(struct drm_i915_private *i915,
898898
case I915_FORMAT_MOD_Y_TILED:
899899
case I915_FORMAT_MOD_Yf_TILED:
900900
return DISPLAY_VER(i915) >= 9;
901+
case I915_FORMAT_MOD_4_TILED:
901902
case I915_FORMAT_MOD_X_TILED:
902903
return true;
903904
default:

drivers/gpu/drm/i915/display/intel_plane_initial.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
125125
case DRM_FORMAT_MOD_LINEAR:
126126
case I915_FORMAT_MOD_X_TILED:
127127
case I915_FORMAT_MOD_Y_TILED:
128+
case I915_FORMAT_MOD_4_TILED:
128129
break;
129130
default:
130131
drm_dbg(&dev_priv->drm,

drivers/gpu/drm/i915/display/skl_universal_plane.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,8 @@ static u32 skl_plane_ctl_tiling(u64 fb_modifier)
751751
return PLANE_CTL_TILED_X;
752752
case I915_FORMAT_MOD_Y_TILED:
753753
return PLANE_CTL_TILED_Y;
754+
case I915_FORMAT_MOD_4_TILED:
755+
return PLANE_CTL_TILED_4;
754756
case I915_FORMAT_MOD_Y_TILED_CCS:
755757
case I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC:
756758
return PLANE_CTL_TILED_Y | PLANE_CTL_RENDER_DECOMPRESSION_ENABLE;
@@ -1971,9 +1973,7 @@ static bool gen12_plane_format_mod_supported(struct drm_plane *_plane,
19711973
case DRM_FORMAT_Y216:
19721974
case DRM_FORMAT_XVYU12_16161616:
19731975
case DRM_FORMAT_XVYU16161616:
1974-
if (modifier == DRM_FORMAT_MOD_LINEAR ||
1975-
modifier == I915_FORMAT_MOD_X_TILED ||
1976-
modifier == I915_FORMAT_MOD_Y_TILED)
1976+
if (!intel_fb_is_ccs_modifier(modifier))
19771977
return true;
19781978
fallthrough;
19791979
default:
@@ -2299,11 +2299,15 @@ skl_get_initial_plane_config(struct intel_crtc *crtc,
22992299
else
23002300
fb->modifier = I915_FORMAT_MOD_Y_TILED;
23012301
break;
2302-
case PLANE_CTL_TILED_YF:
2303-
if (val & PLANE_CTL_RENDER_DECOMPRESSION_ENABLE)
2304-
fb->modifier = I915_FORMAT_MOD_Yf_TILED_CCS;
2305-
else
2306-
fb->modifier = I915_FORMAT_MOD_Yf_TILED;
2302+
case PLANE_CTL_TILED_YF: /* aka PLANE_CTL_TILED_4 on XE_LPD+ */
2303+
if (HAS_4TILE(dev_priv)) {
2304+
fb->modifier = I915_FORMAT_MOD_4_TILED;
2305+
} else {
2306+
if (val & PLANE_CTL_RENDER_DECOMPRESSION_ENABLE)
2307+
fb->modifier = I915_FORMAT_MOD_Yf_TILED_CCS;
2308+
else
2309+
fb->modifier = I915_FORMAT_MOD_Yf_TILED;
2310+
}
23072311
break;
23082312
default:
23092313
MISSING_CASE(tiling);

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,6 +1624,7 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
16241624
#define CMDPARSER_USES_GGTT(dev_priv) (GRAPHICS_VER(dev_priv) == 7)
16251625

16261626
#define HAS_LLC(dev_priv) (INTEL_INFO(dev_priv)->has_llc)
1627+
#define HAS_4TILE(dev_priv) (INTEL_INFO(dev_priv)->has_4tile)
16271628
#define HAS_SNOOP(dev_priv) (INTEL_INFO(dev_priv)->has_snoop)
16281629
#define HAS_EDRAM(dev_priv) ((dev_priv)->edram_size_mb)
16291630
#define HAS_SECURE_BATCHES(dev_priv) (GRAPHICS_VER(dev_priv) < 6)

drivers/gpu/drm/i915/i915_pci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,7 @@ static const struct intel_device_info dg2_info = {
10441044
DGFX_FEATURES,
10451045
.graphics_rel = 55,
10461046
.media_rel = 55,
1047+
.has_4tile = 1,
10471048
PLATFORM(INTEL_DG2),
10481049
.platform_engine_mask =
10491050
BIT(RCS0) | BIT(BCS0) |

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7210,6 +7210,7 @@ enum {
72107210
#define PLANE_CTL_TILED_X (1 << 10)
72117211
#define PLANE_CTL_TILED_Y (4 << 10)
72127212
#define PLANE_CTL_TILED_YF (5 << 10)
7213+
#define PLANE_CTL_TILED_4 (5 << 10)
72137214
#define PLANE_CTL_ASYNC_FLIP (1 << 9)
72147215
#define PLANE_CTL_FLIP_HORIZONTAL (1 << 8)
72157216
#define PLANE_CTL_MEDIA_DECOMPRESSION_ENABLE (1 << 4) /* TGL+ */

drivers/gpu/drm/i915/intel_device_info.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ enum intel_ppgtt_type {
125125
func(has_64bit_reloc); \
126126
func(gpu_reset_clobbers_display); \
127127
func(has_reset_engine); \
128+
func(has_4tile); \
128129
func(has_global_mocs); \
129130
func(has_gt_uc); \
130131
func(has_l3_dpf); \

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5386,6 +5386,7 @@ skl_compute_wm_params(const struct intel_crtc_state *crtc_state,
53865386
}
53875387

53885388
wp->y_tiled = modifier == I915_FORMAT_MOD_Y_TILED ||
5389+
modifier == I915_FORMAT_MOD_4_TILED ||
53895390
modifier == I915_FORMAT_MOD_Yf_TILED ||
53905391
modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
53915392
modifier == I915_FORMAT_MOD_Yf_TILED_CCS;

0 commit comments

Comments
 (0)