Skip to content

Commit

Permalink
drm/i915: Track whether cursor needs physical address in intel_device…
Browse files Browse the repository at this point in the history
…_info

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
  • Loading branch information
Kristian Høgsberg authored and Eric Anholt committed Dec 16, 2009
1 parent cfdf1fa commit b295d1b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
8 changes: 0 additions & 8 deletions drivers/gpu/drm/i915/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
11 changes: 6 additions & 5 deletions drivers/gpu/drm/i915/i915_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,33 +57,34 @@ 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 = {
.is_i8xx = 1,
};

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 = {
.is_i8xx = 1,
};

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 = {
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b295d1b

Please sign in to comment.