Kill IS_ULT() in favour of the per-product variant
Subsystems (2)
cover Kill IS_ULT() in favour of the per-product variant
A few reasons why I'd like to do that:
- IS_ULT() started as a HSW-only macro but has grown to mean IS_BDW_ULT/ULX as well. That means a few usages of IS_ULT() were slightly out of place (because we really meant checking for IS_HSW_ULT()).
- Being a ULT/ULX package doesn't mean anything specific in term of functionnality when looking across HSW/BDW/SKL, it's more about the TDP of that SKU. So it doesn't make a lot of sense to continue growing IS_ULT() to encompass SKL.
- The SPT detection code was using IS_ULT() for consistency with HSW and then, because the current IS_ULT() macro didn't know about SKL, we were triggering a warning. We now know that the pairing is a 1:1 relationship between the ULT/ULX SKUs and the LP PCHs, so we don't strickly need this check there and there's nothing needing a ULT/ULX check on SKL at the moment, so just discarded it in the PCH detection code.
Signature · 18 lines
Damien Damien Lespiau (6): drm/i915: Use IS_HSW_ULT() in a HSW specific code path drm/i915: Use IS_HSW_ULT() in HAS_IPS() drm/i915: Spell out IS_HSW/BDW_ULT() in intel_crt_present() drm/i915: Use IS_HSW_ULT() in HSW CDCLK clock read-out drm/i915/skl: Don't check for ULT/ULX when detecting the PCH drm/i915: Remove IS_ULT() drivers/gpu/drm/i915/i915_drv.c | 6 ++---- drivers/gpu/drm/i915/i915_drv.h | 3 +-- drivers/gpu/drm/i915/intel_ddi.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) -- 1.8.3.1
PATCH 1/6 drm/i915: Use IS_HSW_ULT() in a HSW specific code path
No need to add the BDW pci ULT/ULX checks inside a if (IS_HASWELL(dev)) code path.
--- drivers/gpu/drm/i915/i915_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +2 -2
@@ -463,7 +463,7 @@ void intel_detect_pch(struct drm_device *dev) dev_priv->pch_type =PCH_LPT ;DRM_DEBUG_KMS ("Found LynxPoint PCH\n" );WARN_ON (!IS_HASWELL (dev)); -WARN_ON (IS_ULT (dev)); +WARN_ON (IS_HSW_ULT (dev)); }else if (IS_BROADWELL (dev)) { dev_priv->pch_type =PCH_LPT ; dev_priv->pch_id =
@@ -474,7 +474,7 @@ void intel_detect_pch(struct drm_device *dev) dev_priv->pch_type =PCH_LPT ;DRM_DEBUG_KMS ("Found LynxPoint LP PCH\n" );WARN_ON (!IS_HASWELL (dev)); -WARN_ON (!IS_ULT (dev)); +WARN_ON (!IS_HSW_ULT (dev)); }else if (id ==INTEL_PCH_SPT_DEVICE_ID_TYPE ) { dev_priv->pch_type =PCH_SPT ;DRM_DEBUG_KMS ("Found SunrisePoint PCH\n" );
Signature · 1 line
1.8.3.1
PATCH 2/6 drm/i915: Use IS_HSW_ULT() in HAS_IPS()
In reply to Damien LespiauHAS_IPS() has a '|| IS_BROADWELL()', no need to check for IS_BDW_ULT().
--- drivers/gpu/drm/i915/i915_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.h +1 -1
@@ -2178,7 +2178,7 @@ struct drm_i915_cmd_table {#define HAS_PIPE_CXSR (dev) (INTEL_INFO(dev)->has_pipe_cxsr)#define HAS_FBC (dev) (INTEL_INFO(dev)->has_fbc) -#define HAS_IPS (dev) (IS_ULT(dev) || IS_BROADWELL(dev)) +#define HAS_IPS (dev) (IS_HSW_ULT(dev) || IS_BROADWELL(dev))#define HAS_DDI (dev) (INTEL_INFO(dev)->has_ddi)#define HAS_FPGA_DBG_UNCLAIMED (dev) (INTEL_INFO(dev)->has_fpga_dbg)
Signature · 1 line
1.8.3.1
PATCH 3/6 drm/i915: Spell out IS_HSW/BDW_ULT() in intel_crt_present()
In reply to Damien LespiauThe quality of being a ULT or ULX package doesn't tell anything across generations and so a global IS_ULT() macro doesn't make much sense, esp. as we're adding new products.
So, spell out which ULT/ULX SKUs we are talking about here, namely HSW and BDW.
--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -12160,7 +12160,7 @@ static bool intel_crt_present(struct drm_device *dev)if (INTEL_INFO (dev)->gen >=9 )return false; -if (IS_ULT (dev)) +if (IS_HSW_ULT (dev) ||IS_BDW_ULT (dev))return false;if (IS_CHERRYVIEW (dev))
Signature · 1 line
1.8.3.1
PATCH 4/6 drm/i915: Use IS_HSW_ULT() in HSW CDCLK clock read-out
In reply to Damien Lespiauhsw_get_cdclk_freq() is really just HSW, so we can use IS_HSW_ULT() instead of IS_ULT() there.
--- drivers/gpu/drm/i915/intel_ddi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_ddi.c +1 -1
@@ -1291,7 +1291,7 @@ static int hsw_get_cdclk_freq(struct drm_i915_private *dev_priv)return 450000 ; else if (freq == LCPLL_CLK_FREQ_450) return 450000; - else if (IS_ULT(dev)) + else if (IS_HSW_ULT(dev)) return 337500; else return 540000;
Signature · 1 line
1.8.3.1
PATCH 5/6 drm/i915/skl: Don't check for ULT/ULX when detecting the PCH
In reply to Damien LespiauIS_ULT() wasn't taking into account SKL so we had a warn with SPT-LP.
We don't realy need those checks here, and as we don't need to introduce IS_SKL_ULT/ULX() at the moment, let's just drop them.
--- drivers/gpu/drm/i915/i915_drv.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -2
@@ -479,12 +479,10 @@ void intel_detect_pch(struct drm_device *dev) dev_priv->pch_type =PCH_SPT ;DRM_DEBUG_KMS ("Found SunrisePoint PCH\n" );WARN_ON (!IS_SKYLAKE (dev)); -WARN_ON (IS_ULT (dev)); }else if (id ==INTEL_PCH_SPT_LP_DEVICE_ID_TYPE ) { dev_priv->pch_type =PCH_SPT ;DRM_DEBUG_KMS ("Found SunrisePoint LP PCH\n" );WARN_ON (!IS_SKYLAKE (dev)); -WARN_ON (!IS_ULT (dev)); }else continue ;
Signature · 1 line
1.8.3.1
PATCH 6/6 drm/i915: Remove IS_ULT()
In reply to Damien LespiauAs stated in the few previous commits, IS_ULT/ULX() is better per-platform as it has different consequences depending on the platform.
We now can get rid of it.
--- drivers/gpu/drm/i915/i915_drv.h | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.h +0 -1
@@ -2107,7 +2107,6 @@ struct drm_i915_cmd_table { (INTEL_DEVID(dev) & 0x00F0) == 0x0020)#define IS_HSW_ULT (dev) (IS_HASWELL(dev) && \ (INTEL_DEVID(dev) & 0xFF00) == 0x0A00) -#define IS_ULT (dev) (IS_HSW_ULT(dev) || IS_BDW_ULT(dev))#define IS_HSW_GT3 (dev) (IS_HASWELL(dev) && \ (INTEL_DEVID(dev) & 0x00F0) == 0x0020)/* ULX machines are also considered ULT. */
Signature · 1 line
1.8.3.1
Quoted 11 lines · Damien Lespiau
A few reasons why I'd like to do that:
-
IS_ULT()started as a HSW-only macro but has grown to mean IS_BDW_ULT/ULX as well. That means a few usages ofIS_ULT()were slightly out of place (because we really meant checking forIS_HSW_ULT()).- Being a ULT/ULX package doesn't mean anything specific in term of functionnality when looking across HSW/BDW/SKL, it's more about the TDP of that SKU. So it doesn't make a lot of sense to continue growing
IS_ULT()to encompass SKL.
Quoted 6 lines
- The SPT detection code was using
IS_ULT()for consistency with HSW and then, because the currentIS_ULT()macro didn't know about SKL, we were triggering a warning. We now know that the pairing is a 1:1 relationship between the ULT/ULX SKUs and the LP PCHs, so we don't strickly need this check there and there's nothing needing a ULT/ULX check on SKL at the moment, so just discarded it in the PCH detection code.
On the topic of ditching useless IS_FOO macros: For gen5+ the intel_info->is_mobile is similarly meaningless. Someone bored could make sure that we really don't have any pointless IS_MOBILE checks on those platforms and then garbage-collect all the intel_info structs. -Daniel
Quoted 25 lines
Signature · 24 lines
-- Damien Damien Lespiau (6): drm/i915: Use IS_HSW_ULT() in a HSW specific code path drm/i915: Use IS_HSW_ULT() in HAS_IPS() drm/i915: Spell out IS_HSW/BDW_ULT() in intel_crt_present() drm/i915: Use IS_HSW_ULT() in HSW CDCLK clock read-out drm/i915/skl: Don't check for ULT/ULX when detecting the PCH drm/i915: Remove IS_ULT() drivers/gpu/drm/i915/i915_drv.c | 6 ++---- drivers/gpu/drm/i915/i915_drv.h | 3 +-- drivers/gpu/drm/i915/intel_ddi.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) -- 1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
2014-10-01 17:36 GMT-03:00 Daniel Vetter <[email protected]>:
Quoted 12 lines · Damien Lespiau
Quoted 11 lines
A few reasons why I'd like to do that:
-
IS_ULT()started as a HSW-only macro but has grown to mean IS_BDW_ULT/ULX as well. That means a few usages ofIS_ULT()were slightly out of place (because we really meant checking forIS_HSW_ULT()).- Being a ULT/ULX package doesn't mean anything specific in term of functionnality when looking across HSW/BDW/SKL, it's more about the TDP of that SKU. So it doesn't make a lot of sense to continue growing
IS_ULT()to encompass SKL.
Quoted 6 lines
Quoted 6 lines
- The SPT detection code was using
IS_ULT()for consistency with HSW and then, because the currentIS_ULT()macro didn't know about SKL, we were triggering a warning. We now know that the pairing is a 1:1 relationship between the ULT/ULX SKUs and the LP PCHs, so we don't strickly need this check there and there's nothing needing a ULT/ULX check on SKL at the moment, so just discarded it in the PCH detection code.
As far as I know (and as far as our WARNs inside intel_detect_pch() have checked), the whole CPU/PCH pairing is a static thing. Can't we try to kill the whole intel_detect_pch(), and change the HAS_PCH_FOO macros to just check the PCI IDs or something like that?
Quoted 41 lines
On the topic of ditching useless
IS_FOOmacros: For gen5+ theintel_info->is_mobileis similarly meaningless. Someone bored could make sure that we really don't have any pointlessIS_MOBILEchecks on those platforms and then garbage-collect all theintel_infostructs. -DanielQuoted 18 lines
--
DamienDamien Lespiau (6):
drm/i915: UseIS_HSW_ULT()in a HSW specific code path drm/i915: UseIS_HSW_ULT()inHAS_IPS()
drm/i915: Spell out IS_HSW/BDW_ULT() inintel_crt_present()drm/i915: UseIS_HSW_ULT()in HSW CDCLK clock read-out drm/i915/skl: Don't check for ULT/ULX when detecting the PCH drm/i915: RemoveIS_ULT()drivers/gpu/drm/i915/i915_drv.c | 6 ++---- drivers/gpu/drm/i915/i915_drv.h | 3 +-- drivers/gpu/drm/i915/intel_ddi.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-)Quoted 7 lines
--
1.8.3.1_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Paulo Zanoni
2014-10-03 15:40 GMT-03:00 Paulo Zanoni <[email protected]>:
Quoted 20 lines
2014-10-01 17:36 GMT-03:00 Daniel Vetter <[email protected]>:
Quoted 12 lines · Damien Lespiau
Quoted 11 lines
A few reasons why I'd like to do that:
-
IS_ULT()started as a HSW-only macro but has grown to mean IS_BDW_ULT/ULX as well. That means a few usages ofIS_ULT()were slightly out of place (because we really meant checking forIS_HSW_ULT()).- Being a ULT/ULX package doesn't mean anything specific in term of functionnality when looking across HSW/BDW/SKL, it's more about the TDP of that SKU. So it doesn't make a lot of sense to continue growing
IS_ULT()to encompass SKL.Quoted 6 lines
Quoted 6 lines
- The SPT detection code was using
IS_ULT()for consistency with HSW and then, because the currentIS_ULT()macro didn't know about SKL, we were triggering a warning. We now know that the pairing is a 1:1 relationship between the ULT/ULX SKUs and the LP PCHs, so we don't strickly need this check there and there's nothing needing a ULT/ULX check on SKL at the moment, so just discarded it in the PCH detection code.
Quoted 4 lines
As far as I know (and as far as our WARNs inside
intel_detect_pch()have checked), the whole CPU/PCH pairing is a static thing. Can't we try to kill the wholeintel_detect_pch(), and change theHAS_PCH_FOOmacros to just check the PCI IDs or something like that?
Also, we could just check at the FUSE_STRAP bits to see if things are ULT or not.
Quoted 47 lines
Quoted 34 lines
On the topic of ditching useless
IS_FOOmacros: For gen5+ theintel_info->is_mobileis similarly meaningless. Someone bored could make sure that we really don't have any pointlessIS_MOBILEchecks on those platforms and then garbage-collect all theintel_infostructs. -DanielQuoted 18 lines
--
DamienDamien Lespiau (6):
drm/i915: UseIS_HSW_ULT()in a HSW specific code path drm/i915: UseIS_HSW_ULT()inHAS_IPS()
drm/i915: Spell out IS_HSW/BDW_ULT() inintel_crt_present()drm/i915: UseIS_HSW_ULT()in HSW CDCLK clock read-out drm/i915/skl: Don't check for ULT/ULX when detecting the PCH drm/i915: RemoveIS_ULT()drivers/gpu/drm/i915/i915_drv.c | 6 ++---- drivers/gpu/drm/i915/i915_drv.h | 3 +-- drivers/gpu/drm/i915/intel_ddi.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-)Quoted 7 lines
--
1.8.3.1_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfxQuoted 8 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Paulo Zanoni
Signature · 1 line
Paulo Zanoni
Paulo Zanoni
Reviewed-by2014-10-03 15:46 GMT-03:00 Paulo Zanoni <[email protected]>:
Quoted 21 lines
2014-10-03 15:40 GMT-03:00 Paulo Zanoni <[email protected]>:
Quoted 20 lines
2014-10-01 17:36 GMT-03:00 Daniel Vetter <[email protected]>:
Quoted 18 lines · Damien Lespiau
Quoted 17 lines
A few reasons why I'd like to do that:
-
IS_ULT()started as a HSW-only macro but has grown to mean IS_BDW_ULT/ULX as well. That means a few usages ofIS_ULT()were slightly out of place (because we really meant checking forIS_HSW_ULT()).- Being a ULT/ULX package doesn't mean anything specific in term of functionnality when looking across HSW/BDW/SKL, it's more about the TDP of that SKU. So it doesn't make a lot of sense to continue growing
IS_ULT()to encompass SKL.- The SPT detection code was using
IS_ULT()for consistency with HSW and then, because the currentIS_ULT()macro didn't know about SKL, we were triggering a warning. We now know that the pairing is a 1:1 relationship between the ULT/ULX SKUs and the LP PCHs, so we don't strickly need this check there and there's nothing needing a ULT/ULX check on SKL at the moment, so just discarded it in the PCH detection code.
Quoted 7 lines
Quoted 4 lines
As far as I know (and as far as our WARNs inside
intel_detect_pch()have checked), the whole CPU/PCH pairing is a static thing. Can't we try to kill the wholeintel_detect_pch(), and change theHAS_PCH_FOOmacros to just check the PCI IDs or something like that?Also, we could just check at the
FUSE_STRAPbits to see if things are ULT or not.
Also, for the whole series:
Quoted 53 lines
Quoted 46 lines
Quoted 35 lines
On the topic of ditching useless
IS_FOOmacros: For gen5+ theintel_info->is_mobileis similarly meaningless. Someone bored could make sure that we really don't have any pointlessIS_MOBILEchecks on those platforms and then garbage-collect all theintel_infostructs. -DanielQuoted 18 lines
--
DamienDamien Lespiau (6):
drm/i915: UseIS_HSW_ULT()in a HSW specific code path drm/i915: UseIS_HSW_ULT()inHAS_IPS()
drm/i915: Spell out IS_HSW/BDW_ULT() inintel_crt_present()drm/i915: UseIS_HSW_ULT()in HSW CDCLK clock read-out drm/i915/skl: Don't check for ULT/ULX when detecting the PCH drm/i915: RemoveIS_ULT()drivers/gpu/drm/i915/i915_drv.c | 6 ++---- drivers/gpu/drm/i915/i915_drv.h | 3 +-- drivers/gpu/drm/i915/intel_ddi.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-)Quoted 7 lines
--
1.8.3.1_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfxQuoted 8 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfxQuoted 2 lines
--
Paulo Zanoni--
Paulo Zanoni
Signature · 1 line
Paulo Zanoni
Quoted 27 lines · Paulo Zanoni
2014-10-03 15:46 GMT-03:00 Paulo Zanoni <[email protected]>:
Quoted 26 lines
2014-10-03 15:40 GMT-03:00 Paulo Zanoni <[email protected]>:
Quoted 24 lines
2014-10-01 17:36 GMT-03:00 Daniel Vetter <[email protected]>:
Quoted 12 lines · Damien Lespiau
Quoted 11 lines
A few reasons why I'd like to do that:
-
IS_ULT()started as a HSW-only macro but has grown to mean IS_BDW_ULT/ULX as well. That means a few usages ofIS_ULT()were slightly out of place (because we really meant checking forIS_HSW_ULT()).- Being a ULT/ULX package doesn't mean anything specific in term of functionnality when looking across HSW/BDW/SKL, it's more about the TDP of that SKU. So it doesn't make a lot of sense to continue growing
IS_ULT()to encompass SKL.Quoted 6 lines
Quoted 6 lines
- The SPT detection code was using
IS_ULT()for consistency with HSW and then, because the currentIS_ULT()macro didn't know about SKL, we were triggering a warning. We now know that the pairing is a 1:1 relationship between the ULT/ULX SKUs and the LP PCHs, so we don't strickly need this check there and there's nothing needing a ULT/ULX check on SKL at the moment, so just discarded it in the PCH detection code.As far as I know (and as far as our WARNs inside
intel_detect_pch()have checked), the whole CPU/PCH pairing is a static thing. Can't we try to kill the wholeintel_detect_pch(), and change theHAS_PCH_FOOmacros to just check the PCI IDs or something like that?
Quoted 5 lines
Quoted 2 lines
Also, we could just check at the
FUSE_STRAPbits to see if things are ULT or not.Also, for the whole series:
Reviewed-by Paulo Zanoni <[email protected]>
All merged, thanks.
-Daniel
Quoted 59 lines
Quoted 54 lines
Quoted 47 lines
Quoted 36 lines
On the topic of ditching useless
IS_FOOmacros: For gen5+ theintel_info->is_mobileis similarly meaningless. Someone bored could make sure that we really don't have any pointlessIS_MOBILEchecks on those platforms and then garbage-collect all theintel_infostructs. -DanielQuoted 18 lines
--
DamienDamien Lespiau (6):
drm/i915: UseIS_HSW_ULT()in a HSW specific code path drm/i915: UseIS_HSW_ULT()inHAS_IPS()
drm/i915: Spell out IS_HSW/BDW_ULT() inintel_crt_present()drm/i915: UseIS_HSW_ULT()in HSW CDCLK clock read-out drm/i915/skl: Don't check for ULT/ULX when detecting the PCH drm/i915: RemoveIS_ULT()drivers/gpu/drm/i915/i915_drv.c | 6 ++---- drivers/gpu/drm/i915/i915_drv.h | 3 +-- drivers/gpu/drm/i915/intel_ddi.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-)Quoted 7 lines
--
1.8.3.1_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfxQuoted 8 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfxQuoted 2 lines
--
Paulo Zanoni--
Paulo ZanoniSignature · 1 line
Paulo Zanoni
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch