intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 15/15] drm/i915/display: add mobile platform group
Date: Thu, 07 Nov 2024 12:32:56 +0200	[thread overview]
Message-ID: <87o72re3l3.fsf@intel.com> (raw)
In-Reply-To: <Zyub_ECW7cCu5HPc@intel.com>

On Wed, 06 Nov 2024, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> On Mon, Nov 04, 2024 at 07:19:29PM +0200, Jani Nikula wrote:
>> Identify mobile platforms separately in display, using the platform
>> group mechanism. This enables dropping the dependency on i915_drv.h
>> IS_MOBILE() from display code.
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  .../drm/i915/display/intel_display_device.c   | 104 ++++++++++++------
>>  .../drm/i915/display/intel_display_device.h   |   1 +
>>  2 files changed, 70 insertions(+), 35 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c
>> index 8ba1b4652ca9..5689c5e5db0e 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display_device.c
>> +++ b/drivers/gpu/drm/i915/display/intel_display_device.c
>> @@ -253,6 +253,7 @@ static const struct intel_display_device_info no_display = {};
>>  
>>  static const struct platform_desc i830_desc = {
>>  	PLATFORM(i830),
>> +	PLATFORM_GROUP(mobile),
>>  	.info = &(const struct intel_display_device_info) {
>>  		I830_DISPLAY,
>>  
>> @@ -271,6 +272,7 @@ static const struct platform_desc i845_desc = {
>>  
>>  static const struct platform_desc i85x_desc = {
>>  	PLATFORM(i85x),
>> +	PLATFORM_GROUP(mobile),
>>  	.info = &(const struct intel_display_device_info) {
>>  		I830_DISPLAY,
>>  
>> @@ -313,6 +315,7 @@ static const struct platform_desc i915g_desc = {
>>  
>>  static const struct platform_desc i915gm_desc = {
>>  	PLATFORM(i915gm),
>> +	PLATFORM_GROUP(mobile),
>>  	.info = &(const struct intel_display_device_info) {
>>  		GEN3_DISPLAY,
>>  		I9XX_COLORS,
>> @@ -337,6 +340,7 @@ static const struct platform_desc i945g_desc = {
>>  
>>  static const struct platform_desc i945gm_desc = {
>>  	PLATFORM(i915gm),
>> +	PLATFORM_GROUP(mobile),
>>  	.info = &(const struct intel_display_device_info) {
>>  		GEN3_DISPLAY,
>>  		I9XX_COLORS,
>> @@ -358,13 +362,21 @@ static const struct platform_desc g33_desc = {
>>  	},
>>  };
>>  
>> -static const struct platform_desc pnv_desc = {
>> +static const struct intel_display_device_info pnv_display = {
>> +	GEN3_DISPLAY,
>> +	I9XX_COLORS,
>> +	.has_hotplug = 1,
>> +};
>> +
>> +static const struct platform_desc pnv_g_desc = {
>>  	PLATFORM(pineview),
>> -	.info = &(const struct intel_display_device_info) {
>> -		GEN3_DISPLAY,
>> -		I9XX_COLORS,
>> -		.has_hotplug = 1,
>> -	},
>> +	.info = &pnv_display,
>> +};
>> +
>> +static const struct platform_desc pnv_m_desc = {
>> +	PLATFORM(pineview),
>> +	PLATFORM_GROUP(mobile),
>> +	.info = &pnv_display,
>>  };
>>  
>>  #define GEN4_DISPLAY \
>> @@ -391,6 +403,7 @@ static const struct platform_desc i965g_desc = {
>>  
>>  static const struct platform_desc i965gm_desc = {
>>  	PLATFORM(i965gm),
>> +	PLATFORM_GROUP(mobile),
>>  	.info = &(const struct intel_display_device_info) {
>>  		GEN4_DISPLAY,
>>  		.has_overlay = 1,
>> @@ -414,6 +427,7 @@ static const struct platform_desc g45_desc = {
>>  static const struct platform_desc gm45_desc = {
>>  	PLATFORM(gm45),
>>  	PLATFORM_GROUP(g4x),
>> +	PLATFORM_GROUP(mobile),
>>  	.info = &(const struct intel_display_device_info) {
>>  		GEN4_DISPLAY,
>>  		.supports_tv = 1,
>> @@ -444,6 +458,7 @@ static const struct platform_desc ilk_d_desc = {
>>  
>>  static const struct platform_desc ilk_m_desc = {
>>  	PLATFORM(ironlake),
>> +	PLATFORM_GROUP(mobile),
>>  	.info = &(const struct intel_display_device_info) {
>>  		ILK_DISPLAY,
>>  
>> @@ -451,38 +466,54 @@ static const struct platform_desc ilk_m_desc = {
>>  	},
>>  };
>>  
>> -static const struct platform_desc snb_desc = {
>> +const struct intel_display_device_info snb_display = {
>
> get static back here as test robot already pointed out...
>
>> +	.has_hotplug = 1,
>> +	I9XX_PIPE_OFFSETS,
>> +	I9XX_CURSOR_OFFSETS,
>> +	ILK_COLORS,
>> +
>> +	.__runtime_defaults.ip.ver = 6,
>> +	.__runtime_defaults.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B),
>> +	.__runtime_defaults.cpu_transcoder_mask =
>> +	BIT(TRANSCODER_A) | BIT(TRANSCODER_B),
>> +	.__runtime_defaults.port_mask = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) | BIT(PORT_D), /* DP A, SDVO/HDMI/DP B, HDMI/DP C/D */
>> +	.__runtime_defaults.fbc_mask = BIT(INTEL_FBC_A),
>> +};
>> +
>> +static const struct platform_desc snb_d_desc = {
>>  	PLATFORM(sandybridge),
>> -	.info = &(const struct intel_display_device_info) {
>> -		.has_hotplug = 1,
>> -		I9XX_PIPE_OFFSETS,
>> -		I9XX_CURSOR_OFFSETS,
>> -		ILK_COLORS,
>> +	.info = &snb_display,
>> +};
>>  
>> -		.__runtime_defaults.ip.ver = 6,
>> -		.__runtime_defaults.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B),
>> -		.__runtime_defaults.cpu_transcoder_mask =
>> -		BIT(TRANSCODER_A) | BIT(TRANSCODER_B),
>> -		.__runtime_defaults.port_mask = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) | BIT(PORT_D), /* DP A, SDVO/HDMI/DP B, HDMI/DP C/D */
>> -		.__runtime_defaults.fbc_mask = BIT(INTEL_FBC_A),
>> -	},
>> +static const struct platform_desc snb_m_desc = {
>> +	PLATFORM(sandybridge),
>> +	PLATFORM_GROUP(mobile),
>> +	.info = &snb_display,
>> +};
>> +
>> +static const struct intel_display_device_info ivb_display = {
>> +	.has_hotplug = 1,
>> +	IVB_PIPE_OFFSETS,
>> +	IVB_CURSOR_OFFSETS,
>> +	IVB_COLORS,
>> +
>> +	.__runtime_defaults.ip.ver = 7,
>> +	.__runtime_defaults.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C),
>> +	.__runtime_defaults.cpu_transcoder_mask =
>> +	BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | BIT(TRANSCODER_C),
>> +	.__runtime_defaults.port_mask = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) | BIT(PORT_D), /* DP A, SDVO/HDMI/DP B, HDMI/DP C/D */
>> +	.__runtime_defaults.fbc_mask = BIT(INTEL_FBC_A),
>>  };
>>  
>> -static const struct platform_desc ivb_desc = {
>> +static const struct platform_desc ivb_d_desc = {
>>  	PLATFORM(ivybridge),
>> -	.info = &(const struct intel_display_device_info) {
>> -		.has_hotplug = 1,
>> -		IVB_PIPE_OFFSETS,
>> -		IVB_CURSOR_OFFSETS,
>> -		IVB_COLORS,
>> +	.info = &ivb_display,
>
> now I'm wondering 2 things:
>
> 1. is info really the good name now?

Why not?

Desc is the platform description, unrelated to display, and info is the
display info. In some cases display info was (and still is) inline, but
when it's shared between multiple platforms it needs to be separate.

> 2. does it deserves a separate patch refactor other then this one focused
> on the mobile group?

Un-inlining the dispay info init could reasonably be a separate
patch. Question is, do we then want to do it for all platforms, or just
the ones that need the split here?


BR,
Jani.


>
>> +};
>>  
>> -		.__runtime_defaults.ip.ver = 7,
>> -		.__runtime_defaults.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C),
>> -		.__runtime_defaults.cpu_transcoder_mask =
>> -		BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | BIT(TRANSCODER_C),
>> -		.__runtime_defaults.port_mask = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) | BIT(PORT_D), /* DP A, SDVO/HDMI/DP B, HDMI/DP C/D */
>> -		.__runtime_defaults.fbc_mask = BIT(INTEL_FBC_A),
>> -	},
>> +static const struct platform_desc ivb_m_desc = {
>> +	PLATFORM(ivybridge),
>> +	PLATFORM_GROUP(mobile),
>> +	.info = &ivb_display,
>>  };
>>  
>>  static const struct platform_desc vlv_desc = {
>> @@ -1385,11 +1416,14 @@ static const struct {
>>  	INTEL_I965GM_IDS(INTEL_DISPLAY_DEVICE, &i965gm_desc),
>>  	INTEL_GM45_IDS(INTEL_DISPLAY_DEVICE, &gm45_desc),
>>  	INTEL_G45_IDS(INTEL_DISPLAY_DEVICE, &g45_desc),
>> -	INTEL_PNV_IDS(INTEL_DISPLAY_DEVICE, &pnv_desc),
>> +	INTEL_PNV_G_IDS(INTEL_DISPLAY_DEVICE, &pnv_g_desc),
>> +	INTEL_PNV_M_IDS(INTEL_DISPLAY_DEVICE, &pnv_m_desc),
>>  	INTEL_ILK_D_IDS(INTEL_DISPLAY_DEVICE, &ilk_d_desc),
>>  	INTEL_ILK_M_IDS(INTEL_DISPLAY_DEVICE, &ilk_m_desc),
>> -	INTEL_SNB_IDS(INTEL_DISPLAY_DEVICE, &snb_desc),
>> -	INTEL_IVB_IDS(INTEL_DISPLAY_DEVICE, &ivb_desc),
>> +	INTEL_SNB_D_IDS(INTEL_DISPLAY_DEVICE, &snb_d_desc),
>> +	INTEL_SNB_M_IDS(INTEL_DISPLAY_DEVICE, &snb_m_desc),
>> +	INTEL_IVB_D_IDS(INTEL_DISPLAY_DEVICE, &ivb_d_desc),
>> +	INTEL_IVB_M_IDS(INTEL_DISPLAY_DEVICE, &ivb_m_desc),
>>  	INTEL_HSW_IDS(INTEL_DISPLAY_DEVICE, &hsw_desc),
>>  	INTEL_VLV_IDS(INTEL_DISPLAY_DEVICE, &vlv_desc),
>>  	INTEL_BDW_IDS(INTEL_DISPLAY_DEVICE, &bdw_desc),
>> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h
>> index e1398689cda5..84378c787923 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display_device.h
>> +++ b/drivers/gpu/drm/i915/display/intel_display_device.h
>> @@ -24,6 +24,7 @@ struct pci_dev;
>>  #define INTEL_DISPLAY_PLATFORMS(func) \
>>  	/* Platform group aliases */ \
>>  	func(g4x) /* g45 and gm45 */ \
>> +	func(mobile) /* mobile platforms */ \
>>  	func(dgfx) /* discrete graphics */ \
>>  	/* Display ver 2 */ \
>>  	func(i830) \
>> -- 
>> 2.39.5
>> 

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-11-07 10:33 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-04 17:19 [PATCH 00/15] drm/i915/display: convert display feature helpers to struct intel_display Jani Nikula
2024-11-04 17:19 ` [PATCH 01/15] drm/i915/display: identify discrete graphics Jani Nikula
2024-11-06 16:43   ` Rodrigo Vivi
2024-11-04 17:19 ` [PATCH 02/15] drm/i915/display: convert HAS_D12_PLANE_MINIMIZATION() to struct intel_display Jani Nikula
2024-11-06  8:58   ` Govindapillai, Vinod
2024-11-06  9:07     ` Jani Nikula
2024-11-06 16:44   ` Rodrigo Vivi
2024-11-04 17:19 ` [PATCH 03/15] drm/i915/display: convert HAS_4TILE() " Jani Nikula
2024-11-06  9:11   ` Govindapillai, Vinod
2024-11-06 16:45   ` Rodrigo Vivi
2024-11-04 17:19 ` [PATCH 04/15] drm/i915/display: convert HAS_DOUBLE_BUFFERED_M_N() " Jani Nikula
2024-11-06  9:17   ` Govindapillai, Vinod
2024-11-06 16:46   ` Rodrigo Vivi
2024-11-04 17:19 ` [PATCH 05/15] drm/i915/display: convert HAS_DP20() " Jani Nikula
2024-11-06 10:19   ` Govindapillai, Vinod
2024-11-06 16:47   ` Rodrigo Vivi
2024-11-04 17:19 ` [PATCH 06/15] drm/i915/display: convert HAS_GMBUS_BURST_READ() " Jani Nikula
2024-11-06 10:21   ` Govindapillai, Vinod
2024-11-06 17:03   ` Rodrigo Vivi
2024-11-04 17:19 ` [PATCH 07/15] drm/i915/display: convert HAS_IPS() " Jani Nikula
2024-11-06 10:24   ` Govindapillai, Vinod
2024-11-06 17:04   ` Rodrigo Vivi
2024-11-04 17:19 ` [PATCH 08/15] drm/i915/display: convert HAS_MBUS_JOINING() " Jani Nikula
2024-11-06 10:27   ` Govindapillai, Vinod
2024-11-06 17:04   ` Rodrigo Vivi
2024-11-04 17:19 ` [PATCH 09/15] drm/i915/display: convert HAS_SAGV() " Jani Nikula
2024-11-06 10:38   ` Govindapillai, Vinod
2024-11-06 17:06   ` Rodrigo Vivi
2024-11-04 17:19 ` [PATCH 10/15] drm/i915/display: convert HAS_HW_SAGV_WM() " Jani Nikula
2024-11-06 10:44   ` Govindapillai, Vinod
2024-11-06 17:08   ` Rodrigo Vivi
2024-11-04 17:19 ` [PATCH 11/15] drm/i915/display: convert HAS_ULTRAJOINER() " Jani Nikula
2024-11-06 10:55   ` Govindapillai, Vinod
2024-11-06 17:09   ` Rodrigo Vivi
2024-11-04 17:19 ` [PATCH 12/15] drm/i915/display: rename i915 parameter to __display in feature helpers Jani Nikula
2024-11-06 11:50   ` Govindapillai, Vinod
2024-11-04 17:19 ` [PATCH 13/15] drm/i915/display: convert display device identification to struct intel_display Jani Nikula
2024-11-05 10:17   ` [PATCH v2] " Jani Nikula
2024-11-06 13:03     ` Govindapillai, Vinod
2024-11-04 17:19 ` [PATCH 14/15] drm/i915/display: pass struct pci_dev * to intel_display_device_probe() Jani Nikula
2024-11-06 13:10   ` Govindapillai, Vinod
2024-11-04 17:19 ` [PATCH 15/15] drm/i915/display: add mobile platform group Jani Nikula
2024-11-05 18:53   ` kernel test robot
2024-11-06  9:27   ` [PATCH v2] " Jani Nikula
2024-11-06 15:44     ` Govindapillai, Vinod
2024-11-06 16:40   ` [PATCH 15/15] " Rodrigo Vivi
2024-11-07 10:32     ` Jani Nikula [this message]
2024-11-07 18:10       ` Rodrigo Vivi
2024-11-04 17:58 ` ✓ CI.Patch_applied: success for drm/i915/display: convert display feature helpers to struct intel_display Patchwork
2024-11-04 17:59 ` ✗ CI.checkpatch: warning " Patchwork
2024-11-04 18:00 ` ✓ CI.KUnit: success " Patchwork
2024-11-04 18:12 ` ✓ CI.Build: " Patchwork
2024-11-04 18:14 ` ✓ CI.Hooks: " Patchwork
2024-11-04 18:15 ` ✗ CI.checksparse: warning " Patchwork
2024-11-04 19:01 ` ✗ CI.BAT: failure " Patchwork
2024-11-05  6:25 ` ✓ CI.FULL: success " Patchwork
2024-11-05 11:33 ` ✓ CI.Patch_applied: success for drm/i915/display: convert display feature helpers to struct intel_display (rev2) Patchwork
2024-11-05 11:34 ` ✗ CI.checkpatch: warning " Patchwork
2024-11-05 11:35 ` ✓ CI.KUnit: success " Patchwork
2024-11-05 11:47 ` ✓ CI.Build: " Patchwork
2024-11-05 11:49 ` ✓ CI.Hooks: " Patchwork
2024-11-05 11:51 ` ✗ CI.checksparse: warning " Patchwork
2024-11-05 12:12 ` ✓ CI.BAT: success " Patchwork
2024-11-06  9:46 ` ✓ CI.Patch_applied: success for drm/i915/display: convert display feature helpers to struct intel_display (rev3) Patchwork
2024-11-06  9:47 ` ✗ CI.checkpatch: warning " Patchwork
2024-11-06  9:48 ` ✓ CI.KUnit: success " Patchwork
2024-11-06 10:00 ` ✓ CI.Build: " Patchwork
2024-11-06 10:02 ` ✓ CI.Hooks: " Patchwork
2024-11-06 10:04 ` ✗ CI.checksparse: warning " Patchwork
2024-11-06 10:20 ` ✓ CI.BAT: success " Patchwork
2024-11-06 14:11 ` ✗ CI.FULL: failure for drm/i915/display: convert display feature helpers to struct intel_display (rev2) Patchwork
2024-11-07 11:08 ` ✗ CI.FULL: failure for drm/i915/display: convert display feature helpers to struct intel_display (rev3) 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=87o72re3l3.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=rodrigo.vivi@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;
as well as URLs for NNTP newsgroup(s).