Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
	intel-gvt-dev@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Subject: Re: [PATCH 5/5] drm/i915/gvt/display_helpers: Cast argument to enum pipe for pipe-offset macro
Date: Mon, 15 Dec 2025 14:03:08 +0200	[thread overview]
Message-ID: <9498ecce59866b5fac5410fa9d75c6d7d5a0e11e@intel.com> (raw)
In-Reply-To: <20251215111842.2099789-6-ankit.k.nautiyal@intel.com>

On Mon, 15 Dec 2025, Ankit Nautiyal <ankit.k.nautiyal@intel.com> wrote:
> TRANSCONF() expands via _MMIO_PIPE2, i.e., it uses pipe-based addressing.
> In GVT, some call sites pass an enum transcoder to TRANSCONF(), which now
> routes through INTEL_DISPLAY_DEVICE_PIPE_OFFSET() and ultimately calls
> intel_display_device_pipe_offset(), whose parameter type is enum pipe.
>
> This results in -Werror=enum-conversion.
>
> To address this, cast the index to enum pipe in the GVT-side macro
> override.
>
> This works for all cases as TRANSCODER_{A,B,C,D} all have 1:1 mapping to
> PIPE_{A,B,C,D} except for TRANSCODER_EDP.
>
> There is one place which uses TRANSCONF() with TRANSCODER_EDP, which
> appears to be incorrect. In any case, the cast preserves the previous
> behaviour.

Maybe the question to ask is if TRANSCONF() using _MMIO_PIPE2() is
correct or not?

BR,
Jani.

>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  drivers/gpu/drm/i915/gvt/display_helpers.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/display_helpers.h b/drivers/gpu/drm/i915/gvt/display_helpers.h
> index d11ebb03b946..fb75cc9f97cc 100644
> --- a/drivers/gpu/drm/i915/gvt/display_helpers.h
> +++ b/drivers/gpu/drm/i915/gvt/display_helpers.h
> @@ -21,8 +21,8 @@ struct display;
>  #ifdef INTEL_DISPLAY_DEVICE_PIPE_OFFSET
>  #undef INTEL_DISPLAY_DEVICE_PIPE_OFFSET
>  #endif
> -#define INTEL_DISPLAY_DEVICE_PIPE_OFFSET(display, pipe) \
> -	intel_display_device_pipe_offset((display), (pipe))
> +#define INTEL_DISPLAY_DEVICE_PIPE_OFFSET(display, idx) \
> +	intel_display_device_pipe_offset((display), (enum pipe)(idx))
>  
>  #ifdef INTEL_DISPLAY_DEVICE_TRANS_OFFSET
>  #undef INTEL_DISPLAY_DEVICE_TRANS_OFFSET

-- 
Jani Nikula, Intel

  reply	other threads:[~2025-12-15 12:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-15 11:18 [PATCH 0/5] Prepare GVT for display modularization Ankit Nautiyal
2025-12-15 11:18 ` [PATCH 1/5] drm/i915/display: Abstract pipe/trans/cursor offset calculation Ankit Nautiyal
2025-12-15 11:44   ` Jani Nikula
2025-12-16  9:29     ` Nautiyal, Ankit K
2025-12-15 11:18 ` [PATCH 2/5] drm/i915/display: Add APIs to be used by gvt to get the register offsets Ankit Nautiyal
2025-12-15 11:51   ` Jani Nikula
2025-12-15 11:18 ` [PATCH 3/5] drm/i915/gvt: Add header to use display offset functions in macros Ankit Nautiyal
2025-12-15 11:53   ` Jani Nikula
2025-12-16  9:30     ` Nautiyal, Ankit K
2025-12-15 11:18 ` [PATCH 4/5] drm/i915/gvt: Change for_each_pipe to use pipe_mask API Ankit Nautiyal
2025-12-15 12:00   ` Jani Nikula
2025-12-16  9:31     ` Nautiyal, Ankit K
2025-12-15 11:18 ` [PATCH 5/5] drm/i915/gvt/display_helpers: Cast argument to enum pipe for pipe-offset macro Ankit Nautiyal
2025-12-15 12:03   ` Jani Nikula [this message]
2025-12-16  9:27     ` Nautiyal, Ankit K
2025-12-15 11:38 ` ✗ CI.checkpatch: warning for Prepare GVT for display modularization Patchwork
2025-12-15 11:39 ` ✓ CI.KUnit: success " Patchwork
2025-12-15 11:54 ` ✗ CI.checksparse: warning " Patchwork
2025-12-15 12:42 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-12-15 14:44 ` ✗ Xe.CI.Full: " 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=9498ecce59866b5fac5410fa9d75c6d7d5a0e11e@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    /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