diff mbox

[v3,05/21] drm/i915: Get rid of HAS_CORE_RING_FREQ

Message ID 1470768327-14932-6-git-send-email-carlos.santa@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Santa, Carlos Aug. 9, 2016, 6:45 p.m. UTC
No need for HAS_CORE_RING_FREQ as that flag is actually the same as
.has_llc. Feedback from V. Syrjala.

Signed-off-by: Carlos Santa <carlos.santa@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 3 ++-
 drivers/gpu/drm/i915/i915_drv.h     | 4 ----
 2 files changed, 2 insertions(+), 5 deletions(-)

Comments

Chris Wilson Aug. 9, 2016, 6:59 p.m. UTC | #1
On Tue, Aug 09, 2016 at 11:45:11AM -0700, Carlos Santa wrote:
> No need for HAS_CORE_RING_FREQ as that flag is actually the same as
> .has_llc. Feedback from V. Syrjala.
> 
> Signed-off-by: Carlos Santa <carlos.santa@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 3 ++-
>  drivers/gpu/drm/i915/i915_drv.h     | 4 ----
>  2 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 9bd4158..01b6735 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1898,11 +1898,12 @@ static int i915_ring_freq_table(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 = to_i915(dev);
> +	struct intel_device_info *info = mkwrite_device_info(dev_priv);
>  	int ret = 0;
>  	int gpu_freq, ia_freq;
>  	unsigned int max_gpu_freq, min_gpu_freq;
>  
> -	if (!HAS_CORE_RING_FREQ(dev)) {
> +	if (!info->has_llc) {

Why do you need write access?

	if (INTEL_INFO(dev_priv)->has_llc)

or even if (HAS_LLC(dev_priv).
-Chris
Rodrigo Vivi Aug. 15, 2016, 7:50 p.m. UTC | #2
On Tue, Aug 09, 2016 at 07:59:38PM +0100, Chris Wilson wrote:
> On Tue, Aug 09, 2016 at 11:45:11AM -0700, Carlos Santa wrote:
> > No need for HAS_CORE_RING_FREQ as that flag is actually the same as
> > .has_llc. Feedback from V. Syrjala.
> > 
> > Signed-off-by: Carlos Santa <carlos.santa@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_debugfs.c | 3 ++-
> >  drivers/gpu/drm/i915/i915_drv.h     | 4 ----
> >  2 files changed, 2 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> > index 9bd4158..01b6735 100644
> > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > @@ -1898,11 +1898,12 @@ static int i915_ring_freq_table(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 = to_i915(dev);
> > +	struct intel_device_info *info = mkwrite_device_info(dev_priv);
> >  	int ret = 0;
> >  	int gpu_freq, ia_freq;
> >  	unsigned int max_gpu_freq, min_gpu_freq;
> >  
> > -	if (!HAS_CORE_RING_FREQ(dev)) {
> > +	if (!info->has_llc) {
> 
> Why do you need write access?
> 
> 	if (INTEL_INFO(dev_priv)->has_llc)
> 
> or even if (HAS_LLC(dev_priv).

indeed better with HAS_() than with write access.

> -Chris
> 
> -- 
> Chris Wilson, Intel Open Source Technology Centre
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 9bd4158..01b6735 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1898,11 +1898,12 @@  static int i915_ring_freq_table(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 = to_i915(dev);
+	struct intel_device_info *info = mkwrite_device_info(dev_priv);
 	int ret = 0;
 	int gpu_freq, ia_freq;
 	unsigned int max_gpu_freq, min_gpu_freq;
 
-	if (!HAS_CORE_RING_FREQ(dev)) {
+	if (!info->has_llc) {
 		seq_puts(m, "unsupported on this chipset\n");
 		return 0;
 	}
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 0eaf28f..3ab63c0 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2788,10 +2788,6 @@  struct drm_i915_cmd_table {
 #define HAS_RESOURCE_STREAMER(dev) (IS_HASWELL(dev) || \
 				    INTEL_INFO(dev)->gen >= 8)
 
-#define HAS_CORE_RING_FREQ(dev)	(INTEL_INFO(dev)->gen >= 6 && \
-				 !IS_VALLEYVIEW(dev) && !IS_CHERRYVIEW(dev) && \
-				 !IS_BROXTON(dev))
-
 #define HAS_POOLED_EU(dev)	(INTEL_INFO(dev)->has_pooled_eu)
 
 #define INTEL_PCH_DEVICE_ID_MASK		0xff00