Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
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 3/5] drm/i915/gvt: Add header to use display offset functions in macros
Date: Tue, 16 Dec 2025 15:00:08 +0530	[thread overview]
Message-ID: <a40bc25e-2b04-4736-bbf5-018be1f0ea18@intel.com> (raw)
In-Reply-To: <fa0657de720e63a4f966fd07e86d998f2f94e5f2@intel.com>


On 12/15/2025 5:23 PM, Jani Nikula wrote:
> On Mon, 15 Dec 2025, Ankit Nautiyal <ankit.k.nautiyal@intel.com> wrote:
>> Introduce gvt/display_helpers.h to make DISPLAY_MMIO_BASE and
>> INTEL_DISPLAY_DEVICE_*_OFFSET macros call exported display functions.
>> This lets GVT keep using existing register macros (e.g.,
>> TRANSCONF(display, pipe)) while ensuring offset calculations happen
>> through functions instead of accessing display internals.
>>
>> Include gvt/display_helpers.h after display headers to avoid
>> conflicts.
>>
>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> ---
>>   drivers/gpu/drm/i915/gvt/cmd_parser.c      |  2 ++
>>   drivers/gpu/drm/i915/gvt/display.c         |  2 ++
>>   drivers/gpu/drm/i915/gvt/display_helpers.h | 39 ++++++++++++++++++++++
>>   drivers/gpu/drm/i915/gvt/fb_decoder.c      |  2 ++
>>   drivers/gpu/drm/i915/gvt/handlers.c        |  2 ++
>>   5 files changed, 47 insertions(+)
>>   create mode 100644 drivers/gpu/drm/i915/gvt/display_helpers.h
>>
>> diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
>> index df04e4ead8ea..6b5e18fca403 100644
>> --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
>> +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
>> @@ -59,6 +59,8 @@
>>   #include "gem/i915_gem_pm.h"
>>   #include "gt/intel_context.h"
>>   
>> +#include "gvt/display_helpers.h"
> None of these includes need the gvt/ prefix as they're in the same
> subdirectory.
Alright, will drop the gvt/ prefix.
>
>> +
>>   #define INVALID_OP    (~0U)
>>   
>>   #define OP_LEN_MI           9
>> diff --git a/drivers/gpu/drm/i915/gvt/display.c b/drivers/gpu/drm/i915/gvt/display.c
>> index 06517d1f07a2..7a51c13b9b58 100644
>> --- a/drivers/gpu/drm/i915/gvt/display.c
>> +++ b/drivers/gpu/drm/i915/gvt/display.c
>> @@ -49,6 +49,8 @@
>>   #include "display/intel_dpio_phy.h"
>>   #include "display/intel_sprite_regs.h"
>>   
>> +#include "gvt/display_helpers.h"
>> +
>>   static int get_edp_pipe(struct intel_vgpu *vgpu)
>>   {
>>   	u32 data = vgpu_vreg(vgpu, _TRANS_DDI_FUNC_CTL_EDP);
>> diff --git a/drivers/gpu/drm/i915/gvt/display_helpers.h b/drivers/gpu/drm/i915/gvt/display_helpers.h
>> new file mode 100644
>> index 000000000000..6f68a1e8751a
>> --- /dev/null
>> +++ b/drivers/gpu/drm/i915/gvt/display_helpers.h
>> @@ -0,0 +1,39 @@
>> +// SPDX-License-Identifier: MIT
>> +/*
>> + * Copyright © 2025 Intel Corporation
>> + */
>> +
>> +#ifndef __DISPLAY_HELPERS_H__
>> +#define __DISPLAY_HELPERS_H__
>> +
>> +#include "display/intel_gvt_api.h"
>> +
>> +enum pipe;
>> +enum trans;
>> +struct display;
>> +
>> +#ifdef DISPLAY_MMIO_BASE
> Ideally, we shouldn't need these ifdefs. I think it's better if we can
> drop any includes from gvt that would cause a conflict here, and it's
> better to get the build failure.
>
> If we can't do that in this patch already, then please drop the relevant
> includes and these ifdefs at the end of the series.

Ok, let me re-check this part.


Regards,

Ankit

>
> BR,
> Jani.
>
>> +#undef DISPLAY_MMIO_BASE
>> +#endif
>> +#define DISPLAY_MMIO_BASE(display) \
>> +	intel_display_device_mmio_base((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))
>> +
>> +#ifdef INTEL_DISPLAY_DEVICE_TRANS_OFFSET
>> +#undef INTEL_DISPLAY_DEVICE_TRANS_OFFSET
>> +#endif
>> +#define INTEL_DISPLAY_DEVICE_TRANS_OFFSET(display, trans) \
>> +	intel_display_device_trans_offset((display), (trans))
>> +
>> +#ifdef INTEL_DISPLAY_DEVICE_CURSOR_OFFSET
>> +#undef INTEL_DISPLAY_DEVICE_CURSOR_OFFSET
>> +#endif
>> +#define INTEL_DISPLAY_DEVICE_CURSOR_OFFSET(display, pipe) \
>> +	intel_display_device_cursor_offset((display), (pipe))
>> +
>> +#endif /* __DISPLAY_HELPERS_H__ */
>> diff --git a/drivers/gpu/drm/i915/gvt/fb_decoder.c b/drivers/gpu/drm/i915/gvt/fb_decoder.c
>> index a8079cfa8e1d..ee4213fa2cda 100644
>> --- a/drivers/gpu/drm/i915/gvt/fb_decoder.c
>> +++ b/drivers/gpu/drm/i915/gvt/fb_decoder.c
>> @@ -47,6 +47,8 @@
>>   #include "display/intel_sprite_regs.h"
>>   #include "display/skl_universal_plane_regs.h"
>>   
>> +#include "gvt/display_helpers.h"
>> +
>>   #define PRIMARY_FORMAT_NUM	16
>>   struct pixel_format {
>>   	int drm_format;	/* Pixel format in DRM definition */
>> diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c
>> index 36ea12ade849..3e58e35ea2b9 100644
>> --- a/drivers/gpu/drm/i915/gvt/handlers.c
>> +++ b/drivers/gpu/drm/i915/gvt/handlers.c
>> @@ -67,6 +67,8 @@
>>   #include "gt/intel_gt_regs.h"
>>   #include <linux/vmalloc.h>
>>   
>> +#include "gvt/display_helpers.h"
>> +
>>   /* XXX FIXME i915 has changed PP_XXX definition */
>>   #define PCH_PP_STATUS  _MMIO(0xc7200)
>>   #define PCH_PP_CONTROL _MMIO(0xc7204)

  reply	other threads:[~2025-12-16  9:30 UTC|newest]

Thread overview: 17+ 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 [this message]
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
2025-12-16  9:27     ` Nautiyal, Ankit K
2025-12-15 15:44 ` ✓ i915.CI.BAT: success for Prepare GVT for display modularization Patchwork
2025-12-15 20:49 ` ✗ i915.CI.Full: 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=a40bc25e-2b04-4736-bbf5-018be1f0ea18@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