From: Keith Packard Date: Mon, 12 May 2008 20:01:57 +0000 (-0700) Subject: [gem] Set write domain to CPU when doing pwrite. X-Git-Tag: submit/1.0/20121108.012404~757^2~129 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6aeff6b9e32b61beed0d5c3d871968fa6217b79d;p=profile%2Fivi%2Flibdrm.git [gem] Set write domain to CPU when doing pwrite. Leave the flush call in place, which can fix domains up if necessary. --- diff --git a/linux-core/drm_gem.c b/linux-core/drm_gem.c index 14cf7e4..e20cfe0 100644 --- a/linux-core/drm_gem.c +++ b/linux-core/drm_gem.c @@ -276,9 +276,9 @@ drm_gem_pread_ioctl(struct drm_device *dev, void *data, return -EINVAL; if (dev->driver->gem_set_domain) { - ret = dev->driver->gem_set_domain (obj, - DRM_GEM_DOMAIN_CPU, - 0); + ret = dev->driver->gem_set_domain(obj, + DRM_GEM_DOMAIN_CPU, + 0); if (ret) { drm_gem_object_unreference(obj); return ret; @@ -363,9 +363,9 @@ drm_gem_pwrite_ioctl(struct drm_device *dev, void *data, return -EINVAL; if (dev->driver->gem_set_domain) { - ret = dev->driver->gem_set_domain (obj, - DRM_GEM_DOMAIN_CPU, - 0); + ret = dev->driver->gem_set_domain(obj, + DRM_GEM_DOMAIN_CPU, + DRM_GEM_DOMAIN_CPU); if (ret) { drm_gem_object_unreference(obj); return ret; @@ -376,7 +376,7 @@ drm_gem_pwrite_ioctl(struct drm_device *dev, void *data, written = vfs_write(obj->filp, (char __user *)(uintptr_t) args->data_ptr, args->size, &offset); - + if (written != args->size) { drm_gem_object_unreference(obj); if (written < 0)