Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293563
b: refs/heads/master
c: 5c0480f
h: refs/heads/master
i:
  293561: 4d70c29
  293559: f0e53e1
v: v3
  • Loading branch information
Daniel Vetter committed Jan 30, 2012
1 parent a45c76b commit f3f6620
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ea16a3cdb9218a2389fafc804356c1914c157654
refs/heads/master: 5c0480f21f9896c443b0e65d779c8e09a695da7b
33 changes: 21 additions & 12 deletions trunk/drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,10 +996,13 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
* pread/pwrite currently are reading and writing from the CPU
* perspective, requiring manual detiling by the client.
*/
if (obj->phys_obj)
if (obj->phys_obj) {
ret = i915_gem_phys_pwrite(dev, obj, args, file);
else if (obj->gtt_space &&
obj->base.write_domain != I915_GEM_DOMAIN_CPU) {
goto out;
}

if (obj->gtt_space &&
obj->base.write_domain != I915_GEM_DOMAIN_CPU) {
ret = i915_gem_object_pin(obj, 0, true);
if (ret)
goto out;
Expand All @@ -1018,18 +1021,24 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,

out_unpin:
i915_gem_object_unpin(obj);
} else {
ret = i915_gem_object_set_to_cpu_domain(obj, 1);
if (ret)
goto out;

ret = -EFAULT;
if (!i915_gem_object_needs_bit17_swizzle(obj))
ret = i915_gem_shmem_pwrite_fast(dev, obj, args, file);
if (ret == -EFAULT)
ret = i915_gem_shmem_pwrite_slow(dev, obj, args, file);
if (ret != -EFAULT)
goto out;
/* Fall through to the shmfs paths because the gtt paths might
* fail with non-page-backed user pointers (e.g. gtt mappings
* when moving data between textures). */
}

ret = i915_gem_object_set_to_cpu_domain(obj, 1);
if (ret)
goto out;

ret = -EFAULT;
if (!i915_gem_object_needs_bit17_swizzle(obj))
ret = i915_gem_shmem_pwrite_fast(dev, obj, args, file);
if (ret == -EFAULT)
ret = i915_gem_shmem_pwrite_slow(dev, obj, args, file);

out:
drm_gem_object_unreference(&obj->base);
unlock:
Expand Down

0 comments on commit f3f6620

Please sign in to comment.