drm/i915: enable pnv gpu reset
Subsystems (2)
PATCH 1/2 drm/i915: enable pnv gpu reset
According to configdb the same register as for gen4 also exists on pnv. Try to use it.
--- drivers/gpu/drm/i915/intel_uncore.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +15 -5
@@ -566,11 +566,21 @@ int intel_gpu_reset(struct drm_device *dev) {switch (INTEL_INFO (dev)->gen) {case 7 : -case 6 :return gen6_do_reset (dev); -case 5 :return ironlake_do_reset (dev); -case 4 :return i965_do_reset (dev); -case 2 :return i8xx_do_reset (dev); -default :return -ENODEV ; +case 6 : +return gen6_do_reset (dev); +case 5 : +return ironlake_do_reset (dev); +case 4 : +return i965_do_reset (dev); +case 3 : +if (IS_PINEVIEW (dev)) +return i965_do_reset (dev); +else +return -ENODEV ; +case 2 : +return i8xx_do_reset (dev); +default : +return -ENODEV ; } }
Signature · 1 line
1.8.3.2
PATCH 2/2 drm/i915: fix pnv display core clock readout out
We need the correct clock to accurately assess whether we need to enable the double wide pipe mode or not.
--- drivers/gpu/drm/i915/i915_reg.h | 6 ++++++ drivers/gpu/drm/i915/intel_display.c | 29 ++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +6 -0
@@ -61,6 +61,12 @@#define GC_LOW_FREQUENCY_ENABLE (1 << 7)#define GC_DISPLAY_CLOCK_190_200_MHZ (0 << 4)#define GC_DISPLAY_CLOCK_333_MHZ (4 << 4) +#define GC_DISPLAY_CLOCK_267_MHZ_PNV (0 << 4) +#define GC_DISPLAY_CLOCK_333_MHZ_PNV (1 << 4) +#define GC_DISPLAY_CLOCK_444_MHZ_PNV (2 << 4) +#define GC_DISPLAY_CLOCK_200_MHZ_PNV (5 << 4) +#define GC_DISPLAY_CLOCK_133_MHZ_PNV (6 << 4) +#define GC_DISPLAY_CLOCK_167_MHZ_PNV (7 << 4)#define GC_DISPLAY_CLOCK_MASK (7 << 4)#define GM45_GC_RENDER_CLOCK_MASK (0xf << 0)#define GM45_GC_RENDER_CLOCK_266_MHZ (8 << 0)
drivers/gpu/drm/i915/intel_display.c +28 -1
@@ -4163,6 +4163,30 @@ static int i9xx_misc_get_display_clock_speed(struct drm_device *dev)return 200000 ; } +static int pnv_get_display_clock_speed (struct drm_device *dev) +{ +u16 gcfgc =0 ; + +pci_read_config_word (dev->pdev,GCFGC , &gcfgc); + +switch (gcfgc &GC_DISPLAY_CLOCK_MASK ) { +case GC_DISPLAY_CLOCK_267_MHZ_PNV : +return 267000 ; +case GC_DISPLAY_CLOCK_333_MHZ_PNV : +return 333000 ; +case GC_DISPLAY_CLOCK_444_MHZ_PNV : +return 444000 ; +case GC_DISPLAY_CLOCK_200_MHZ_PNV : +return 200000 ; +default : +DRM_ERROR ("Unknown pnv display core clock 0x%04x\n" , gcfgc); +case GC_DISPLAY_CLOCK_133_MHZ_PNV : +return 133000 ; +case GC_DISPLAY_CLOCK_167_MHZ_PNV : +return 167000 ; + } +} +static int i915gm_get_display_clock_speed (struct drm_device *dev) {u16 gcfgc =0 ;
@@ -9605,9 +9629,12 @@ static void intel_init_display(struct drm_device *dev)else if (IS_I915G (dev)) dev_priv->display.get_display_clock_speed = i915_get_display_clock_speed; -else if (IS_I945GM (dev) ||IS_845G (dev) ||IS_PINEVIEW_M (dev)) +else if (IS_I945GM (dev) ||IS_845G (dev)) dev_priv->display.get_display_clock_speed = i9xx_misc_get_display_clock_speed; +else if (IS_PINEVIEW (dev)) + dev_priv->display.get_display_clock_speed = + pnv_get_display_clock_speed;else if (IS_I915GM (dev)) dev_priv->display.get_display_clock_speed = i915gm_get_display_clock_speed;
Signature · 6 lines
1.8.3.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/2] drm/i915: fix pnv display core clock readout out
Quoted 7 lines · Daniel Vetter
We need the correct clock to accurately assess whether we need to enable the double wide pipe mode or not.
Cc Chris Wilson <[email protected]>Cc Stéphane Marchesin <[email protected]>Cc Stuart Abercrombie <[email protected]>Signed-off-by Daniel Vetter <[email protected]>
I have not found a definition of GCFGC for NM10. Mind including a reference?
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Re: [PATCH 2/2] drm/i915: fix pnv display core clock readout out
In reply to Daniel VetterQuoted 44 lines · Daniel Vetter
We need the correct clock to accurately assess whether we need to enable the double wide pipe mode or not.
Cc Chris Wilson <[email protected]>Cc Stéphane Marchesin <[email protected]>Cc Stuart Abercrombie <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 6 ++++++ drivers/gpu/drm/i915/intel_display.c | 29 ++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/i915_reg.h +6
-0@@ -61,6 +61,12 @@#define GC_LOW_FREQUENCY_ENABLE (1 << 7)#define GC_DISPLAY_CLOCK_190_200_MHZ (0 << 4)#define GC_DISPLAY_CLOCK_333_MHZ (4 << 4) +#define GC_DISPLAY_CLOCK_267_MHZ_PNV (0 << 4) +#define GC_DISPLAY_CLOCK_333_MHZ_PNV (1 << 4) +#define GC_DISPLAY_CLOCK_444_MHZ_PNV (2 << 4) +#define GC_DISPLAY_CLOCK_200_MHZ_PNV (5 << 4) +#define GC_DISPLAY_CLOCK_133_MHZ_PNV (6 << 4) +#define GC_DISPLAY_CLOCK_167_MHZ_PNV (7 << 4)#define GC_DISPLAY_CLOCK_MASK (7 << 4)#define GM45_GC_RENDER_CLOCK_MASK (0xf << 0)#define GM45_GC_RENDER_CLOCK_266_MHZ (8 << 0)drivers/gpu/drm/i915/intel_display.c +7
-0@@ -4163,6 +4163,30 @@ static int i9xx_misc_get_display_clock_speed(struct drm_device *dev)return 200000 ; } +static int pnv_get_display_clock_speed (struct drm_device *dev) +{ +u16 gcfgc =0 ; + +pci_read_config_word (dev->pdev,GCFGC , &gcfgc); + +switch (gcfgc &GC_DISPLAY_CLOCK_MASK ) {
drivers/gpu/drm/i915/intel_display.c static int i9xx_misc_get_display_clock_speed(struct drm_device *dev) · line 4182
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10
-0+case GC_DISPLAY_CLOCK_267_MHZ_PNV : +return 267000 ; +case GC_DISPLAY_CLOCK_333_MHZ_PNV : +return 333000 ; +case GC_DISPLAY_CLOCK_444_MHZ_PNV : +return 444000 ; +case GC_DISPLAY_CLOCK_200_MHZ_PNV : +return 200000 ; +default : +DRM_ERROR ("Unknown pnv display core clock 0x%04x\n" , gcfgc);
Reading the spec, should the default/fallback be 333 MHz for desktop? Otherwise,
Quoted 31 lines
drivers/gpu/drm/i915/intel_display.c +11
-1+case GC_DISPLAY_CLOCK_133_MHZ_PNV : +return 133000 ; +case GC_DISPLAY_CLOCK_167_MHZ_PNV : +return 167000 ; + } +} +static int i915gm_get_display_clock_speed (struct drm_device *dev) {u16 gcfgc =0 ;@@ -9605,9 +9629,12 @@ static void intel_init_display(struct drm_device *dev)else if (IS_I915G (dev)) dev_priv->display.get_display_clock_speed = i915_get_display_clock_speed; -else if (IS_I945GM (dev) ||IS_845G (dev) ||IS_PINEVIEW_M (dev)) +else if (IS_I945GM (dev) ||IS_845G (dev)) dev_priv->display.get_display_clock_speed = i9xx_misc_get_display_clock_speed; +else if (IS_PINEVIEW (dev)) + dev_priv->display.get_display_clock_speed = + pnv_get_display_clock_speed;else if (IS_I915GM (dev)) dev_priv->display.get_display_clock_speed = i915gm_get_display_clock_speed;Signature · 6 lines
1.8.3.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter
AppliedRe: [PATCH 2/2] drm/i915: fix pnv display core clock readout out
Quoted 50 lines · Jani Nikula
Quoted 49 lines · Daniel Vetter
We need the correct clock to accurately assess whether we need to enable the double wide pipe mode or not.
Cc Chris Wilson <[email protected]>Cc Stéphane Marchesin <[email protected]>Cc Stuart Abercrombie <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 6 ++++++ drivers/gpu/drm/i915/intel_display.c | 29 ++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/i915_reg.h +6
-0@@ -61,6 +61,12 @@#define GC_LOW_FREQUENCY_ENABLE (1 << 7)#define GC_DISPLAY_CLOCK_190_200_MHZ (0 << 4)#define GC_DISPLAY_CLOCK_333_MHZ (4 << 4) +#define GC_DISPLAY_CLOCK_267_MHZ_PNV (0 << 4) +#define GC_DISPLAY_CLOCK_333_MHZ_PNV (1 << 4) +#define GC_DISPLAY_CLOCK_444_MHZ_PNV (2 << 4) +#define GC_DISPLAY_CLOCK_200_MHZ_PNV (5 << 4) +#define GC_DISPLAY_CLOCK_133_MHZ_PNV (6 << 4) +#define GC_DISPLAY_CLOCK_167_MHZ_PNV (7 << 4)#define GC_DISPLAY_CLOCK_MASK (7 << 4)#define GM45_GC_RENDER_CLOCK_MASK (0xf << 0)#define GM45_GC_RENDER_CLOCK_266_MHZ (8 << 0)drivers/gpu/drm/i915/intel_display.c +12
-0@@ -4163,6 +4163,30 @@ static int i9xx_misc_get_display_clock_speed(struct drm_device *dev)return 200000 ; } +static int pnv_get_display_clock_speed (struct drm_device *dev) +{ +u16 gcfgc =0 ; + +pci_read_config_word (dev->pdev,GCFGC , &gcfgc); + +switch (gcfgc &GC_DISPLAY_CLOCK_MASK ) { +case GC_DISPLAY_CLOCK_267_MHZ_PNV : +return 267000 ; +case GC_DISPLAY_CLOCK_333_MHZ_PNV : +return 333000 ; +case GC_DISPLAY_CLOCK_444_MHZ_PNV :
Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c static int i9xx_misc_get_display_clock_speed(struct drm_device *dev) · line 4182
Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +5
-0+return 444000 ; +case GC_DISPLAY_CLOCK_200_MHZ_PNV : +return 200000 ; +default : +DRM_ERROR ("Unknown pnv display core clock 0x%04x\n" , gcfgc);Reading the spec, should the default/fallback be 333 MHz for desktop? Otherwise,
As discussed on irc the default case should never happen, but I've simply picked the slowest frequency to be on the safe side and hopefully show something on the screen.
Quoted 1 line
Reviewed-by Jani Nikula <[email protected]>
Queued for -next, thanks for the review.
-Daniel
Quoted 35 lines
Quoted 32 lines
drivers/gpu/drm/i915/intel_display.c +11
-1+case GC_DISPLAY_CLOCK_133_MHZ_PNV : +return 133000 ; +case GC_DISPLAY_CLOCK_167_MHZ_PNV : +return 167000 ; + } +} +static int i915gm_get_display_clock_speed (struct drm_device *dev) {u16 gcfgc =0 ;@@ -9605,9 +9629,12 @@ static void intel_init_display(struct drm_device *dev)else if (IS_I915G (dev)) dev_priv->display.get_display_clock_speed = i915_get_display_clock_speed; -else if (IS_I945GM (dev) ||IS_845G (dev) ||IS_PINEVIEW_M (dev)) +else if (IS_I945GM (dev) ||IS_845G (dev)) dev_priv->display.get_display_clock_speed = i9xx_misc_get_display_clock_speed; +else if (IS_PINEVIEW (dev)) + dev_priv->display.get_display_clock_speed = + pnv_get_display_clock_speed;else if (IS_I915GM (dev)) dev_priv->display.get_display_clock_speed = i915gm_get_display_clock_speed;Signature · 6 lines
1.8.3.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 1 line
Jani Nikula, Intel Open Source Technology Center
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Quoted 5 lines · Daniel Vetter
According to configdb the same register as for gen4 also exists on pnv. Try to use it.
Cc Chris Wilson <[email protected]>Signed-off-by Daniel Vetter <[email protected]>
I think I also remember it dying terminally afterwards (some missing reinit), but it's been long enough that we may fare better today. I'll poke around the next time I boot into a pnv.
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre