All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
To: Jani Nikula <jani.nikula@intel.com>, <intel-gfx@lists.freedesktop.org>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915: fix device info for devices without display
Date: Fri, 16 Sep 2022 14:51:44 +0300	[thread overview]
Message-ID: <75bafe7b-1e96-3733-138b-b55303a67cb0@intel.com> (raw)
In-Reply-To: <20220916082642.3451961-1-jani.nikula@intel.com>

Looks good to me

Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>

On 9/16/22 11:26 AM, Jani Nikula wrote:
> Commit 00c6cbfd4e8a ("drm/i915: move pipe_mask and cpu_transcoder_mask
> to runtime info") moved the pipe_mask member from struct
> intel_device_info to intel_runtime_info, but overlooked some of our
> platforms initializing device info .display = {}. This is significant,
> as pipe_mask is the single point of truth for a device having a display
> or not; the platforms in question left pipe_mask to whatever was set for
> the platforms they "inherit" from in the complex macro scheme we have.
> 
> Add new NO_DISPLAY macro initializing .__runtime.pipe_mask = 0, which
> will cause the device info .display sub-struct to be zeroed in
> intel_device_info_runtime_init(). A better solution (or simply audit of
> proper use of HAS_DISPLAY() checks) is required before moving forward
> with [1].
> 
> Also clear all the display related members in runtime info if there's no
> display. The latter is a bit tedious, but it's for completeness at this
> time, to ensure similar functionality as before.
> 
> [1] https://lore.kernel.org/r/dfda1bf67f02ceb07c280b7a13216405fd1f7a34.1660137416.git.jani.nikula@intel.com
> 
> Fixes: 00c6cbfd4e8a ("drm/i915: move pipe_mask and cpu_transcoder_mask to runtime info")
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Maarten Lankhort <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_pci.c          | 11 ++++++-----
>   drivers/gpu/drm/i915/intel_device_info.c |  6 ++++++
>   2 files changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 77e7df21f539..cd4487a1d3be 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -41,6 +41,8 @@
>   	.__runtime.media.ip.ver = (x), \
>   	.__runtime.display.ip.ver = (x)
>   
> +#define NO_DISPLAY .__runtime.pipe_mask = 0
> +
>   #define I845_PIPE_OFFSETS \
>   	.display.pipe_offsets = { \
>   		[TRANSCODER_A] = PIPE_A_OFFSET,	\
> @@ -519,9 +521,8 @@ static const struct intel_device_info ivb_m_gt2_info = {
>   static const struct intel_device_info ivb_q_info = {
>   	GEN7_FEATURES,
>   	PLATFORM(INTEL_IVYBRIDGE),
> +	NO_DISPLAY,
>   	.gt = 2,
> -	.__runtime.pipe_mask = 0, /* legal, last one wins */
> -	.__runtime.cpu_transcoder_mask = 0,
>   	.has_l3_dpf = 1,
>   };
>   
> @@ -1039,7 +1040,7 @@ static const struct intel_device_info xehpsdv_info = {
>   	XE_HPM_FEATURES,
>   	DGFX_FEATURES,
>   	PLATFORM(INTEL_XEHPSDV),
> -	.display = { },
> +	NO_DISPLAY,
>   	.has_64k_pages = 1,
>   	.needs_compact_pt = 1,
>   	.has_media_ratio_mode = 1,
> @@ -1081,7 +1082,7 @@ static const struct intel_device_info dg2_info = {
>   
>   static const struct intel_device_info ats_m_info = {
>   	DG2_FEATURES,
> -	.display = { 0 },
> +	NO_DISPLAY,
>   	.require_force_probe = 1,
>   	.tuning_thread_rr_after_dep = 1,
>   };
> @@ -1103,7 +1104,7 @@ static const struct intel_device_info pvc_info = {
>   	.__runtime.graphics.ip.rel = 60,
>   	.__runtime.media.ip.rel = 60,
>   	PLATFORM(INTEL_PONTEVECCHIO),
> -	.display = { 0 },
> +	NO_DISPLAY,
>   	.has_flat_ccs = 0,
>   	.__runtime.platform_engine_mask =
>   		BIT(BCS0) |
> diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
> index 1434dc33cf49..20575eb77ea7 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.c
> +++ b/drivers/gpu/drm/i915/intel_device_info.c
> @@ -433,8 +433,14 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
>   		dev_priv->drm.driver_features &= ~(DRIVER_MODESET |
>   						   DRIVER_ATOMIC);
>   		memset(&info->display, 0, sizeof(info->display));
> +
> +		runtime->cpu_transcoder_mask = 0;
>   		memset(runtime->num_sprites, 0, sizeof(runtime->num_sprites));
>   		memset(runtime->num_scalers, 0, sizeof(runtime->num_scalers));
> +		runtime->fbc_mask = 0;
> +		runtime->has_hdcp = false;
> +		runtime->has_dmc = false;
> +		runtime->has_dsc = false;
>   	}
>   }
>   

  parent reply	other threads:[~2022-09-16 11:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16  8:26 [Intel-gfx] [PATCH] drm/i915: fix device info for devices without display Jani Nikula
2022-09-16  9:21 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2022-09-16  9:41 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-09-16 11:51 ` Gwan-gyeong Mun [this message]
2022-09-16 13:44 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-09-16 15:26 ` [Intel-gfx] [PATCH] " Lucas De Marchi
2022-09-19  8:10   ` Jani Nikula
2022-09-20  7:24     ` Lucas De Marchi
2022-09-26 10:11       ` Jani Nikula
2022-09-26 14:58         ` Lucas De Marchi
2022-09-26 16:32           ` Jani Nikula

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=75bafe7b-1e96-3733-138b-b55303a67cb0@intel.com \
    --to=gwan-gyeong.mun@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=lucas.demarchi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.