aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2009-12-16 15:16:17 -0500
committerEric Anholt <eric@anholt.net>2009-12-16 16:53:02 -0500
commitb295d1b6e3e3f240d27cbe556d33ff5eb54721a7 (patch)
tree09ec44d0977bcf3874b44dfc4eb19f238bce58c4
parentcfdf1fa23f4074c9f8766dc67a928bbf680b1ac9 (diff)
drm/i915: Track whether cursor needs physical address in intel_device_info
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Eric Anholt <eric@anholt.net>
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c8
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c11
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h3
-rw-r--r--drivers/gpu/drm/i915/intel_display.c4
4 files changed, 9 insertions, 17 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 549e46c1a979..28d99b8a0490 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1200,14 +1200,6 @@ static int i915_load_modeset_init(struct drm_device *dev,
1200 dev->mode_config.fb_base = drm_get_resource_start(dev, fb_bar) & 1200 dev->mode_config.fb_base = drm_get_resource_start(dev, fb_bar) &
1201 0xff000000; 1201 0xff000000;
1202 1202
1203 if (IS_MOBILE(dev) || IS_I9XX(dev))
1204 dev_priv->cursor_needs_physical = true;
1205 else
1206 dev_priv->cursor_needs_physical = false;
1207
1208 if (IS_I965G(dev) || IS_G33(dev))
1209 dev_priv->cursor_needs_physical = false;
1210
1211 /* Basic memrange allocator for stolen space (aka vram) */ 1203 /* Basic memrange allocator for stolen space (aka vram) */
1212 drm_mm_init(&dev_priv->vram, 0, prealloc_size); 1204 drm_mm_init(&dev_priv->vram, 0, prealloc_size);
1213 DRM_INFO("set up %ldM of stolen space\n", prealloc_size / (1024*1024)); 1205 DRM_INFO("set up %ldM of stolen space\n", prealloc_size / (1024*1024));
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 1b256de24563..a0a2cad8c016 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -57,7 +57,7 @@ static struct drm_driver driver;
57 .driver_data = (unsigned long) info } 57 .driver_data = (unsigned long) info }
58 58
59const static struct intel_device_info intel_i830_info = { 59const static struct intel_device_info intel_i830_info = {
60 .is_i8xx = 1, .is_mobile = 1, 60 .is_i8xx = 1, .is_mobile = 1, .cursor_needs_physical = 1,
61}; 61};
62 62
63const static struct intel_device_info intel_845g_info = { 63const static struct intel_device_info intel_845g_info = {
@@ -65,7 +65,7 @@ const static struct intel_device_info intel_845g_info = {
65}; 65};
66 66
67const static struct intel_device_info intel_i85x_info = { 67const static struct intel_device_info intel_i85x_info = {
68 .is_i8xx = 1, .is_mobile = 1, 68 .is_i8xx = 1, .is_mobile = 1, .cursor_needs_physical = 1,
69}; 69};
70 70
71const static struct intel_device_info intel_i865g_info = { 71const static struct intel_device_info intel_i865g_info = {
@@ -73,17 +73,18 @@ const static struct intel_device_info intel_i865g_info = {
73}; 73};
74 74
75const static struct intel_device_info intel_i915g_info = { 75const static struct intel_device_info intel_i915g_info = {
76 .is_i915g = 1, .is_i9xx = 1, 76 .is_i915g = 1, .is_i9xx = 1, .cursor_needs_physical = 1,
77}; 77};
78const static struct intel_device_info intel_i915gm_info = { 78const static struct intel_device_info intel_i915gm_info = {
79 .is_i9xx = 1, .is_mobile = 1, .has_fbc = 1, 79 .is_i9xx = 1, .is_mobile = 1, .has_fbc = 1,
80 .cursor_needs_physical = 1,
80}; 81};
81const static struct intel_device_info intel_i945g_info = { 82const static struct intel_device_info intel_i945g_info = {
82 .is_i9xx = 1, .has_hotplug = 1, 83 .is_i9xx = 1, .has_hotplug = 1, .cursor_needs_physical = 1,
83}; 84};
84const static struct intel_device_info intel_i945gm_info = { 85const static struct intel_device_info intel_i945gm_info = {
85 .is_i945gm = 1, .is_i9xx = 1, .is_mobile = 1, .has_fbc = 1, 86 .is_i945gm = 1, .is_i9xx = 1, .is_mobile = 1, .has_fbc = 1,
86 .has_hotplug = 1, 87 .has_hotplug = 1, .cursor_needs_physical = 1,
87}; 88};
88 89
89const static struct intel_device_info intel_i965g_info = { 90const static struct intel_device_info intel_i965g_info = {
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 0d24e034dc23..9a05f1a01025 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -189,6 +189,7 @@ struct intel_device_info {
189 u8 has_rc6 : 1; 189 u8 has_rc6 : 1;
190 u8 has_pipe_cxsr : 1; 190 u8 has_pipe_cxsr : 1;
191 u8 has_hotplug : 1; 191 u8 has_hotplug : 1;
192 u8 cursor_needs_physical : 1;
192}; 193};
193 194
194typedef struct drm_i915_private { 195typedef struct drm_i915_private {
@@ -253,8 +254,6 @@ typedef struct drm_i915_private {
253 int hangcheck_count; 254 int hangcheck_count;
254 uint32_t last_acthd; 255 uint32_t last_acthd;
255 256
256 bool cursor_needs_physical;
257
258 struct drm_mm vram; 257 struct drm_mm vram;
259 258
260 unsigned long cfb_size; 259 unsigned long cfb_size;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 52cd9b006da2..ef9c6139ee31 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3385,7 +3385,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
3385 3385
3386 /* we only need to pin inside GTT if cursor is non-phy */ 3386 /* we only need to pin inside GTT if cursor is non-phy */
3387 mutex_lock(&dev->struct_mutex); 3387 mutex_lock(&dev->struct_mutex);
3388 if (!dev_priv->cursor_needs_physical) { 3388 if (!dev_priv->info->cursor_needs_physical) {
3389 ret = i915_gem_object_pin(bo, PAGE_SIZE); 3389 ret = i915_gem_object_pin(bo, PAGE_SIZE);
3390 if (ret) { 3390 if (ret) {
3391 DRM_ERROR("failed to pin cursor bo\n"); 3391 DRM_ERROR("failed to pin cursor bo\n");
@@ -3420,7 +3420,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
3420 I915_WRITE(base, addr); 3420 I915_WRITE(base, addr);
3421 3421
3422 if (intel_crtc->cursor_bo) { 3422 if (intel_crtc->cursor_bo) {
3423 if (dev_priv->cursor_needs_physical) { 3423 if (dev_priv->info->cursor_needs_physical) {
3424 if (intel_crtc->cursor_bo != bo) 3424 if (intel_crtc->cursor_bo != bo)
3425 i915_gem_detach_phys_object(dev, intel_crtc->cursor_bo); 3425 i915_gem_detach_phys_object(dev, intel_crtc->cursor_bo);
3426 } else 3426 } else