[gem] Set write domain to CPU when doing pwrite.

Leave the flush call in place, which can fix domains up if necessary.
main
Keith Packard 2008-05-12 13:01:57 -07:00
parent 6950b7da71
commit 6aeff6b9e3
1 changed files with 7 additions and 7 deletions

View File

@ -276,9 +276,9 @@ drm_gem_pread_ioctl(struct drm_device *dev, void *data,
return -EINVAL; return -EINVAL;
if (dev->driver->gem_set_domain) { if (dev->driver->gem_set_domain) {
ret = dev->driver->gem_set_domain (obj, ret = dev->driver->gem_set_domain(obj,
DRM_GEM_DOMAIN_CPU, DRM_GEM_DOMAIN_CPU,
0); 0);
if (ret) { if (ret) {
drm_gem_object_unreference(obj); drm_gem_object_unreference(obj);
return ret; return ret;
@ -363,9 +363,9 @@ drm_gem_pwrite_ioctl(struct drm_device *dev, void *data,
return -EINVAL; return -EINVAL;
if (dev->driver->gem_set_domain) { if (dev->driver->gem_set_domain) {
ret = dev->driver->gem_set_domain (obj, ret = dev->driver->gem_set_domain(obj,
DRM_GEM_DOMAIN_CPU, DRM_GEM_DOMAIN_CPU,
0); DRM_GEM_DOMAIN_CPU);
if (ret) { if (ret) {
drm_gem_object_unreference(obj); drm_gem_object_unreference(obj);
return ret; return ret;
@ -376,7 +376,7 @@ drm_gem_pwrite_ioctl(struct drm_device *dev, void *data,
written = vfs_write(obj->filp, written = vfs_write(obj->filp,
(char __user *)(uintptr_t) args->data_ptr, (char __user *)(uintptr_t) args->data_ptr,
args->size, &offset); args->size, &offset);
if (written != args->size) { if (written != args->size) {
drm_gem_object_unreference(obj); drm_gem_object_unreference(obj);
if (written < 0) if (written < 0)