Skip to content

Commit 13fad66

Browse files
committed
drm/i915: Nuke intel_plane_config.tiling
Use intel_fb_modifier_to_tiling() to convert the modifier into the fence tiling mode during BIOS FB readout, rather than hand rolling it. With this we can also stop tracking the tiling mode in the intel_plane_config. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/20251107181126.5743-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula <jani.nikula@intel.com>
1 parent 73206a7 commit 13fad66

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,10 +1188,8 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
11881188
val = intel_de_read(display, DSPCNTR(display, i9xx_plane));
11891189

11901190
if (DISPLAY_VER(display) >= 4) {
1191-
if (val & DISP_TILED) {
1192-
plane_config->tiling = I915_TILING_X;
1191+
if (val & DISP_TILED)
11931192
fb->modifier = I915_FORMAT_MOD_X_TILED;
1194-
}
11951193

11961194
if (val & DISP_ROTATE_180)
11971195
plane_config->rotation = DRM_MODE_ROTATE_180;
@@ -1211,7 +1209,7 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
12111209
DSPOFFSET(display, i9xx_plane));
12121210
base = intel_de_read(display, DSPSURF(display, i9xx_plane)) & DISP_ADDR_MASK;
12131211
} else if (DISPLAY_VER(display) >= 4) {
1214-
if (plane_config->tiling)
1212+
if (fb->modifier == I915_FORMAT_MOD_X_TILED)
12151213
offset = intel_de_read(display,
12161214
DSPTILEOFF(display, i9xx_plane));
12171215
else

drivers/gpu/drm/i915/display/intel_display_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,6 @@ struct intel_initial_plane_config {
726726
struct intel_memory_region *mem;
727727
resource_size_t phys_base;
728728
struct i915_vma *vma;
729-
unsigned int tiling;
730729
int size;
731730
u32 base;
732731
u8 rotation;

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ initial_plane_vma(struct intel_display *display,
133133
struct drm_mm_node orig_mm = {};
134134
struct i915_vma *vma;
135135
resource_size_t phys_base;
136+
unsigned int tiling;
136137
u32 base, size;
137138
u64 pinctl;
138139

@@ -179,17 +180,19 @@ initial_plane_vma(struct intel_display *display,
179180
i915_gem_object_set_cache_coherency(obj, HAS_WT(i915) ?
180181
I915_CACHE_WT : I915_CACHE_NONE);
181182

182-
switch (plane_config->tiling) {
183+
tiling = intel_fb_modifier_to_tiling(plane_config->fb->base.modifier);
184+
185+
switch (tiling) {
183186
case I915_TILING_NONE:
184187
break;
185188
case I915_TILING_X:
186189
case I915_TILING_Y:
187190
obj->tiling_and_stride =
188191
plane_config->fb->base.pitches[0] |
189-
plane_config->tiling;
192+
tiling;
190193
break;
191194
default:
192-
MISSING_CASE(plane_config->tiling);
195+
MISSING_CASE(tiling);
193196
goto err_obj;
194197
}
195198

@@ -374,7 +377,7 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc,
374377
plane_state->uapi.crtc_w = fb->width;
375378
plane_state->uapi.crtc_h = fb->height;
376379

377-
if (plane_config->tiling)
380+
if (fb->modifier != DRM_FORMAT_MOD_LINEAR)
378381
dev_priv->preserve_bios_swizzle = true;
379382

380383
plane_state->uapi.fb = fb;

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3090,11 +3090,9 @@ skl_get_initial_plane_config(struct intel_crtc *crtc,
30903090
fb->modifier = DRM_FORMAT_MOD_LINEAR;
30913091
break;
30923092
case PLANE_CTL_TILED_X:
3093-
plane_config->tiling = I915_TILING_X;
30943093
fb->modifier = I915_FORMAT_MOD_X_TILED;
30953094
break;
30963095
case PLANE_CTL_TILED_Y:
3097-
plane_config->tiling = I915_TILING_Y;
30983096
if (val & PLANE_CTL_RENDER_DECOMPRESSION_ENABLE)
30993097
if (DISPLAY_VER(display) >= 14)
31003098
fb->modifier = I915_FORMAT_MOD_4_TILED_MTL_RC_CCS;

0 commit comments

Comments
 (0)