diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-08-07 06:01:39 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-08-09 14:24:36 -0400 |
commit | 6eeefaf3c86b8937db8ad930c48bfb592fc5e32e (patch) | |
tree | c73c07925f9bc2d23d62271e95fe083a764a3640 /drivers/gpu/drm/i915/i915_gem.c | |
parent | 560b85bb750c3c539641993dd508b61260c9e874 (diff) |
drm/i915: Apply i830 errata for cursor alignment
i830 requires 32bpp cursors to be aligned to 16KB, so we have to expose
the alignment parameter to i915_gem_attach_phys_object().
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 41306217bd7a..b4b25e17d4e9 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -4674,7 +4674,7 @@ i915_gem_load(struct drm_device *dev) | |||
4674 | * e.g. for cursor + overlay regs | 4674 | * e.g. for cursor + overlay regs |
4675 | */ | 4675 | */ |
4676 | int i915_gem_init_phys_object(struct drm_device *dev, | 4676 | int i915_gem_init_phys_object(struct drm_device *dev, |
4677 | int id, int size) | 4677 | int id, int size, int align) |
4678 | { | 4678 | { |
4679 | drm_i915_private_t *dev_priv = dev->dev_private; | 4679 | drm_i915_private_t *dev_priv = dev->dev_private; |
4680 | struct drm_i915_gem_phys_object *phys_obj; | 4680 | struct drm_i915_gem_phys_object *phys_obj; |
@@ -4689,7 +4689,7 @@ int i915_gem_init_phys_object(struct drm_device *dev, | |||
4689 | 4689 | ||
4690 | phys_obj->id = id; | 4690 | phys_obj->id = id; |
4691 | 4691 | ||
4692 | phys_obj->handle = drm_pci_alloc(dev, size, 0); | 4692 | phys_obj->handle = drm_pci_alloc(dev, size, align); |
4693 | if (!phys_obj->handle) { | 4693 | if (!phys_obj->handle) { |
4694 | ret = -ENOMEM; | 4694 | ret = -ENOMEM; |
4695 | goto kfree_obj; | 4695 | goto kfree_obj; |
@@ -4771,7 +4771,9 @@ out: | |||
4771 | 4771 | ||
4772 | int | 4772 | int |
4773 | i915_gem_attach_phys_object(struct drm_device *dev, | 4773 | i915_gem_attach_phys_object(struct drm_device *dev, |
4774 | struct drm_gem_object *obj, int id) | 4774 | struct drm_gem_object *obj, |
4775 | int id, | ||
4776 | int align) | ||
4775 | { | 4777 | { |
4776 | drm_i915_private_t *dev_priv = dev->dev_private; | 4778 | drm_i915_private_t *dev_priv = dev->dev_private; |
4777 | struct drm_i915_gem_object *obj_priv; | 4779 | struct drm_i915_gem_object *obj_priv; |
@@ -4790,11 +4792,10 @@ i915_gem_attach_phys_object(struct drm_device *dev, | |||
4790 | i915_gem_detach_phys_object(dev, obj); | 4792 | i915_gem_detach_phys_object(dev, obj); |
4791 | } | 4793 | } |
4792 | 4794 | ||
4793 | |||
4794 | /* create a new object */ | 4795 | /* create a new object */ |
4795 | if (!dev_priv->mm.phys_objs[id - 1]) { | 4796 | if (!dev_priv->mm.phys_objs[id - 1]) { |
4796 | ret = i915_gem_init_phys_object(dev, id, | 4797 | ret = i915_gem_init_phys_object(dev, id, |
4797 | obj->size); | 4798 | obj->size, align); |
4798 | if (ret) { | 4799 | if (ret) { |
4799 | DRM_ERROR("failed to init phys object %d size: %zu\n", id, obj->size); | 4800 | DRM_ERROR("failed to init phys object %d size: %zu\n", id, obj->size); |
4800 | goto out; | 4801 | goto out; |