]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915: Reject BIOS FB rotation in common code
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 10 Apr 2026 15:04:49 +0000 (18:04 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 15 Apr 2026 09:38:45 +0000 (12:38 +0300)
Reject 90/270 degree rotated BIOS framebuffers in common
code. Currently skl_get_initial_plane_config() already rejects
these, but we may want to implement the missing parts there
so that skl_get_initial_plane_config() could be reused for
general plane state verification purposes.

90/270 degree rotated framebuffers require two completely
separate GGTT mappings (0 degree for the CPU, 270 degree
for the display engine), and the rest of the BIOS FB
takeover code is not prepared for that.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20260410150449.9699-11-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_initial_plane.c

index e3d1b2d1669c8c8869c1aaf9e994ed5798096e97..0e5cd45f01cc40d70343bd254711cb42d0e7d012 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <linux/iopoll.h>
 
+#include <drm/drm_blend.h>
 #include <drm/drm_print.h>
 #include <drm/intel/display_parent_interface.h>
 
@@ -101,6 +102,15 @@ intel_alloc_initial_plane_obj(struct intel_display *display,
                return NULL;
        }
 
+       /*
+        * Would need to preserve the 270 degree rotated
+        * GGTT mapping used by the display hardware.
+        */
+       if (drm_rotation_90_or_270(plane_config->rotation)) {
+               drm_dbg_kms(display->drm, "90/270 degree rotation not supported for initial FB\n");
+               return NULL;
+       }
+
        return display->parent->initial_plane->alloc_obj(display->drm, plane_config);
 }