drm/i915: add a LLC feature flag in device description
authorEugeni Dodonov <eugeni.dodonov@intel.com>
Tue, 17 Jan 2012 16:43:53 +0000 (14:43 -0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 17 Jan 2012 19:01:45 +0000 (20:01 +0100)
LLC is not SNB/IVB-specific, so we should check for it in a more generic
way.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
include/drm/i915_drm.h

index 11807989f918b351d0585e5e4a54b9d87c0a3125..6c3be86274e14f2b3abf2d0d47a1795126031470 100644 (file)
@@ -83,6 +83,7 @@ static int i915_capabilities(struct seq_file *m, void *data)
        B(supports_tv);
        B(has_bsd_ring);
        B(has_blt_ring);
+       B(has_llc);
 #undef B
 
        return 0;
index 2484c8ff0b818400d93a3f4dbc58fce444d4cdf7..8122738db91ec5b6ddf14a0936316e68659c5e5c 100644 (file)
@@ -784,6 +784,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
        case I915_PARAM_HAS_GEN7_SOL_RESET:
                value = 1;
                break;
+       case I915_PARAM_HAS_LLC:
+               value = HAS_LLC(dev);
+               break;
        default:
                DRM_DEBUG_DRIVER("Unknown parameter %d\n",
                                 param->param);
index 7578c08110f711958d32e220cfcafd12eea0e0bf..1658cfd85aa7d5fba882869303ba4dbca24e3c12 100644 (file)
@@ -214,6 +214,7 @@ static const struct intel_device_info intel_sandybridge_d_info = {
        .need_gfx_hws = 1, .has_hotplug = 1,
        .has_bsd_ring = 1,
        .has_blt_ring = 1,
+       .has_llc = 1,
 };
 
 static const struct intel_device_info intel_sandybridge_m_info = {
@@ -222,6 +223,7 @@ static const struct intel_device_info intel_sandybridge_m_info = {
        .has_fbc = 1,
        .has_bsd_ring = 1,
        .has_blt_ring = 1,
+       .has_llc = 1,
 };
 
 static const struct intel_device_info intel_ivybridge_d_info = {
@@ -229,6 +231,7 @@ static const struct intel_device_info intel_ivybridge_d_info = {
        .need_gfx_hws = 1, .has_hotplug = 1,
        .has_bsd_ring = 1,
        .has_blt_ring = 1,
+       .has_llc = 1,
 };
 
 static const struct intel_device_info intel_ivybridge_m_info = {
@@ -237,6 +240,7 @@ static const struct intel_device_info intel_ivybridge_m_info = {
        .has_fbc = 0,   /* FBC is not enabled on Ivybridge mobile yet */
        .has_bsd_ring = 1,
        .has_blt_ring = 1,
+       .has_llc = 1,
 };
 
 static const struct pci_device_id pciidlist[] = {              /* aka */
index 3cb88c3e0568dcb61bd4fc08c2c9ce20cf9a803e..f02a5f525f031486bfe4afc99d13d30e2fd05858 100644 (file)
@@ -255,6 +255,7 @@ struct intel_device_info {
        u8 supports_tv:1;
        u8 has_bsd_ring:1;
        u8 has_blt_ring:1;
+       u8 has_llc:1;
 };
 
 enum no_fbc_reason {
@@ -969,6 +970,7 @@ struct drm_i915_file_private {
 
 #define HAS_BSD(dev)            (INTEL_INFO(dev)->has_bsd_ring)
 #define HAS_BLT(dev)            (INTEL_INFO(dev)->has_blt_ring)
+#define HAS_LLC(dev)            (INTEL_INFO(dev)->has_llc)
 #define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws)
 
 #define HAS_OVERLAY(dev)               (INTEL_INFO(dev)->has_overlay)
index e55badb2d86ddc5d7f245b8e81343a358f5dc43c..eb98a7f55cfe7db8faff215fe36d91afe4be8a34 100644 (file)
@@ -3619,8 +3619,8 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
        obj->base.write_domain = I915_GEM_DOMAIN_CPU;
        obj->base.read_domains = I915_GEM_DOMAIN_CPU;
 
-       if (IS_GEN6(dev) || IS_GEN7(dev)) {
-               /* On Gen6, we can have the GPU use the LLC (the CPU
+       if (HAS_LLC(dev)) {
+               /* On some devices, we can have the GPU use the LLC (the CPU
                 * cache) for about a 10% performance improvement
                 * compared to uncached.  Graphics requests other than
                 * display scanout are coherent with the CPU in
index 924f6a454fed97d9b84dbbbbdfc32751b82759db..da929bb5b7886e3387cd130ab3b0ee5aac2abb71 100644 (file)
@@ -296,6 +296,7 @@ typedef struct drm_i915_irq_wait {
 #define I915_PARAM_HAS_EXEC_CONSTANTS   14
 #define I915_PARAM_HAS_RELAXED_DELTA    15
 #define I915_PARAM_HAS_GEN7_SOL_RESET   16
+#define I915_PARAM_HAS_LLC              17
 
 typedef struct drm_i915_getparam {
        int param;