From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Jouni Högander" <jouni.hogander@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v6 3/4] drm/i915/display: Handle invalid fb_modifier in intel_fb_modifier_to_tiling
Date: Tue, 28 Nov 2023 15:31:20 +0200 [thread overview]
Message-ID: <ZWXrqMxQtFC7uXyp@intel.com> (raw)
In-Reply-To: <20231123074120.1641630-4-jouni.hogander@intel.com>
On Thu, Nov 23, 2023 at 09:41:19AM +0200, Jouni Högander wrote:
> 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: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_fb.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
> index a235ec0f192d..f63f56b24b11 100644
> --- a/drivers/gpu/drm/i915/display/intel_fb.c
> +++ b/drivers/gpu/drm/i915/display/intel_fb.c
> @@ -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) {
> --
> 2.34.1
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2023-11-28 13:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-23 7:41 [Intel-gfx] [PATCH v6 0/4] Prepare intel_fb for Xe Jouni Högander
2023-11-23 7:41 ` [Intel-gfx] [PATCH v6 1/4] drm/i915/display: use intel_bo_to_drm_bo in intel_fb.c Jouni Högander
2023-11-28 13:30 ` Ville Syrjälä
2023-11-23 7:41 ` [Intel-gfx] [PATCH v6 2/4] drm/i915/display: Convert intel_fb_modifier_to_tiling as non-static Jouni Högander
2023-11-23 7:41 ` [Intel-gfx] [PATCH v6 3/4] drm/i915/display: Handle invalid fb_modifier in intel_fb_modifier_to_tiling Jouni Högander
2023-11-28 13:31 ` Ville Syrjälä [this message]
2023-11-23 7:41 ` [Intel-gfx] [PATCH v6 4/4] drm/i915/display: Split i915 specific code away from intel_fb.c Jouni Högander
2023-11-28 13:29 ` Ville Syrjälä
2023-11-28 15:48 ` Hogander, Jouni
2023-11-23 19:13 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Prepare intel_fb for Xe (rev7) Patchwork
2023-11-23 19:13 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-11-23 19:26 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-11-25 10:46 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZWXrqMxQtFC7uXyp@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jouni.hogander@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox