A bit of debug info for DMC/CSR
Subsystems (2)
cover A bit of debug info for DMC/CSR
We're flying a bit blind, so add some debug information about the DMC firmware.
# cat /sys/kernel/debug/dri/0/i915_dmc_info status: loaded version: 1.18 DC5 allowed: no DC6 allowed: yes DC9 allowed: no DC3 -> DC5 count: 0 DC5 -> DC6 count: 0
Signature · 25 lines
Damien Damien Lespiau (6): drm/i915/skl: Print the DMC firmware status in debugfs drm/i915/skl: Store and print the DMC firmware version we load drm/i915/skl: Expose DC5/DC6 entry counts drm/i915/skl: Embed the CSR lock into its own structure drm/i915/skl: Print out if we allow DC5/DC6 in debugfs drm/i915/bxt: Print out if we allow DC9 in debugfs drivers/gpu/drm/i915/i915_debugfs.c | 42 +++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_dma.c | 1 - drivers/gpu/drm/i915/i915_drv.h | 11 ++++++--- drivers/gpu/drm/i915/i915_reg.h | 4 ++++ drivers/gpu/drm/i915/intel_csr.c | 22 +++++++++++------ drivers/gpu/drm/i915/intel_runtime_pm.c | 30 +++++++++++++++++++++++ 6 files changed, 99 insertions(+), 11 deletions(-) -- 2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/6 drm/i915/skl: Print the DMC firmware status in debugfs
Create a new debufs file for it, we'll have a few more things to add there.
--- drivers/gpu/drm/i915/i915_debugfs.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +22 -0
@@ -2598,6 +2598,27 @@ static int i915_power_domain_info(struct seq_file *m, void *unused)return 0 ; } +static int i915_dmc_info (struct seq_file *m,void *unused) +{ + +struct drm_info_node *node = m->private; +struct drm_device *dev = node->minor->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +static const char *csr_state_str[] = {"unknown" ,"loaded" ,"error" }; +enum csr_state csr_state; + + +if (!HAS_CSR (dev)) { +seq_puts (m,"not supported\n" ); +return 0 ; + } + + csr_state =intel_csr_load_status_get (dev_priv); +seq_printf (m,"status: %s\n" , csr_state_str[csr_state]); + +return 0 ; +} +static void intel_seq_print_mode (struct seq_file *m,int tabs,struct drm_display_mode *mode) {
@@ -5068,6 +5089,7 @@ static const struct drm_info_list i915_debugfs_list[] = { {"i915_energy_uJ", i915_energy_uJ, 0}, {"i915_runtime_pm_status", i915_runtime_pm_status, 0}, {"i915_power_domain_info", i915_power_domain_info, 0}, + {"i915_dmc_info", i915_dmc_info, 0}, {"i915_display_info", i915_display_info, 0}, {"i915_semaphore_status", i915_semaphore_status, 0}, {"i915_shared_dplls_info", i915_shared_dplls_info, 0},
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 1/6] drm/i915/skl: Print the DMC firmware status in debugfs
Quoted 22 lines · Damien Lespiau
Create a new debufs file for it, we'll have a few more things to add there.
Signed-off-by Damien Lespiau <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)drivers/gpu/drm/i915/i915_debugfs.c +6
-0@@ -2598,6 +2598,27 @@ static int i915_power_domain_info(struct seq_file *m, void *unused)return 0 ; } +static int i915_dmc_info (struct seq_file *m,void *unused) +{ + +struct drm_info_node *node = m->private; +struct drm_device *dev = node->minor->dev; +struct drm_i915_private *dev_priv = dev->dev_private;
drivers/gpu/drm/i915/i915_debugfs.c static int i915_power_domain_info(struct seq_file *m, void *unused) · line 2616
Quoted 10 lines
drivers/gpu/drm/i915/i915_debugfs.c +10
-0+static const char *csr_state_str[] = {"unknown" ,"loaded" ,"error" }; +enum csr_state csr_state; + + +if (!HAS_CSR (dev)) { +seq_puts (m,"not supported\n" ); +return 0 ; + } + + csr_state =intel_csr_load_status_get (dev_priv);
This will disappear after the dmc loader rework.
-Daniel
Quoted 23 lines
drivers/gpu/drm/i915/i915_debugfs.c +6
-0+seq_printf (m,"status: %s\n" , csr_state_str[csr_state]); + +return 0 ; +} +static void intel_seq_print_mode (struct seq_file *m,int tabs,struct drm_display_mode *mode) {@@ -5068,6 +5089,7 @@ static const struct drm_info_list i915_debugfs_list[] = { {"i915_energy_uJ", i915_energy_uJ, 0}, {"i915_runtime_pm_status", i915_runtime_pm_status, 0}, {"i915_power_domain_info", i915_power_domain_info, 0}, + {"i915_dmc_info", i915_dmc_info, 0}, {"i915_display_info", i915_display_info, 0}, {"i915_semaphore_status", i915_semaphore_status, 0}, {"i915_shared_dplls_info", i915_shared_dplls_info, 0},Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 1/6] drm/i915/skl: Print the DMC firmware status in debugfs
Quoted 27 lines · Daniel Vetter
Quoted 26 lines · Damien Lespiau
Create a new debufs file for it, we'll have a few more things to add there.
Signed-off-by Damien Lespiau <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)drivers/gpu/drm/i915/i915_debugfs.c +10
-0@@ -2598,6 +2598,27 @@ static int i915_power_domain_info(struct seq_file *m, void *unused)return 0 ; } +static int i915_dmc_info (struct seq_file *m,void *unused) +{ + +struct drm_info_node *node = m->private; +struct drm_device *dev = node->minor->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +static const char *csr_state_str[] = {"unknown" ,"loaded" ,"error" }; +enum csr_state csr_state; + +
Quoted 8 lines
drivers/gpu/drm/i915/i915_debugfs.c static int i915_power_domain_info(struct seq_file *m, void *unused) · line 2616
Quoted 6 lines
drivers/gpu/drm/i915/i915_debugfs.c +6
-0+if (!HAS_CSR (dev)) { +seq_puts (m,"not supported\n" ); +return 0 ; + } + + csr_state =intel_csr_load_status_get (dev_priv);This will disappear after the dmc loader rework.
Are you suggesting that we shouldn't touch that code until someone reworks it? (seems fairly unbounded to me).
Signature · 5 lines
Damien _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/6 drm/i915/skl: Store and print the DMC firmware version we load
In reply to Damien LespiauThat can be handy later on to tell which DMC firmware version the user has, by just looking at the dmesg or a debugfs file.
--- drivers/gpu/drm/i915/i915_debugfs.c | 7 +++++++ drivers/gpu/drm/i915/i915_drv.h | 5 +++++ drivers/gpu/drm/i915/intel_csr.c | 8 +++++++- 3 files changed, 19 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_debugfs.c +7 -0
@@ -2604,6 +2604,7 @@ static int i915_dmc_info(struct seq_file *m, void *unused)struct drm_info_node *node = m->private;struct drm_device *dev = node->minor->dev;struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_csr *csr = &dev_priv->csr;static const char *csr_state_str[] = {"unknown" ,"loaded" ,"error" };enum csr_state csr_state;
@@ -2616,6 +2617,12 @@ static int i915_dmc_info(struct seq_file *m, void *unused) csr_state =intel_csr_load_status_get (dev_priv);seq_printf (m,"status: %s\n" , csr_state_str[csr_state]); +if (csr_state !=FW_LOADED ) +return 0 ; + +seq_printf (m,"version: %d.%d\n" ,CSR_VERSION_MAJOR (csr->version), +CSR_VERSION_MINOR (csr->version)); +return 0 ; }
drivers/gpu/drm/i915/i915_drv.h +5 -0
@@ -730,6 +730,10 @@ struct intel_uncore {#define for_each_fw_domain (domain__, dev_priv__, i__) \ for_each_fw_domain_mask(domain__, FORCEWAKE_ALL, dev_priv__, i__) +#define CSR_VERSION (major, minor) ((major) << 16 | (minor)) +#define CSR_VERSION_MAJOR (version) ((version) >> 16) +#define CSR_VERSION_MINOR (version) ((version) & 0xffff) +enum csr_state {FW_UNINITIALIZED =0 ,FW_LOADED ,
@@ -740,6 +744,7 @@ struct intel_csr {const char *fw_path;__be32 *dmc_payload;uint32_t dmc_fw_size; +uint32_t version;uint32_t mmio_count;uint32_t mmioaddr[8 ];uint32_t mmiodata[8 ];
drivers/gpu/drm/i915/intel_csr.c +7 -1
@@ -300,6 +300,9 @@ static void finish_csr_load(const struct firmware *fw, void *context) (css_header->header_len * 4)); goto out; } + + csr->version = css_header->version; + readcount +=sizeof (struct intel_css_header );/* Extract Package Header information*/
@@ -389,7 +392,10 @@ static void finish_csr_load(const struct firmware *fw, void *context)intel_csr_load_program (dev); fw_loaded = true; -DRM_DEBUG_KMS ("Finished loading %s\n" , dev_priv->csr.fw_path); +DRM_DEBUG_KMS ("Finished loading %s (v%d.%d)\n" , dev_priv->csr.fw_path, +CSR_VERSION_MAJOR (csr->version), +CSR_VERSION_MINOR (csr->version)); + out:if (fw_loaded)intel_runtime_pm_put (dev_priv);
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/6 drm/i915/skl: Expose DC5/DC6 entry counts
In reply to Damien LespiauThe CSR firmware expose two counters, handy to check if we are indeed entering DC5/DC6.
--- drivers/gpu/drm/i915/i915_debugfs.c | 7 +++++++ drivers/gpu/drm/i915/i915_reg.h | 4 ++++ 2 files changed, 11 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +7 -0
@@ -2623,6 +2623,13 @@ static int i915_dmc_info(struct seq_file *m, void *unused)seq_printf (m,"version: %d.%d\n" ,CSR_VERSION_MAJOR (csr->version),CSR_VERSION_MINOR (csr->version)); +if (IS_SKYLAKE (dev) && csr->version >=CSR_VERSION (1 ,6 )) { +seq_printf (m,"DC3 -> DC5 count: %d\n" , +I915_READ (SKL_CSR_DC3_DC5_COUNT )); +seq_printf (m,"DC5 -> DC6 count: %d\n" , +I915_READ (SKL_CSR_DC5_DC6_COUNT )); + } +return 0 ; }
drivers/gpu/drm/i915/i915_reg.h +4 -0
@@ -5552,6 +5552,10 @@ enum skl_disp_power_wells {#define GAMMA_MODE_MODE_12BIT (2 << 0)#define GAMMA_MODE_MODE_SPLIT (3 << 0) +/* DMC/CSR */ +#define SKL_CSR_DC3_DC5_COUNT 0x80030 +#define SKL_CSR_DC5_DC6_COUNT 0x8002C +/* interrupts */ #define DE_MASTER_IRQ_CONTROL (1 << 31)#define DE_SPRITEB_FLIP_DONE (1 << 29)
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/6 drm/i915/skl: Embed the CSR lock into its own structure
In reply to Damien LespiauWhen we have a well defined structure, it's customary to put the lock protecting its fields inside.
--- drivers/gpu/drm/i915/i915_dma.c | 1 - drivers/gpu/drm/i915/i915_drv.h | 5 ++--- drivers/gpu/drm/i915/intel_csr.c | 14 ++++++++------ 3 files changed, 10 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/i915_dma.c +0 -1
@@ -820,7 +820,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)spin_lock_init (&dev_priv->mmio_flip_lock);mutex_init (&dev_priv->sb_lock);mutex_init (&dev_priv->modeset_restore_lock); -mutex_init (&dev_priv->csr_lock);intel_pm_setup (dev);
drivers/gpu/drm/i915/i915_drv.h +2 -3
@@ -741,6 +741,8 @@ enum csr_state { };struct intel_csr { +struct mutex lock; +const char *fw_path;__be32 *dmc_payload;uint32_t dmc_fw_size;
@@ -1689,9 +1691,6 @@ struct drm_i915_private {struct intel_csr csr; -/* Display CSR-related protection */ -struct mutex csr_lock; -struct intel_gmbus gmbus[GMBUS_NUM_PINS ];/** gmbus_mutex protects against concurrent usage of the single hw gmbus
drivers/gpu/drm/i915/intel_csr.c +8 -6
@@ -211,9 +211,9 @@ enum csr_state intel_csr_load_status_get(struct drm_i915_private *dev_priv) {enum csr_state state; -mutex_lock (&dev_priv->csr_lock); +mutex_lock (&dev_priv->csr.lock); state = dev_priv->csr.state; -mutex_unlock (&dev_priv->csr_lock); +mutex_unlock (&dev_priv->csr.lock);return state; }
@@ -228,9 +228,9 @@ enum csr_state intel_csr_load_status_get(struct drm_i915_private *dev_priv)void intel_csr_load_status_set (struct drm_i915_private *dev_priv,enum csr_state state) { -mutex_lock (&dev_priv->csr_lock); +mutex_lock (&dev_priv->csr.lock); dev_priv->csr.state = state; -mutex_unlock (&dev_priv->csr_lock); +mutex_unlock (&dev_priv->csr.lock); }/**
@@ -252,7 +252,7 @@ void intel_csr_load_program(struct drm_device *dev)return ; } -mutex_lock (&dev_priv->csr_lock); +mutex_lock (&dev_priv->csr.lock); fw_size = dev_priv->csr.dmc_fw_size;for (i =0 ; i < fw_size; i++) I915_WRITE(CSR_PROGRAM_BASE + i * 4,
@@ -264,7 +264,7 @@ void intel_csr_load_program(struct drm_device *dev) } dev_priv->csr.state =FW_LOADED ; -mutex_unlock (&dev_priv->csr_lock); +mutex_unlock (&dev_priv->csr.lock); }static void finish_csr_load (const struct firmware *fw,void *context)
@@ -429,6 +429,8 @@ void intel_csr_ucode_init(struct drm_device *dev)return ; } +mutex_init (&dev_priv->csr.lock); +DRM_DEBUG_KMS ("Loading %s\n" , csr->fw_path);/*
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 4/6] drm/i915/skl: Embed the CSR lock into its own structure
Quoted 27 lines · Damien Lespiau
When we have a well defined structure, it's customary to put the lock protecting its fields inside.
Signed-off-by Damien Lespiau <[email protected]>--- drivers/gpu/drm/i915/i915_dma.c | 1 - drivers/gpu/drm/i915/i915_drv.h | 5 ++--- drivers/gpu/drm/i915/intel_csr.c | 14 ++++++++------ 3 files changed, 10 insertions(+), 10 deletions(-)drivers/gpu/drm/i915/i915_dma.c +0
-1@@ -820,7 +820,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)spin_lock_init (&dev_priv->mmio_flip_lock);mutex_init (&dev_priv->sb_lock);mutex_init (&dev_priv->modeset_restore_lock); -mutex_init (&dev_priv->csr_lock);intel_pm_setup (dev);drivers/gpu/drm/i915/i915_drv.h +0
-0
drivers/gpu/drm/i915/i915_drv.h enum csr_state { · line 744
Quoted 4 lines
drivers/gpu/drm/i915/i915_drv.h +1
-0@@ -741,6 +741,8 @@ enum csr_state { };struct intel_csr { +struct mutex lock;
There wont be a lock left after the dmc loader rework. -Daniel
Quoted 76 lines
drivers/gpu/drm/i915/i915_drv.h +1
-3+const char *fw_path;__be32 *dmc_payload;uint32_t dmc_fw_size;@@ -1689,9 +1691,6 @@ struct drm_i915_private {struct intel_csr csr; -/* Display CSR-related protection */ -struct mutex csr_lock; -struct intel_gmbus gmbus[GMBUS_NUM_PINS ];/** gmbus_mutex protects against concurrent usage of the single hw gmbus drivers/gpu/drm/i915/intel_csr.c +8
-6@@ -211,9 +211,9 @@ enum csr_state intel_csr_load_status_get(struct drm_i915_private *dev_priv) {enum csr_state state; -mutex_lock (&dev_priv->csr_lock); +mutex_lock (&dev_priv->csr.lock); state = dev_priv->csr.state; -mutex_unlock (&dev_priv->csr_lock); +mutex_unlock (&dev_priv->csr.lock);return state; }@@ -228,9 +228,9 @@ enum csr_state intel_csr_load_status_get(struct drm_i915_private *dev_priv)void intel_csr_load_status_set (struct drm_i915_private *dev_priv,enum csr_state state) { -mutex_lock (&dev_priv->csr_lock); +mutex_lock (&dev_priv->csr.lock); dev_priv->csr.state = state; -mutex_unlock (&dev_priv->csr_lock); +mutex_unlock (&dev_priv->csr.lock); }/** @@ -252,7 +252,7 @@ void intel_csr_load_program(struct drm_device *dev)return ; } -mutex_lock (&dev_priv->csr_lock); +mutex_lock (&dev_priv->csr.lock); fw_size = dev_priv->csr.dmc_fw_size;for (i =0 ; i < fw_size; i++) I915_WRITE(CSR_PROGRAM_BASE + i * 4,@@ -264,7 +264,7 @@ void intel_csr_load_program(struct drm_device *dev) } dev_priv->csr.state =FW_LOADED ; -mutex_unlock (&dev_priv->csr_lock); +mutex_unlock (&dev_priv->csr.lock); }static void finish_csr_load (const struct firmware *fw,void *context)@@ -429,6 +429,8 @@ void intel_csr_ucode_init(struct drm_device *dev)return ; } +mutex_init (&dev_priv->csr.lock); +DRM_DEBUG_KMS ("Loading %s\n" , csr->fw_path);/* Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/6 drm/i915/skl: Print out if we allow DC5/DC6 in debugfs
In reply to Damien LespiauInstead of following the traces, it's easier to just look at a debugfs file to figure out if the driver is allowing the CSR to go into DC states.
We cache that information into the CSR structure as we don't want to read registers in D3 (for instance).
--- drivers/gpu/drm/i915/i915_debugfs.c | 5 +++++ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_runtime_pm.c | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +5 -0
@@ -2623,6 +2623,11 @@ static int i915_dmc_info(struct seq_file *m, void *unused)seq_printf (m,"version: %d.%d\n" ,CSR_VERSION_MAJOR (csr->version),CSR_VERSION_MINOR (csr->version)); +mutex_lock (&csr->lock); +seq_printf (m,"DC5 allowed: %s\n" ,yesno (csr->dc5_allowed)); +seq_printf (m,"DC6 allowed: %s\n" ,yesno (csr->dc6_allowed)); +mutex_unlock (&csr->lock); +if (IS_SKYLAKE (dev) && csr->version >=CSR_VERSION (1 ,6 )) {seq_printf (m,"DC3 -> DC5 count: %d\n" ,I915_READ (SKL_CSR_DC3_DC5_COUNT ));
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -751,6 +751,7 @@ struct intel_csr {uint32_t mmioaddr[8 ];uint32_t mmiodata[8 ];enum csr_state state; +bool dc5_allowed, dc6_allowed; };#define DEV_INFO_FOR_EACH_FLAG (func, sep) \
drivers/gpu/drm/i915/intel_runtime_pm.c +20 -0
@@ -491,6 +491,7 @@ static void assert_can_disable_dc5(struct drm_i915_private *dev_priv)static void gen9_enable_dc5 (struct drm_i915_private *dev_priv) { +struct intel_csr *csr = &dev_priv->csr;uint32_t val;assert_can_enable_dc5 (dev_priv);
@@ -504,10 +505,15 @@ static void gen9_enable_dc5(struct drm_i915_private *dev_priv) val |=DC_STATE_EN_UPTO_DC5 ;I915_WRITE (DC_STATE_EN , val);POSTING_READ (DC_STATE_EN ); + +mutex_lock (&csr->lock); + csr->dc5_allowed = true; +mutex_unlock (&csr->lock); }static void gen9_disable_dc5 (struct drm_i915_private *dev_priv) { +struct intel_csr *csr = &dev_priv->csr;uint32_t val;assert_can_disable_dc5 (dev_priv);
@@ -518,6 +524,10 @@ static void gen9_disable_dc5(struct drm_i915_private *dev_priv) val &= ~DC_STATE_EN_UPTO_DC5 ;I915_WRITE (DC_STATE_EN , val);POSTING_READ (DC_STATE_EN ); + +mutex_lock (&csr->lock); + csr->dc5_allowed = false; +mutex_unlock (&csr->lock); }static void assert_can_enable_dc6 (struct drm_i915_private *dev_priv)
@@ -550,6 +560,7 @@ static void assert_can_disable_dc6(struct drm_i915_private *dev_priv)static void skl_enable_dc6 (struct drm_i915_private *dev_priv) { +struct intel_csr *csr = &dev_priv->csr;uint32_t val;assert_can_enable_dc6 (dev_priv);
@@ -563,10 +574,15 @@ static void skl_enable_dc6(struct drm_i915_private *dev_priv) val |=DC_STATE_EN_UPTO_DC6 ;I915_WRITE (DC_STATE_EN , val);POSTING_READ (DC_STATE_EN ); + +mutex_lock (&csr->lock); + csr->dc6_allowed = true; +mutex_unlock (&csr->lock); }static void skl_disable_dc6 (struct drm_i915_private *dev_priv) { +struct intel_csr *csr = &dev_priv->csr;uint32_t val;if (intel_csr_load_status_get (dev_priv) !=FW_LOADED )
@@ -580,6 +596,10 @@ static void skl_disable_dc6(struct drm_i915_private *dev_priv) val &= ~DC_STATE_EN_UPTO_DC6 ;I915_WRITE (DC_STATE_EN , val);POSTING_READ (DC_STATE_EN ); + +mutex_lock (&csr->lock); + csr->dc6_allowed = false; +mutex_unlock (&csr->lock); } static void skl_set_power_well(struct drm_i915_private *dev_priv,
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/6 drm/i915/bxt: Print out if we allow DC9 in debugfs
In reply to Damien LespiauJust like the DC5/DC6 states on SKL, but this time for BXT's DC9.
--- drivers/gpu/drm/i915/i915_debugfs.c | 1 + drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/intel_runtime_pm.c | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_debugfs.c +1 -0
@@ -2626,6 +2626,7 @@ static int i915_dmc_info(struct seq_file *m, void *unused)mutex_lock (&csr->lock);seq_printf (m,"DC5 allowed: %s\n" ,yesno (csr->dc5_allowed));seq_printf (m,"DC6 allowed: %s\n" ,yesno (csr->dc6_allowed)); +seq_printf (m,"DC9 allowed: %s\n" ,yesno (csr->dc9_allowed));mutex_unlock (&csr->lock);if (IS_SKYLAKE (dev) && csr->version >=CSR_VERSION (1 ,6 )) {
drivers/gpu/drm/i915/i915_drv.h +1 -1
@@ -751,7 +751,7 @@ struct intel_csr {uint32_t mmioaddr[8 ];uint32_t mmiodata[8 ];enum csr_state state; -bool dc5_allowed, dc6_allowed; +bool dc5_allowed, dc6_allowed, dc9_allowed; };#define DEV_INFO_FOR_EACH_FLAG (func, sep) \
drivers/gpu/drm/i915/intel_runtime_pm.c +10 -0
@@ -415,6 +415,7 @@ static void assert_can_disable_dc9(struct drm_i915_private *dev_priv)void bxt_enable_dc9 (struct drm_i915_private *dev_priv) { +struct intel_csr *csr = &dev_priv->csr;uint32_t val;assert_can_enable_dc9 (dev_priv);
@@ -425,10 +426,15 @@ void bxt_enable_dc9(struct drm_i915_private *dev_priv) val |=DC_STATE_EN_DC9 ;I915_WRITE (DC_STATE_EN , val);POSTING_READ (DC_STATE_EN ); + +mutex_lock (&csr->lock); + csr->dc9_allowed = true; +mutex_unlock (&csr->lock); }void bxt_disable_dc9 (struct drm_i915_private *dev_priv) { +struct intel_csr *csr = &dev_priv->csr;uint32_t val;assert_can_disable_dc9 (dev_priv);
@@ -439,6 +445,10 @@ void bxt_disable_dc9(struct drm_i915_private *dev_priv) val &= ~DC_STATE_EN_DC9 ;I915_WRITE (DC_STATE_EN , val);POSTING_READ (DC_STATE_EN ); + +mutex_lock (&csr->lock); + csr->dc9_allowed = false; +mutex_unlock (&csr->lock); } static void gen9_set_dc_state_debugmask_memory_up(
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx