drm/i915: Track whether cursor needs physical address in intel_device_info
authorKristian Høgsberg <krh@bitplanet.net>
Wed, 16 Dec 2009 20:16:17 +0000 (15:16 -0500)
committerEric Anholt <eric@anholt.net>
Wed, 16 Dec 2009 21:53:02 +0000 (13:53 -0800)
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
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/intel_display.c

index 549e46c..28d99b8 100644 (file)
@@ -1200,14 +1200,6 @@ static int i915_load_modeset_init(struct drm_device *dev,
        dev->mode_config.fb_base = drm_get_resource_start(dev, fb_bar) &
                0xff000000;
 
-       if (IS_MOBILE(dev) || IS_I9XX(dev))
-               dev_priv->cursor_needs_physical = true;
-       else
-               dev_priv->cursor_needs_physical = false;
-
-       if (IS_I965G(dev) || IS_G33(dev))
-               dev_priv->cursor_needs_physical = false;
-
        /* Basic memrange allocator for stolen space (aka vram) */
        drm_mm_init(&dev_priv->vram, 0, prealloc_size);
        DRM_INFO("set up %ldM of stolen space\n", prealloc_size / (1024*1024));
index 1b256de..a0a2cad 100644 (file)
@@ -57,7 +57,7 @@ static struct drm_driver driver;
        .driver_data = (unsigned long) info }
 
 const static struct intel_device_info intel_i830_info = {
-       .is_i8xx = 1, .is_mobile = 1,
+       .is_i8xx = 1, .is_mobile = 1, .cursor_needs_physical = 1,
 };
 
 const static struct intel_device_info intel_845g_info = {
@@ -65,7 +65,7 @@ const static struct intel_device_info intel_845g_info = {
 };
 
 const static struct intel_device_info intel_i85x_info = {
-       .is_i8xx = 1, .is_mobile = 1,
+       .is_i8xx = 1, .is_mobile = 1, .cursor_needs_physical = 1,
 };
 
 const static struct intel_device_info intel_i865g_info = {
@@ -73,17 +73,18 @@ const static struct intel_device_info intel_i865g_info = {
 };
 
 const static struct intel_device_info intel_i915g_info = {
-       .is_i915g = 1, .is_i9xx = 1,
+       .is_i915g = 1, .is_i9xx = 1, .cursor_needs_physical = 1,
 };
 const static struct intel_device_info intel_i915gm_info = {
        .is_i9xx = 1,  .is_mobile = 1, .has_fbc = 1,
+       .cursor_needs_physical = 1,
 };
 const static struct intel_device_info intel_i945g_info = {
-       .is_i9xx = 1, .has_hotplug = 1,
+       .is_i9xx = 1, .has_hotplug = 1, .cursor_needs_physical = 1,
 };
 const static struct intel_device_info intel_i945gm_info = {
        .is_i945gm = 1, .is_i9xx = 1, .is_mobile = 1, .has_fbc = 1,
-       .has_hotplug = 1,
+       .has_hotplug = 1, .cursor_needs_physical = 1,
 };
 
 const static struct intel_device_info intel_i965g_info = {
index 0d24e03..9a05f1a 100644 (file)
@@ -189,6 +189,7 @@ struct intel_device_info {
        u8 has_rc6 : 1;
        u8 has_pipe_cxsr : 1;
        u8 has_hotplug : 1;
+       u8 cursor_needs_physical : 1;
 };
 
 typedef struct drm_i915_private {
@@ -253,8 +254,6 @@ typedef struct drm_i915_private {
        int hangcheck_count;
        uint32_t last_acthd;
 
-       bool cursor_needs_physical;
-
        struct drm_mm vram;
 
        unsigned long cfb_size;
index 52cd9b0..ef9c613 100644 (file)
@@ -3385,7 +3385,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
 
        /* we only need to pin inside GTT if cursor is non-phy */
        mutex_lock(&dev->struct_mutex);
-       if (!dev_priv->cursor_needs_physical) {
+       if (!dev_priv->info->cursor_needs_physical) {
                ret = i915_gem_object_pin(bo, PAGE_SIZE);
                if (ret) {
                        DRM_ERROR("failed to pin cursor bo\n");
@@ -3420,7 +3420,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
        I915_WRITE(base, addr);
 
        if (intel_crtc->cursor_bo) {
-               if (dev_priv->cursor_needs_physical) {
+               if (dev_priv->info->cursor_needs_physical) {
                        if (intel_crtc->cursor_bo != bo)
                                i915_gem_detach_phys_object(dev, intel_crtc->cursor_bo);
                } else