From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
<intel-gvt-dev@lists.freedesktop.org>,
<intel-gfx@lists.freedesktop.org>,
<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 4/5] drm/i915/gvt: Change for_each_pipe to use pipe_mask API
Date: Tue, 16 Dec 2025 15:01:27 +0530 [thread overview]
Message-ID: <508d8eb8-1de9-47bd-9f54-c7a18eca8713@intel.com> (raw)
In-Reply-To: <2785d3cddb6199bc7e6cef3374dbff46d4cae205@intel.com>
On 12/15/2025 5:30 PM, Jani Nikula wrote:
> On Mon, 15 Dec 2025, Ankit Nautiyal <ankit.k.nautiyal@intel.com> wrote:
>> Add a new API to get pipe_mask from DISPLAY_RUNTIME_INFO() for GVT.
>> Update the for_each_pipe() macro in GVT to call this API, instead of
>> accessing DISPLAY_RUNTIME_INFO()->pipe_mask directly.
>>
>> This keeps the macro usable in GVT without exposing display internals
>> and prepares for display modularization.
>>
>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> ---
>> drivers/gpu/drm/i915/display/intel_gvt_api.c | 6 ++++++
>> drivers/gpu/drm/i915/display/intel_gvt_api.h | 1 +
>> drivers/gpu/drm/i915/gvt/display_helpers.h | 7 +++++++
>> 3 files changed, 14 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_gvt_api.c b/drivers/gpu/drm/i915/display/intel_gvt_api.c
>> index 8abea318fbc2..0b09bbf2c29a 100644
>> --- a/drivers/gpu/drm/i915/display/intel_gvt_api.c
>> +++ b/drivers/gpu/drm/i915/display/intel_gvt_api.c
>> @@ -32,3 +32,9 @@ u32 intel_display_device_mmio_base(struct intel_display *display)
>> return DISPLAY_MMIO_BASE(display);
>> }
>> EXPORT_SYMBOL_GPL(intel_display_device_mmio_base);
>> +
>> +u8 intel_display_runtime_info_pipe_mask(struct intel_display *display)
>> +{
>> + return DISPLAY_RUNTIME_INFO(display)->pipe_mask;
>> +}
> I don't think gvt needs to know it's about "runtime info". Maybe make it
> just intel_display_device_pipe_mask()?
Makes sense.
>
> Though I'm also wondering about making it even more abstracted with
> something like intel_display_device_pipe_valid(), and using that for the
> various other cases that check pipes in GVT. But maybe the patch at hand
> is a good start.
I agree this can be further abstracted. I can try that stuff and see how
much change it might require.
Thanks Jani, for the suggestions and for the reviews.
Regards,
Ankit
>
>> +EXPORT_SYMBOL_GPL(intel_display_runtime_info_pipe_mask);
>> diff --git a/drivers/gpu/drm/i915/display/intel_gvt_api.h b/drivers/gpu/drm/i915/display/intel_gvt_api.h
>> index e9a1122a988d..8ceda30a969b 100644
>> --- a/drivers/gpu/drm/i915/display/intel_gvt_api.h
>> +++ b/drivers/gpu/drm/i915/display/intel_gvt_api.h
>> @@ -16,5 +16,6 @@ u32 intel_display_device_pipe_offset(struct intel_display *display, enum pipe pi
>> u32 intel_display_device_trans_offset(struct intel_display *display, enum transcoder trans);
>> u32 intel_display_device_cursor_offset(struct intel_display *display, enum pipe pipe);
>> u32 intel_display_device_mmio_base(struct intel_display *display);
>> +u8 intel_display_runtime_info_pipe_mask(struct intel_display *display);
>>
>> #endif /* __INTEL_GVT_API_H__ */
>> diff --git a/drivers/gpu/drm/i915/gvt/display_helpers.h b/drivers/gpu/drm/i915/gvt/display_helpers.h
>> index 6f68a1e8751a..d11ebb03b946 100644
>> --- a/drivers/gpu/drm/i915/gvt/display_helpers.h
>> +++ b/drivers/gpu/drm/i915/gvt/display_helpers.h
>> @@ -36,4 +36,11 @@ struct display;
>> #define INTEL_DISPLAY_DEVICE_CURSOR_OFFSET(display, pipe) \
>> intel_display_device_cursor_offset((display), (pipe))
>>
>> +#ifdef for_each_pipe
> Ditto about ifdefs here as with previous patch.
>
>> +#undef for_each_pipe
>> +#endif
>> +#define for_each_pipe(display, __p) \
>> + for ((__p) = 0; (__p) < I915_MAX_PIPES; (__p)++) \
>> + for_each_if(intel_display_runtime_info_pipe_mask((display)) & BIT(__p))
>> +
>> #endif /* __DISPLAY_HELPERS_H__ */
next prev parent reply other threads:[~2025-12-16 9:32 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 [this message]
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
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=508d8eb8-1de9-47bd-9f54-c7a18eca8713@intel.com \
--to=ankit.k.nautiyal@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.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