drm/i915: split off Pineview desktop and mobile device info
Subsystems (4)
PATCH 1/2 drm/i915: split off Pineview desktop and mobile device info
This lets us use IS_MOBILE() for distinguishing the desktop and mobile parts instead of duplicating PCI IDs in Pineview specific checks.
--- 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(-)
arch/x86/kernel/early-quirks.c +2 -1
@@ -508,7 +508,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_D_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),
drivers/gpu/drm/i915/i915_drv.h +0 -2
@@ -2616,8 +2616,6 @@ intel_info(const struct drm_i915_private *dev_priv)#define IS_G45 (dev_priv) ((dev_priv)->info.platform == INTEL_G45)#define IS_GM45 (dev_priv) ((dev_priv)->info.platform == 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) ((dev_priv)->info.platform == INTEL_PINEVIEW)#define IS_G33 (dev_priv) ((dev_priv)->info.platform == INTEL_G33)#define IS_IRONLAKE_M (dev_priv) (INTEL_DEVID(dev_priv) == 0x0046)
drivers/gpu/drm/i915/i915_pci.c +10 -2
@@ -139,7 +139,14 @@ static const struct intel_device_info intel_g33_info = { .has_overlay = 1, }; -static const struct intel_device_info intel_pineview_info = { +static const struct intel_device_info intel_pineview_d_info = { +GEN3_FEATURES , + .platform =INTEL_PINEVIEW , + .has_hotplug =1 , + .has_overlay =1 , +}; + +static const struct intel_device_info intel_pineview_m_info = {GEN3_FEATURES , .platform =INTEL_PINEVIEW , .is_mobile =1 , .has_hotplug =1 ,
@@ -444,7 +451,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_D_IDS (&intel_pineview_d_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_IDS(&intel_sandybridge_d_info),
drivers/gpu/drm/i915/intel_pm.c +2 -2
@@ -659,7 +659,7 @@ static void pineview_update_wm(struct intel_crtc *unused_crtc)u32 reg;unsigned long 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);
@@ -7730,7 +7730,7 @@ void intel_init_pm(struct drm_i915_private *dev_priv)vlv_setup_wm_latency (dev_priv); dev_priv->display.update_wm = vlv_update_wm; }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)) {
include/drm/i915_pciids.h +4 -2
@@ -100,8 +100,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_D_IDS (info) \ + INTEL_VGA_DEVICE(0xa001, info) + +#define INTEL_PINEVIEW_M_IDS (info) \ INTEL_VGA_DEVICE(0xa011, info)#define INTEL_IRONLAKE_D_IDS (info) \
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/2 drm/i915: reduce PCI ID duplication in IS_IRONLAKE_M()
Reduce PCI ID duplication by replacing direct PCI ID check with INTEL_IRONLAKE && IS_MOBILE() check.
It's slightly less optimal, but clarity and single point of truth win.
--- drivers/gpu/drm/i915/i915_drv.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.h +2 -1
@@ -2618,7 +2618,8 @@ intel_info(const struct drm_i915_private *dev_priv)#define IS_G4X (dev_priv) (IS_G45(dev_priv) || IS_GM45(dev_priv))#define IS_PINEVIEW (dev_priv) ((dev_priv)->info.platform == INTEL_PINEVIEW)#define IS_G33 (dev_priv) ((dev_priv)->info.platform == INTEL_G33) -#define IS_IRONLAKE_M (dev_priv) (INTEL_DEVID(dev_priv) == 0x0046) +#define IS_IRONLAKE_M (dev_priv) ((dev_priv)->info.platform == INTEL_IRONLAKE && \ + IS_MOBILE(dev_priv))#define IS_IVYBRIDGE (dev_priv) ((dev_priv)->info.platform == INTEL_IVYBRIDGE)#define IS_IVB_GT1 (dev_priv) (INTEL_DEVID(dev_priv) == 0x0156 || \ INTEL_DEVID(dev_priv) == 0x0152 || \
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 2 lines · Jani Nikula
This lets us use
IS_MOBILE()for distinguishing the desktop and mobile parts instead of duplicating PCI IDs in Pineview specific checks.
This probably needs more thorough review of the !IS_MOBILE() paths in parts not touched by this patch.
For example this one in i915_gem_detect_bit_6_swizzle() which was pretty weird already before the Pineview device info patches:
} else if (IS_MOBILE(dev_priv) ||
(IS_GEN3(dev_priv) &&
!IS_G33(dev_priv) && !IS_PINEVIEW(dev_priv))) {BR,
Jani.
Quoted 107 lines
Cc Ville Syrjälä <[email protected]>Signed-off-by Jani Nikula <[email protected]>--- 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(-)arch/x86/kernel/early-quirks.c +2
-1@@ -508,7 +508,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_D_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),drivers/gpu/drm/i915/i915_drv.h +0
-2@@ -2616,8 +2616,6 @@ intel_info(const struct drm_i915_private *dev_priv)#define IS_G45 (dev_priv) ((dev_priv)->info.platform == INTEL_G45)#define IS_GM45 (dev_priv) ((dev_priv)->info.platform == 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) ((dev_priv)->info.platform == INTEL_PINEVIEW)#define IS_G33 (dev_priv) ((dev_priv)->info.platform == INTEL_G33)#define IS_IRONLAKE_M (dev_priv) (INTEL_DEVID(dev_priv) == 0x0046)drivers/gpu/drm/i915/i915_pci.c +10
-2@@ -139,7 +139,14 @@ static const struct intel_device_info intel_g33_info = { .has_overlay = 1, }; -static const struct intel_device_info intel_pineview_info = { +static const struct intel_device_info intel_pineview_d_info = { +GEN3_FEATURES , + .platform =INTEL_PINEVIEW , + .has_hotplug =1 , + .has_overlay =1 , +}; + +static const struct intel_device_info intel_pineview_m_info = {GEN3_FEATURES , .platform =INTEL_PINEVIEW , .is_mobile =1 , .has_hotplug =1 ,@@ -444,7 +451,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_D_IDS (&intel_pineview_d_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_IDS(&intel_sandybridge_d_info),drivers/gpu/drm/i915/intel_pm.c +2
-2@@ -659,7 +659,7 @@ static void pineview_update_wm(struct intel_crtc *unused_crtc)u32 reg;unsigned long 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);@@ -7730,7 +7730,7 @@ void intel_init_pm(struct drm_i915_private *dev_priv)vlv_setup_wm_latency (dev_priv); dev_priv->display.update_wm = vlv_update_wm; }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)) {include/drm/i915_pciids.h +4
-2@@ -100,8 +100,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_D_IDS (info) \ + INTEL_VGA_DEVICE(0xa001, info) + +#define INTEL_PINEVIEW_M_IDS (info) \ INTEL_VGA_DEVICE(0xa011, info)#define INTEL_IRONLAKE_D_IDS (info) \
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · Jani Nikula
Quoted 2 lines · Jani Nikula
This lets us use
IS_MOBILE()for distinguishing the desktop and mobile parts instead of duplicating PCI IDs in Pineview specific checks.This probably needs more thorough review of the !IS_MOBILE() paths in parts not touched by this patch.
And Daniel says,
11:06 danvet j4ni, pnv is_mobile, even for the desktop version 11:06 danvet iirc 11:07 danvet because is_mobile has nothing to do with whether the
chip is for laptops or not
so better just forget about these two patches I guess.
BR,
Jani.
Quoted 119 lines
For example this one in
i915_gem_detect_bit_6_swizzle()which was pretty weird already before the Pineview device info patches:} else if (IS_MOBILE(dev_priv) || (IS_GEN3(dev_priv) && !IS_G33(dev_priv) && !IS_PINEVIEW(dev_priv))) {BR,
Jani.Quoted 107 lines
Cc Ville Syrjälä <[email protected]>Signed-off-by Jani Nikula <[email protected]>--- 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(-)arch/x86/kernel/early-quirks.c +2
-1@@ -508,7 +508,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_D_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),drivers/gpu/drm/i915/i915_drv.h +0
-2@@ -2616,8 +2616,6 @@ intel_info(const struct drm_i915_private *dev_priv)#define IS_G45 (dev_priv) ((dev_priv)->info.platform == INTEL_G45)#define IS_GM45 (dev_priv) ((dev_priv)->info.platform == 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) ((dev_priv)->info.platform == INTEL_PINEVIEW)#define IS_G33 (dev_priv) ((dev_priv)->info.platform == INTEL_G33)#define IS_IRONLAKE_M (dev_priv) (INTEL_DEVID(dev_priv) == 0x0046)drivers/gpu/drm/i915/i915_pci.c +10
-2@@ -139,7 +139,14 @@ static const struct intel_device_info intel_g33_info = { .has_overlay = 1, }; -static const struct intel_device_info intel_pineview_info = { +static const struct intel_device_info intel_pineview_d_info = { +GEN3_FEATURES , + .platform =INTEL_PINEVIEW , + .has_hotplug =1 , + .has_overlay =1 , +}; + +static const struct intel_device_info intel_pineview_m_info = {GEN3_FEATURES , .platform =INTEL_PINEVIEW , .is_mobile =1 , .has_hotplug =1 ,@@ -444,7 +451,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_D_IDS (&intel_pineview_d_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_IDS(&intel_sandybridge_d_info),drivers/gpu/drm/i915/intel_pm.c +2
-2@@ -659,7 +659,7 @@ static void pineview_update_wm(struct intel_crtc *unused_crtc)u32 reg;unsigned long 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);@@ -7730,7 +7730,7 @@ void intel_init_pm(struct drm_i915_private *dev_priv)vlv_setup_wm_latency (dev_priv); dev_priv->display.update_wm = vlv_update_wm; }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)) {include/drm/i915_pciids.h +4
-2@@ -100,8 +100,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_D_IDS (info) \ + INTEL_VGA_DEVICE(0xa001, info) + +#define INTEL_PINEVIEW_M_IDS (info) \ INTEL_VGA_DEVICE(0xa011, info)#define INTEL_IRONLAKE_D_IDS (info) \
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 8 lines · Jani Nikula
Quoted 6 lines · Jani Nikula
Quoted 2 lines · Jani Nikula
This lets us use
IS_MOBILE()for distinguishing the desktop and mobile parts instead of duplicating PCI IDs in Pineview specific checks.This probably needs more thorough review of the !IS_MOBILE() paths in parts not touched by this patch.
Quoted 8 lines
And Daniel says,
11:06 danvet j4ni, pnv is_mobile, even for the desktop version 11:06 danvet iirc 11:07 danvet because is_mobile has nothing to do with whether thechip is for laptops or not
so better just forget about these two patches I guess.
Yeah, IS_MOBILE is seriously confusing in our code. On gen2/3 it was essentially matching HAS_LVDS (but we never made that one), later on the splits started to happened on different axis (atom vs big core and stuff like that), but somehow IS_MOBILE stuck around to this day and is sometimes abused to restrict w/a to specific chips. If someone wants to clean this up:
- Remove IS_MOBILE on gen5+, use specific platforms/pci ids where we need it.
- Rename IS_MOBILE to HAS_LVDS on gen2/3/4 (not entirely sure about gen4, would need to double-check that it makes sense).
- Nuke is_mobile from the chip info, it's only misleading people. Mobile is the future everywhere anyway ;-)
Cheers, Daniel
Quoted 128 lines
BR,
Jani.Quoted 119 lines
For example this one in
i915_gem_detect_bit_6_swizzle()which was pretty weird already before the Pineview device info patches:} else if (IS_MOBILE(dev_priv) || (IS_GEN3(dev_priv) && !IS_G33(dev_priv) && !IS_PINEVIEW(dev_priv))) {BR,
Jani.Quoted 107 lines
Cc Ville Syrjälä <[email protected]>Signed-off-by Jani Nikula <[email protected]>--- 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(-)arch/x86/kernel/early-quirks.c +2
-1@@ -508,7 +508,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_D_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),drivers/gpu/drm/i915/i915_drv.h +0
-2@@ -2616,8 +2616,6 @@ intel_info(const struct drm_i915_private *dev_priv)#define IS_G45 (dev_priv) ((dev_priv)->info.platform == INTEL_G45)#define IS_GM45 (dev_priv) ((dev_priv)->info.platform == 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) ((dev_priv)->info.platform == INTEL_PINEVIEW)#define IS_G33 (dev_priv) ((dev_priv)->info.platform == INTEL_G33)#define IS_IRONLAKE_M (dev_priv) (INTEL_DEVID(dev_priv) == 0x0046)drivers/gpu/drm/i915/i915_pci.c +10
-2@@ -139,7 +139,14 @@ static const struct intel_device_info intel_g33_info = { .has_overlay = 1, }; -static const struct intel_device_info intel_pineview_info = { +static const struct intel_device_info intel_pineview_d_info = { +GEN3_FEATURES , + .platform =INTEL_PINEVIEW , + .has_hotplug =1 , + .has_overlay =1 , +}; + +static const struct intel_device_info intel_pineview_m_info = {GEN3_FEATURES , .platform =INTEL_PINEVIEW , .is_mobile =1 , .has_hotplug =1 ,@@ -444,7 +451,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_D_IDS (&intel_pineview_d_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_IDS(&intel_sandybridge_d_info),drivers/gpu/drm/i915/intel_pm.c +2
-2@@ -659,7 +659,7 @@ static void pineview_update_wm(struct intel_crtc *unused_crtc)u32 reg;unsigned long 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);@@ -7730,7 +7730,7 @@ void intel_init_pm(struct drm_i915_private *dev_priv)vlv_setup_wm_latency (dev_priv); dev_priv->display.update_wm = vlv_update_wm; }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)) {include/drm/i915_pciids.h +4
-2@@ -100,8 +100,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_D_IDS (info) \ + INTEL_VGA_DEVICE(0xa001, info) + +#define INTEL_PINEVIEW_M_IDS (info) \ INTEL_VGA_DEVICE(0xa011, info)#define INTEL_IRONLAKE_D_IDS (info) \Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 16 lines · Daniel Vetter
Quoted 15 lines · Jani Nikula
Quoted 6 lines · Jani Nikula
Quoted 2 lines · Jani Nikula
This lets us use
IS_MOBILE()for distinguishing the desktop and mobile parts instead of duplicating PCI IDs in Pineview specific checks.This probably needs more thorough review of the !IS_MOBILE() paths in parts not touched by this patch.
And Daniel says,
11:06 danvet j4ni, pnv is_mobile, even for the desktop version 11:06 danvet iirc 11:07 danvet because is_mobile has nothing to do with whether thechip is for laptops or not
Quoted 4 lines
Quoted 1 line
so better just forget about these two patches I guess.
Yeah,
IS_MOBILEis seriously confusing in our code. On gen2/3 it was essentially matchingHAS_LVDS(but we never made that one),
We do use it in quite a few places to differentiate between the mobile and desktop variants of the chipset. There are some weird differences between the two branches of the family, eg. some MCHBAR registers live at different offsets, and swizzling stuff is different IIRC.
Quoted 8 lines
later on the
splits started to happened on different axis (atom vs big core and stuff like that), but somehowIS_MOBILEstuck around to this day and is sometimes abused to restrict w/a to specific chips. If someone wants to clean this up:- Remove
IS_MOBILEon gen5+, use specific platforms/pci ids where we need it.
IIRC I did look into that once, and the only place where it was used for ilk-ivb was eDP setup, as in "do we have port A or not?". For hsw+ we don't use it at all, and IIRC don't even set it.
Quoted 2 lines
- Rename
IS_MOBILEtoHAS_LVDSon gen2/3/4 (not entirely sure about gen4, would need to double-check that it makes sense).
830 doesn't have the LVDS port, so would need a bit of special care. And like I said. there are actual differences well outside the LVDS vs. not thing.
If we can solve the ilk-ivb port A case, then I think we can kill .is_mobile. For the older platforms we have separate IS_FOO and IS_FOO_M type of things so those can be used instead. But for ilk-ivb we don't have those, I think. Or maybe we do, not sure.
Quoted 138 lines
- Nuke
is_mobilefrom the chip info, it's only misleading people. Mobile is the future everywhere anyway ;-)Cheers, Daniel
Quoted 128 lines
BR,
Jani.Quoted 119 lines
For example this one in
i915_gem_detect_bit_6_swizzle()which was pretty weird already before the Pineview device info patches:} else if (IS_MOBILE(dev_priv) || (IS_GEN3(dev_priv) && !IS_G33(dev_priv) && !IS_PINEVIEW(dev_priv))) {BR,
Jani.Quoted 107 lines
Cc Ville Syrjälä <[email protected]>Signed-off-by Jani Nikula <[email protected]>--- 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(-)arch/x86/kernel/early-quirks.c +2
-1@@ -508,7 +508,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_D_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),drivers/gpu/drm/i915/i915_drv.h +0
-2@@ -2616,8 +2616,6 @@ intel_info(const struct drm_i915_private *dev_priv)#define IS_G45 (dev_priv) ((dev_priv)->info.platform == INTEL_G45)#define IS_GM45 (dev_priv) ((dev_priv)->info.platform == 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) ((dev_priv)->info.platform == INTEL_PINEVIEW)#define IS_G33 (dev_priv) ((dev_priv)->info.platform == INTEL_G33)#define IS_IRONLAKE_M (dev_priv) (INTEL_DEVID(dev_priv) == 0x0046)drivers/gpu/drm/i915/i915_pci.c +10
-2@@ -139,7 +139,14 @@ static const struct intel_device_info intel_g33_info = { .has_overlay = 1, }; -static const struct intel_device_info intel_pineview_info = { +static const struct intel_device_info intel_pineview_d_info = { +GEN3_FEATURES , + .platform =INTEL_PINEVIEW , + .has_hotplug =1 , + .has_overlay =1 , +}; + +static const struct intel_device_info intel_pineview_m_info = {GEN3_FEATURES , .platform =INTEL_PINEVIEW , .is_mobile =1 , .has_hotplug =1 ,@@ -444,7 +451,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_D_IDS (&intel_pineview_d_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_IDS(&intel_sandybridge_d_info),drivers/gpu/drm/i915/intel_pm.c +2
-2@@ -659,7 +659,7 @@ static void pineview_update_wm(struct intel_crtc *unused_crtc)u32 reg;unsigned long 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);@@ -7730,7 +7730,7 @@ void intel_init_pm(struct drm_i915_private *dev_priv)vlv_setup_wm_latency (dev_priv); dev_priv->display.update_wm = vlv_update_wm; }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)) {include/drm/i915_pciids.h +4
-2@@ -100,8 +100,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_D_IDS (info) \ + INTEL_VGA_DEVICE(0xa001, info) + +#define INTEL_PINEVIEW_M_IDS (info) \ INTEL_VGA_DEVICE(0xa011, info)#define INTEL_IRONLAKE_D_IDS (info) \Signature · 1 line
Jani Nikula, Intel Open Source Technology CenterSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 33 lines · Ville Syrjälä
Quoted 16 lines · Daniel Vetter
Quoted 15 lines · Jani Nikula
Quoted 6 lines · Jani Nikula
Quoted 2 lines · Jani Nikula
This lets us use
IS_MOBILE()for distinguishing the desktop and mobile parts instead of duplicating PCI IDs in Pineview specific checks.This probably needs more thorough review of the !IS_MOBILE() paths in parts not touched by this patch.
And Daniel says,
11:06 danvet j4ni, pnv is_mobile, even for the desktop version 11:06 danvet iirc 11:07 danvet because is_mobile has nothing to do with whether thechip is for laptops or not
Quoted 4 lines
Quoted 1 line
so better just forget about these two patches I guess.
Yeah,
IS_MOBILEis seriously confusing in our code. On gen2/3 it was essentially matchingHAS_LVDS(but we never made that one),We do use it in quite a few places to differentiate between the mobile and desktop variants of the chipset. There are some weird differences between the two branches of the family, eg. some MCHBAR registers live at different offsets, and swizzling stuff is different IIRC.
Quoted 6 lines
later on the
splits started to happened on different axis (atom vs big core and stuff like that), but somehowIS_MOBILEstuck around to this day and is sometimes abused to restrict w/a to specific chips. If someone wants to clean this up:
Quoted 6 lines
Quoted 2 lines
- Remove
IS_MOBILEon gen5+, use specific platforms/pci ids where we need it.IIRC I did look into that once, and the only place where it was used for ilk-ivb was eDP setup, as in "do we have port A or not?". For hsw+ we don't use it at all, and IIRC don't even set it.
There's IS_IRONLAKE_M() which looks at the PCI ID, but essentially it's IS_IRONLAKE && IS_MOBILE.
I really dislike direct PCI ID checks in the IS_* macros, because they duplicate PCI IDs from i915_pciids.h, which typically already has the IDs grouped at the granularity we'd like (mobile vs. not in this case). I wish we could do all the IS_*_{ULX,ULT,GT?} using the PCI ID macros from one source.
BR,
Jani.
Quoted 151 lines
Quoted 3 lines
- Rename
IS_MOBILEtoHAS_LVDSon gen2/3/4 (not entirely sure about gen4, would need to double-check that it makes sense).830 doesn't have the LVDS port, so would need a bit of special care. And like I said. there are actual differences well outside the LVDS vs. not thing.
If we can solve the ilk-ivb port A case, then I think we can kill .is_mobile. For the older platforms we have separate
IS_FOOandIS_FOO_Mtype of things so those can be used instead. But for ilk-ivb we don't have those, I think. Or maybe we do, not sure.Quoted 138 lines
- Nuke
is_mobilefrom the chip info, it's only misleading people. Mobile is the future everywhere anyway ;-)Cheers, Daniel
Quoted 128 lines
BR,
Jani.Quoted 119 lines
For example this one in
i915_gem_detect_bit_6_swizzle()which was pretty weird already before the Pineview device info patches:} else if (IS_MOBILE(dev_priv) || (IS_GEN3(dev_priv) && !IS_G33(dev_priv) && !IS_PINEVIEW(dev_priv))) {BR,
Jani.Quoted 107 lines
Cc Ville Syrjälä <[email protected]>Signed-off-by Jani Nikula <[email protected]>--- 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(-)arch/x86/kernel/early-quirks.c +2
-1@@ -508,7 +508,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_D_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),drivers/gpu/drm/i915/i915_drv.h +0
-2@@ -2616,8 +2616,6 @@ intel_info(const struct drm_i915_private *dev_priv)#define IS_G45 (dev_priv) ((dev_priv)->info.platform == INTEL_G45)#define IS_GM45 (dev_priv) ((dev_priv)->info.platform == 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) ((dev_priv)->info.platform == INTEL_PINEVIEW)#define IS_G33 (dev_priv) ((dev_priv)->info.platform == INTEL_G33)#define IS_IRONLAKE_M (dev_priv) (INTEL_DEVID(dev_priv) == 0x0046)drivers/gpu/drm/i915/i915_pci.c +10
-2@@ -139,7 +139,14 @@ static const struct intel_device_info intel_g33_info = { .has_overlay = 1, }; -static const struct intel_device_info intel_pineview_info = { +static const struct intel_device_info intel_pineview_d_info = { +GEN3_FEATURES , + .platform =INTEL_PINEVIEW , + .has_hotplug =1 , + .has_overlay =1 , +}; + +static const struct intel_device_info intel_pineview_m_info = {GEN3_FEATURES , .platform =INTEL_PINEVIEW , .is_mobile =1 , .has_hotplug =1 ,@@ -444,7 +451,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_D_IDS (&intel_pineview_d_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_IDS(&intel_sandybridge_d_info),drivers/gpu/drm/i915/intel_pm.c +2
-2@@ -659,7 +659,7 @@ static void pineview_update_wm(struct intel_crtc *unused_crtc)u32 reg;unsigned long 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);@@ -7730,7 +7730,7 @@ void intel_init_pm(struct drm_i915_private *dev_priv)vlv_setup_wm_latency (dev_priv); dev_priv->display.update_wm = vlv_update_wm; }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)) {include/drm/i915_pciids.h +4
-2@@ -100,8 +100,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_D_IDS (info) \ + INTEL_VGA_DEVICE(0xa001, info) + +#define INTEL_PINEVIEW_M_IDS (info) \ INTEL_VGA_DEVICE(0xa011, info)#define INTEL_IRONLAKE_D_IDS (info) \Signature · 1 line
Jani Nikula, Intel Open Source Technology CenterSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: split off Pineview desktop and mobile device info
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm/i915: split off Pineview desktop and mobile device info
URL : https://patchwork.freedesktop.org/series/16511/
State : warning
== Summary ==
Series 16511v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/16511/revisions/1/mbox/
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-a:
pass -> DMESG-WARN (fi-skl-6770hq)fi-bdw-5557u total:247 pass:219 dwarn:0 dfail:0 fail:0 skip:28 fi-bsw-n3050 total:247 pass:195 dwarn:0 dfail:0 fail:0 skip:52 fi-bxt-t5700 total:247 pass:206 dwarn:0 dfail:0 fail:0 skip:41 fi-byt-j1900 total:247 pass:206 dwarn:0 dfail:0 fail:0 skip:41 fi-byt-n2820 total:247 pass:202 dwarn:0 dfail:0 fail:0 skip:45 fi-hsw-4770 total:247 pass:214 dwarn:0 dfail:0 fail:0 skip:33 fi-hsw-4770r total:247 pass:214 dwarn:0 dfail:0 fail:0 skip:33 fi-ilk-650 total:247 pass:181 dwarn:0 dfail:0 fail:0 skip:66 fi-ivb-3520m total:247 pass:213 dwarn:0 dfail:0 fail:0 skip:34 fi-ivb-3770 total:247 pass:212 dwarn:0 dfail:0 fail:0 skip:35 fi-kbl-7500u total:247 pass:212 dwarn:0 dfail:0 fail:0 skip:35 fi-skl-6260u total:247 pass:220 dwarn:0 dfail:0 fail:0 skip:27 fi-skl-6700hq total:247 pass:214 dwarn:0 dfail:0 fail:0 skip:33 fi-skl-6700k total:247 pass:210 dwarn:3 dfail:0 fail:0 skip:34 fi-skl-6770hq total:247 pass:219 dwarn:1 dfail:0 fail:0 skip:27 fi-snb-2520m total:247 pass:202 dwarn:0 dfail:0 fail:0 skip:45 fi-snb-2600 total:247 pass:201 dwarn:0 dfail:0 fail:0 skip:46
ffcd96e45b3b3e4ca57d4879405d02b7b1b58946 drm-tip: 2016y-12m-07d-21h-45m-40s UTC integration manifest 9750e7f drm/i915: reduce PCI ID duplication in IS_IRONLAKE_M()
bb0d903 drm/i915: split off Pineview desktop and mobile device info
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3229/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: split off Pineview desktop and mobile device info
Quoted 7 lines
== Series Details ==
Series: series starting with [1/2] drm/i915: split off Pineview desktop and mobile device info
URL : https://patchwork.freedesktop.org/series/16511/
State : warning
Quoted 8 lines
== Summary ==
Series 16511v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/16511/revisions/1/mbox/Test
kms_pipe_crc_basic:Subgroup suspend-read-crc-pipe-a: pass -> DMESG-WARN (fi-skl-6770hq)
Still around: https://bugs.freedesktop.org/show_bug.cgi?id=97929
Quoted 19 lines
fi-bdw-5557u total:247 pass:219 dwarn:0 dfail:0 fail:0 skip:28 fi-bsw-n3050 total:247 pass:195 dwarn:0 dfail:0 fail:0 skip:52 fi-bxt-t5700 total:247 pass:206 dwarn:0 dfail:0 fail:0 skip:41 fi-byt-j1900 total:247 pass:206 dwarn:0 dfail:0 fail:0 skip:41 fi-byt-n2820 total:247 pass:202 dwarn:0 dfail:0 fail:0 skip:45 fi-hsw-4770 total:247 pass:214 dwarn:0 dfail:0 fail:0 skip:33 fi-hsw-4770r total:247 pass:214 dwarn:0 dfail:0 fail:0 skip:33 fi-ilk-650 total:247 pass:181 dwarn:0 dfail:0 fail:0 skip:66 fi-ivb-3520m total:247 pass:213 dwarn:0 dfail:0 fail:0 skip:34 fi-ivb-3770 total:247 pass:212 dwarn:0 dfail:0 fail:0 skip:35 fi-kbl-7500u total:247 pass:212 dwarn:0 dfail:0 fail:0 skip:35 fi-skl-6260u total:247 pass:220 dwarn:0 dfail:0 fail:0 skip:27 fi-skl-6700hq total:247 pass:214 dwarn:0 dfail:0 fail:0 skip:33 fi-skl-6700k total:247 pass:210 dwarn:3 dfail:0 fail:0 skip:34 fi-skl-6770hq total:247 pass:219 dwarn:1 dfail:0 fail:0 skip:27 fi-snb-2520m total:247 pass:202 dwarn:0 dfail:0 fail:0 skip:45 fi-snb-2600 total:247 pass:201 dwarn:0 dfail:0 fail:0 skip:46
Quoted 8 lines
ffcd96e45b3b3e4ca57d4879405d02b7b1b58946drm-tip: 2016y-12m-07d-21h- 45m-40s UTC integration manifest 9750e7f drm/i915: reduce PCI ID duplication inIS_IRONLAKE_M()
bb0d903 drm/i915: split off Pineview desktop and mobile device info== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3229/
Jani Saarinen
Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx