]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/i915/bios: range check LFP Data Block panel_type2
authorJani Nikula <jani.nikula@intel.com>
Fri, 26 Jun 2026 14:01:55 +0000 (17:01 +0300)
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Wed, 1 Jul 2026 06:12:33 +0000 (09:12 +0300)
commit2084503f2d087bf956198e7f6eb25b03a7049cb2
treeea0c4e665925575bbfe5c1af3e7975be63899c0b
parentf8a9262c7a6fc2de9802e14b0228114f0333869e
drm/i915/bios: range check LFP Data Block panel_type2

While the panel_type from LFP Data Block is range checked, panel_type2
is not. Add a few helpers for range checking, and use them to not only
check panel_type2, but also improve clarity and correctness in the panel
type selection.

Discovered using AI-assisted static analysis confirmed by Intel Product
Security.

v2:
- Fix commit message typo (Michał)
- Add is_panel_type_pnp() (Ville)

Reported-by: Martin Hodo <martin.hodo@intel.com>
Fixes: 6434cf630086 ("drm/i915/bios: calculate panel type as per child device index in VBT")
Cc: stable@vger.kernel.org # v6.0+
Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Ville Syrjälä <ville.syrjala@intel.com>
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com> # v1
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20260626140155.1389655-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
(cherry picked from commit c9ebe5d2f25729d6cfbbb1235d640bf67f9275df)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
drivers/gpu/drm/i915/display/intel_bios.c