drm/i915: Tweak BIOS fb reuse check
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 2 Feb 2024 22:43:38 +0000 (00:43 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 7 Feb 2024 00:01:44 +0000 (02:01 +0200)
commitea5e150ac2cf88f586299c06244d5a4d473c041e
treed05e08b838b52b7621919f28998f8e687ce6d940
parentf1ee98cff3d86271491b08315fcdfa4c3f097e1e
drm/i915: Tweak BIOS fb reuse check

Currently we assume that we bind the BIOS fb exactly into the same
ggtt address where the BIOS left it. That is about to change, and
in order to keep intel_reuse_initial_plane_obj() working as intended
we need to compare the original ggtt offset (called 'base' here)
as opposed to the actual vma ggtt offset we selected. Otherwise
the first plane could change the ggtt offset, and then subsequent
planes would no longer notice that they are in fact using the same
ggtt offset that the first plane was already using. Thus the reuse
check will fail and we proceed to turn off these subsequent planes.

TODO: would probably make more sense to do the pure readout first
for all the planes, then check for fb reuse, and only then proceed
to pin the object into the final location in the ggtt...

v2: "fix" xe

Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Tested-by: Paz Zcharya <pazz@chromium.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240202224340.30647-15-ville.syrjala@linux.intel.com
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/i915/display/intel_plane_initial.c
drivers/gpu/drm/xe/display/xe_plane_initial.c