Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 2/5] drm/i915/overlay: add intel_overlay_available() and use it
Date: Thu, 14 Nov 2024 12:51:20 -0500	[thread overview]
Message-ID: <ZzY4mNXGWwVA3nCt@intel.com> (raw)
In-Reply-To: <5c45e2b4f2daec2e826feddf247aeb3252e3a0db.1731347547.git.jani.nikula@intel.com>

On Mon, Nov 11, 2024 at 07:53:31PM +0200, Jani Nikula wrote:
> Avoid accessing struct intel_display members directly from
> i915_getparam_ioctl(). Add intel_overlay_available() function to provide
> the information for I915_PARAM_HAS_OVERLAY.
> 

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_overlay.c | 5 +++++
>  drivers/gpu/drm/i915/display/intel_overlay.h | 5 +++++
>  drivers/gpu/drm/i915/i915_getparam.c         | 5 +++--
>  3 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c
> index 57eaf81651c4..ca30fff61876 100644
> --- a/drivers/gpu/drm/i915/display/intel_overlay.c
> +++ b/drivers/gpu/drm/i915/display/intel_overlay.c
> @@ -1438,6 +1438,11 @@ void intel_overlay_setup(struct intel_display *display)
>  	kfree(overlay);
>  }
>  
> +bool intel_overlay_available(struct intel_display *display)
> +{
> +	return display->overlay;
> +}
> +
>  void intel_overlay_cleanup(struct intel_display *display)
>  {
>  	struct intel_overlay *overlay;
> diff --git a/drivers/gpu/drm/i915/display/intel_overlay.h b/drivers/gpu/drm/i915/display/intel_overlay.h
> index dc885edf39e6..45a42fce754e 100644
> --- a/drivers/gpu/drm/i915/display/intel_overlay.h
> +++ b/drivers/gpu/drm/i915/display/intel_overlay.h
> @@ -18,6 +18,7 @@ struct intel_overlay_snapshot;
>  
>  #ifdef I915
>  void intel_overlay_setup(struct intel_display *display);
> +bool intel_overlay_available(struct intel_display *display);
>  void intel_overlay_cleanup(struct intel_display *display);
>  int intel_overlay_switch_off(struct intel_overlay *overlay);
>  int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
> @@ -29,6 +30,10 @@ void intel_overlay_reset(struct intel_display *display);
>  static inline void intel_overlay_setup(struct intel_display *display)
>  {
>  }
> +static inline bool intel_overlay_available(struct intel_display *display)
> +{
> +	return false;
> +}
>  static inline void intel_overlay_cleanup(struct intel_display *display)
>  {
>  }
> diff --git a/drivers/gpu/drm/i915/i915_getparam.c b/drivers/gpu/drm/i915/i915_getparam.c
> index a62405787e77..be8149e46281 100644
> --- a/drivers/gpu/drm/i915/i915_getparam.c
> +++ b/drivers/gpu/drm/i915/i915_getparam.c
> @@ -2,9 +2,9 @@
>   * SPDX-License-Identifier: MIT
>   */
>  
> +#include "display/intel_overlay.h"
>  #include "gem/i915_gem_mman.h"
>  #include "gt/intel_engine_user.h"
> -
>  #include "pxp/intel_pxp.h"
>  
>  #include "i915_cmd_parser.h"
> @@ -16,6 +16,7 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,
>  			struct drm_file *file_priv)
>  {
>  	struct drm_i915_private *i915 = to_i915(dev);
> +	struct intel_display *display = &i915->display;
>  	struct pci_dev *pdev = to_pci_dev(dev->dev);
>  	const struct sseu_dev_info *sseu = &to_gt(i915)->info.sseu;
>  	drm_i915_getparam_t *param = data;
> @@ -38,7 +39,7 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,
>  		value = to_gt(i915)->ggtt->num_fences;
>  		break;
>  	case I915_PARAM_HAS_OVERLAY:
> -		value = !!i915->display.overlay;
> +		value = intel_overlay_available(display);
>  		break;
>  	case I915_PARAM_HAS_BSD:
>  		value = !!intel_engine_lookup_user(i915,
> -- 
> 2.39.5
> 

  reply	other threads:[~2024-11-14 17:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-11 17:53 [PATCH 0/5] drm/i915: intel_display conversions, cleanups Jani Nikula
2024-11-11 17:53 ` [PATCH 1/5] drm/i915/overlay: convert to struct intel_display Jani Nikula
2024-11-12 20:40   ` Rodrigo Vivi
2024-11-13  8:26     ` Jani Nikula
2024-11-11 17:53 ` [PATCH 2/5] drm/i915/overlay: add intel_overlay_available() and use it Jani Nikula
2024-11-14 17:51   ` Rodrigo Vivi [this message]
2024-11-11 17:53 ` [PATCH 3/5] drm/i915/plane: convert initial plane setup to struct intel_display Jani Nikula
2024-11-14 17:52   ` Rodrigo Vivi
2024-11-11 17:53 ` [PATCH 4/5] drm/i915/irq: hide display_irqs_enabled access Jani Nikula
2024-11-14 17:55   ` Rodrigo Vivi
2024-11-15 13:13     ` Jani Nikula
2024-11-15 19:10       ` Rodrigo Vivi
2024-11-11 17:53 ` [PATCH 5/5] drm/i915/irq: emphasize display_irqs_enabled is only about VLV/CHV Jani Nikula
2024-11-14 17:57   ` Rodrigo Vivi
2024-11-15 13:15     ` Jani Nikula
2024-11-15 19:11       ` Rodrigo Vivi
2024-11-11 18:02 ` ✓ CI.Patch_applied: success for drm/i915: intel_display conversions, cleanups Patchwork
2024-11-11 18:02 ` ✗ CI.checkpatch: warning " Patchwork
2024-11-11 18:04 ` ✓ CI.KUnit: success " Patchwork
2024-11-11 18:15 ` ✓ CI.Build: " Patchwork
2024-11-11 18:17 ` ✓ CI.Hooks: " Patchwork
2024-11-11 18:19 ` ✗ CI.checksparse: warning " Patchwork
2024-11-11 19:01 ` ✓ CI.BAT: success " Patchwork
2024-11-11 20:17 ` ✗ 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=ZzY4mNXGWwVA3nCt@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@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