Skip to content

Commit 214bba5

Browse files
vsyrjalarodrigovivi
authored andcommitted
drm/i915: Set all unused color plane offsets to ~0xfff again
When the number of potential color planes grew to 4 we stopped setting all unused color plane offsets to ~0xfff. The code still tries to do this, but actually does nothing since the loop limits are bogus. skl_check_main_surface() actually depends on this ~0xfff behaviour as it will make sure to move the main surface offset below the aux surface offset because the hardware AUX_DIST must be a non-negative value [1], and for simplicity it doesn't bother checking if the AUX plane is actually needed or not. So currently it may end up shuffling the main surface around based on some stale leftover AUX offset. The skl+ plane code also just blindly calculates the AUX_DIST whether or not the AUX plane is actually needed by the hw or not, and that too will now potentially use some stale AUX surface offset in the calculation. Would seem nicer to guarantee a consistent non-negative AUX_DIST always. So bring back the original ~0xfff offset behaviour for unused color planes. Though it doesn't seem super likely that this inconsistency would cause any real issues. Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Imre Deak <imre.deak@intel.com> Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com> Fixes: 2dfbf9d ("drm/i915/tgl: Gen-12 display can decompress surfaces compressed by the media engine") Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201008101608.8652-1-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak <imre.deak@intel.com> (cherry picked from commit 79148ce) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent f0b707c commit 214bba5

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

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

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4093,8 +4093,7 @@ static int skl_check_ccs_aux_surface(struct intel_plane_state *plane_state)
40934093
int skl_check_plane_surface(struct intel_plane_state *plane_state)
40944094
{
40954095
const struct drm_framebuffer *fb = plane_state->hw.fb;
4096-
int ret;
4097-
bool needs_aux = false;
4096+
int ret, i;
40984097

40994098
ret = intel_plane_compute_gtt(plane_state);
41004099
if (ret)
@@ -4108,28 +4107,22 @@ int skl_check_plane_surface(struct intel_plane_state *plane_state)
41084107
* it.
41094108
*/
41104109
if (is_ccs_modifier(fb->modifier)) {
4111-
needs_aux = true;
41124110
ret = skl_check_ccs_aux_surface(plane_state);
41134111
if (ret)
41144112
return ret;
41154113
}
41164114

41174115
if (intel_format_info_is_yuv_semiplanar(fb->format,
41184116
fb->modifier)) {
4119-
needs_aux = true;
41204117
ret = skl_check_nv12_aux_surface(plane_state);
41214118
if (ret)
41224119
return ret;
41234120
}
41244121

4125-
if (!needs_aux) {
4126-
int i;
4127-
4128-
for (i = 1; i < fb->format->num_planes; i++) {
4129-
plane_state->color_plane[i].offset = ~0xfff;
4130-
plane_state->color_plane[i].x = 0;
4131-
plane_state->color_plane[i].y = 0;
4132-
}
4122+
for (i = fb->format->num_planes; i < ARRAY_SIZE(plane_state->color_plane); i++) {
4123+
plane_state->color_plane[i].offset = ~0xfff;
4124+
plane_state->color_plane[i].x = 0;
4125+
plane_state->color_plane[i].y = 0;
41334126
}
41344127

41354128
ret = skl_check_main_surface(plane_state);

0 commit comments

Comments
 (0)