Commit ae424921 authored by Jouni Högander's avatar Jouni Högander

drm/i915/display: Handle invalid fb_modifier in intel_fb_modifier_to_tiling

Lookup_modifier is returning INTEL_PLANE_CAP_TILING_4 on invalid
fb_modifier value. Use lookup_modifier_or_null in
intel_fb_modifier_to_tiling and return I915_TILING_NONE in case
lookup_modifier_or_null returns null.
Signed-off-by: default avatarJouni Högander <jouni.hogander@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231203114840.841311-4-jouni.hogander@intel.com
parent 6383f69b
......@@ -303,7 +303,14 @@ lookup_format_info(const struct drm_format_info formats[],
unsigned int intel_fb_modifier_to_tiling(u64 fb_modifier)
{
u8 tiling_caps = lookup_modifier(fb_modifier)->plane_caps &
const struct intel_modifier_desc *md;
u8 tiling_caps;
md = lookup_modifier_or_null(fb_modifier);
if (!md)
return I915_TILING_NONE;
tiling_caps = lookup_modifier_or_null(fb_modifier)->plane_caps &
INTEL_PLANE_CAP_TILING_MASK;
switch (tiling_caps) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment