OSDN Git Service

drm: hopefully fix cursors on 965
authorDave Airlie <airlied@panoply-rh.(none)>
Tue, 11 Mar 2008 01:49:27 +0000 (11:49 +1000)
committerDave Airlie <airlied@panoply-rh.(none)>
Tue, 11 Mar 2008 03:23:33 +0000 (13:23 +1000)
linux-core/intel_display.c
linux-core/intel_drv.h
shared-core/i915_drv.h
shared-core/i915_init.c

index 4b48a0b..fa2b9be 100644 (file)
@@ -1007,7 +1007,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
        uint32_t control = (pipe == 0) ? CURSOR_A_CONTROL : CURSOR_B_CONTROL;
        uint32_t base = (pipe == 0) ? CURSOR_A_BASE : CURSOR_B_BASE;
        uint32_t temp;
-       size_t adder;
+       size_t addr;
 
        DRM_DEBUG("\n");
 
@@ -1039,17 +1039,21 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
                return -ENOMEM;
        }
 
-       adder = dev_priv->stolen_base + bo->offset;
-       intel_crtc->cursor_adder = adder;
+       if (dev_priv->cursor_needs_physical)
+               addr = dev_priv->stolen_base + bo->offset;
+       else
+               addr = bo->offset;
+
+       intel_crtc->cursor_addr = addr;
        temp = 0;
        /* set the pipe for the cursor */
        temp |= (pipe << 28);
        temp |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE;
 
-       DRM_DEBUG("cusror base %x\n", adder);
+       DRM_DEBUG("cusror base %x\n", addr);
 
        I915_WRITE(control, temp);
-       I915_WRITE(base, adder);
+       I915_WRITE(base, addr);
 
        return 0;
 }
@@ -1075,7 +1079,7 @@ static int intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
        temp |= ((x & CURSOR_POS_MASK) << CURSOR_X_SHIFT);
        temp |= ((y & CURSOR_POS_MASK) << CURSOR_Y_SHIFT);
 
-       adder = intel_crtc->cursor_adder;
+       adder = intel_crtc->cursor_addr;
        I915_WRITE((pipe == 0) ? CURSOR_A_POSITION : CURSOR_B_POSITION, temp);
        I915_WRITE((pipe == 0) ? CURSOR_A_BASE : CURSOR_B_BASE, adder);
 
@@ -1241,7 +1245,7 @@ void intel_crtc_init(struct drm_device *dev, int pipe)
                intel_crtc->lut_b[i] = i;
        }
 
-       intel_crtc->cursor_adder = 0;
+       intel_crtc->cursor_addr = 0;
 
        crtc->driver_private = intel_crtc;
 }
index 72ba01d..a36fd3f 100644 (file)
@@ -56,7 +56,7 @@ struct intel_output {
 struct intel_crtc {
        int pipe;
        int plane;
-       uint32_t cursor_adder;
+       uint32_t cursor_addr;
        u8 lut_r[256], lut_g[256], lut_b[256];
 };
 
index f6c0005..b8dfbc3 100644 (file)
@@ -139,9 +139,10 @@ struct drm_i915_private {
        int fence_irq_on;
        uint32_t irq_enable_reg;
        int irq_enabled;
-
        struct workqueue_struct *wq;
 
+       bool cursor_needs_physical;
+
 #ifdef I915_HAVE_FENCE
        uint32_t flush_sequence;
        uint32_t flush_flags;
index 3d8a1dc..274322e 100644 (file)
@@ -130,6 +130,14 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
        dev->types[8] = _DRM_STAT_SECONDARY;
        dev->types[9] = _DRM_STAT_DMA;
 
+       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;
+
        if (IS_I9XX(dev)) {
                pci_read_config_dword(dev->pdev, 0x5C, &dev_priv->stolen_base);
                DRM_DEBUG("stolen base %p\n", (void*)dev_priv->stolen_base);