All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/i915: Split Pineview device info into desktop and mobile
Date: Mon, 18 Mar 2019 15:50:14 +0000	[thread overview]
Message-ID: <fce6f938-c7c3-0d94-9e8f-14f23f1d9099@linux.intel.com> (raw)
In-Reply-To: <20190318135659.GK3888@intel.com>


On 18/03/2019 13:56, Ville Syrjälä wrote:
> On Mon, Mar 18, 2019 at 09:52:56AM +0000, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> This allows the IS_PINEVIEW_<G|M> macros to be removed and avoid
>> duplication of device ids already defined in i915_pciids.h.
>>
>> !IS_MOBILE check can be used in place of existing IS_PINEVIEW_G call
>> sites.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> ---
>>   arch/x86/kernel/early-quirks.c  |  3 ++-
>>   drivers/gpu/drm/i915/i915_drv.h |  2 --
>>   drivers/gpu/drm/i915/i915_pci.c | 12 ++++++++++--
>>   drivers/gpu/drm/i915/intel_pm.c |  4 ++--
>>   include/drm/i915_pciids.h       |  6 ++++--
>>   5 files changed, 18 insertions(+), 9 deletions(-)
>>
>> diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
>> index 50d5848bf22e..f91d3ed2df62 100644
>> --- a/arch/x86/kernel/early-quirks.c
>> +++ b/arch/x86/kernel/early-quirks.c
>> @@ -525,7 +525,8 @@ static const struct pci_device_id intel_early_ids[] __initconst = {
>>   	INTEL_I945G_IDS(&gen3_early_ops),
>>   	INTEL_I945GM_IDS(&gen3_early_ops),
>>   	INTEL_VLV_IDS(&gen6_early_ops),
>> -	INTEL_PINEVIEW_IDS(&gen3_early_ops),
>> +	INTEL_PINEVIEW_G_IDS(&gen3_early_ops),
>> +	INTEL_PINEVIEW_M_IDS(&gen3_early_ops),
>>   	INTEL_I965G_IDS(&gen3_early_ops),
>>   	INTEL_G33_IDS(&gen3_early_ops),
>>   	INTEL_I965GM_IDS(&gen3_early_ops),
>> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>> index c65c2e6649df..80388984c9fc 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.h
>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>> @@ -2296,8 +2296,6 @@ static inline unsigned int i915_sg_segment_size(void)
>>   #define IS_G45(dev_priv)	IS_PLATFORM(dev_priv, INTEL_G45)
>>   #define IS_GM45(dev_priv)	IS_PLATFORM(dev_priv, INTEL_GM45)
>>   #define IS_G4X(dev_priv)	(IS_G45(dev_priv) || IS_GM45(dev_priv))
>> -#define IS_PINEVIEW_G(dev_priv)	(INTEL_DEVID(dev_priv) == 0xa001)
>> -#define IS_PINEVIEW_M(dev_priv)	(INTEL_DEVID(dev_priv) == 0xa011)
>>   #define IS_PINEVIEW(dev_priv)	IS_PLATFORM(dev_priv, INTEL_PINEVIEW)
>>   #define IS_G33(dev_priv)	IS_PLATFORM(dev_priv, INTEL_G33)
>>   #define IS_IRONLAKE_M(dev_priv)	(INTEL_DEVID(dev_priv) == 0x0046)
>> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
>> index ef7410c492fd..4fa072a3280f 100644
>> --- a/drivers/gpu/drm/i915/i915_pci.c
>> +++ b/drivers/gpu/drm/i915/i915_pci.c
>> @@ -257,7 +257,14 @@ static const struct intel_device_info intel_g33_info = {
>>   	.display.has_overlay = 1,
>>   };
>>   
>> -static const struct intel_device_info intel_pineview_info = {
>> +static const struct intel_device_info intel_pineview_g_info = {
>> +	GEN3_FEATURES,
>> +	PLATFORM(INTEL_PINEVIEW),
>> +	.display.has_hotplug = 1,
>> +	.display.has_overlay = 1,
>> +};
> 
> So far both PNVs were marked as "mobile". So the real concern is
> whether all the current IS_MOBILE() checks correct for pnv_g.
> 
> A quick scan points at these potentially being broken by this change:
>   i915_gem_detect_bit_6_swizzle()
>   i915_enable_asle_pipestat()
>   i9xx_enable_pll()/assert_panel_unlocked()
>   i9xx_get_pfit_config()
> 
> Also intel_hpll_vco() would change behaviour, but I don't think
> we actually use this one pnv. I just added the pnv case there
> when trawling the old configdb for the details.

Wow.. yep, when you said mess the first time around you really meant it. 
Or maybe not mess but just legacy, how it was and what made sense in the 
day.

I suggest to drop this patch and leave the PINEVIEW_G/M as subplatforms 
in the last patch, to be untangled later.

Regards,

Tvrtko

> 
>> +
>> +static const struct intel_device_info intel_pineview_m_info = {
>>   	GEN3_FEATURES,
>>   	PLATFORM(INTEL_PINEVIEW),
>>   	.is_mobile = 1,
>> @@ -753,7 +760,8 @@ static const struct pci_device_id pciidlist[] = {
>>   	INTEL_I965GM_IDS(&intel_i965gm_info),
>>   	INTEL_GM45_IDS(&intel_gm45_info),
>>   	INTEL_G45_IDS(&intel_g45_info),
>> -	INTEL_PINEVIEW_IDS(&intel_pineview_info),
>> +	INTEL_PINEVIEW_G_IDS(&intel_pineview_g_info),
>> +	INTEL_PINEVIEW_M_IDS(&intel_pineview_m_info),
>>   	INTEL_IRONLAKE_D_IDS(&intel_ironlake_d_info),
>>   	INTEL_IRONLAKE_M_IDS(&intel_ironlake_m_info),
>>   	INTEL_SNB_D_GT1_IDS(&intel_sandybridge_d_gt1_info),
>> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
>> index d73b13ca57a0..24a34ccabc2a 100644
>> --- a/drivers/gpu/drm/i915/intel_pm.c
>> +++ b/drivers/gpu/drm/i915/intel_pm.c
>> @@ -850,7 +850,7 @@ static void pineview_update_wm(struct intel_crtc *unused_crtc)
>>   	u32 reg;
>>   	unsigned int wm;
>>   
>> -	latency = intel_get_cxsr_latency(IS_PINEVIEW_G(dev_priv),
>> +	latency = intel_get_cxsr_latency(!IS_MOBILE(dev_priv),
>>   					 dev_priv->is_ddr3,
>>   					 dev_priv->fsb_freq,
>>   					 dev_priv->mem_freq);
>> @@ -9561,7 +9561,7 @@ void intel_init_pm(struct drm_i915_private *dev_priv)
>>   		dev_priv->display.initial_watermarks = g4x_initial_watermarks;
>>   		dev_priv->display.optimize_watermarks = g4x_optimize_watermarks;
>>   	} else if (IS_PINEVIEW(dev_priv)) {
>> -		if (!intel_get_cxsr_latency(IS_PINEVIEW_G(dev_priv),
>> +		if (!intel_get_cxsr_latency(!IS_MOBILE(dev_priv),
>>   					    dev_priv->is_ddr3,
>>   					    dev_priv->fsb_freq,
>>   					    dev_priv->mem_freq)) {
>> diff --git a/include/drm/i915_pciids.h b/include/drm/i915_pciids.h
>> index d200000feeaa..a025ed9fb0be 100644
>> --- a/include/drm/i915_pciids.h
>> +++ b/include/drm/i915_pciids.h
>> @@ -108,8 +108,10 @@
>>   	INTEL_VGA_DEVICE(0x2e42, info), /* B43_G */ \
>>   	INTEL_VGA_DEVICE(0x2e92, info)	/* B43_G.1 */
>>   
>> -#define INTEL_PINEVIEW_IDS(info)			\
>> -	INTEL_VGA_DEVICE(0xa001, info),			\
>> +#define INTEL_PINEVIEW_G_IDS(info) \
>> +	INTEL_VGA_DEVICE(0xa001, info)
>> +
>> +#define INTEL_PINEVIEW_M_IDS(info) \
>>   	INTEL_VGA_DEVICE(0xa011, info)
>>   
>>   #define INTEL_IRONLAKE_D_IDS(info) \
>> -- 
>> 2.19.1
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-03-18 15:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18  9:52 [PATCH 1/3] drm/i915: Split Pineview device info into desktop and mobile Tvrtko Ursulin
2019-03-18  9:52 ` [PATCH 2/3] drm/i915: Remove redundant device id from IS_IRONLAKE_M macro Tvrtko Ursulin
2019-03-18 11:10   ` Chris Wilson
2019-03-21 10:56     ` [PATCH v2 " Tvrtko Ursulin
2019-03-18  9:52 ` [PATCH 3/3] drm/i915: Introduce concept of a sub-platform Tvrtko Ursulin
2019-03-18 10:07   ` Tvrtko Ursulin
2019-03-18 11:25   ` Chris Wilson
2019-03-18 11:08 ` [PATCH 1/3] drm/i915: Split Pineview device info into desktop and mobile Chris Wilson
2019-03-18 13:56 ` Ville Syrjälä
2019-03-18 15:50   ` Tvrtko Ursulin [this message]
2019-03-18 14:47 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] " Patchwork
2019-03-18 14:49 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-03-18 15:24 ` ✓ Fi.CI.BAT: success " Patchwork
2019-03-18 20:54 ` ✓ Fi.CI.IGT: " Patchwork
2019-03-21 13:26 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm/i915: Split Pineview device info into desktop and mobile (rev2) Patchwork
2019-03-21 13:28 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-03-21 13:54 ` ✓ Fi.CI.BAT: success " Patchwork
2019-03-22  3:52 ` ✗ Fi.CI.IGT: 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=fce6f938-c7c3-0d94-9e8f-14f23f1d9099@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@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 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.