Rev 2340 | Rev 2344 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2340 | Rev 2342 | ||
---|---|---|---|
Line 244... | Line 244... | ||
244 | struct drm_i915_gem_object *obj; |
244 | struct drm_i915_gem_object *obj; |
245 | int ret; |
245 | int ret; |
246 | u32 handle; |
246 | u32 handle; |
Line 247... | Line 247... | ||
247 | 247 | ||
- | 248 | size = roundup(size, PAGE_SIZE); |
|
- | 249 | if (size == 0) |
|
Line 248... | Line 250... | ||
248 | size = roundup(size, PAGE_SIZE); |
250 | return -EINVAL; |
249 | 251 | ||
250 | /* Allocate the new object */ |
252 | /* Allocate the new object */ |
251 | obj = i915_gem_alloc_object(dev, size); |
253 | obj = i915_gem_alloc_object(dev, size); |
Line 1563... | Line -... | ||
1563 | - | ||
1564 | - | ||
1565 | - | ||
1566 | - | ||
1567 | - | ||
1568 | - | ||
1569 | - | ||
1570 | 1565 | ||
1571 | 1566 | ||
1572 | 1567 | ||
1573 | 1568 | ||
1574 | 1569 | ||
Line 1591... | Line 1586... | ||
1591 | i915_gem_info_add_obj(dev_priv, size); |
1586 | i915_gem_info_add_obj(dev_priv, size); |
Line 1592... | Line 1587... | ||
1592 | 1587 | ||
1593 | obj->base.write_domain = I915_GEM_DOMAIN_CPU; |
1588 | obj->base.write_domain = I915_GEM_DOMAIN_CPU; |
Line 1594... | Line 1589... | ||
1594 | obj->base.read_domains = I915_GEM_DOMAIN_CPU; |
1589 | obj->base.read_domains = I915_GEM_DOMAIN_CPU; |
1595 | 1590 | ||
1596 | if (IS_GEN6(dev)) { |
1591 | if (IS_GEN6(dev) || IS_GEN7(dev)) { |
1597 | /* On Gen6, we can have the GPU use the LLC (the CPU |
1592 | /* On Gen6, we can have the GPU use the LLC (the CPU |
1598 | * cache) for about a 10% performance improvement |
1593 | * cache) for about a 10% performance improvement |
1599 | * compared to uncached. Graphics requests other than |
1594 | * compared to uncached. Graphics requests other than |
Line 1785... | Line 1780... | ||
1785 | INIT_LIST_HEAD(&dev_priv->mm.fence_list); |
1780 | INIT_LIST_HEAD(&dev_priv->mm.fence_list); |
1786 | INIT_LIST_HEAD(&dev_priv->mm.deferred_free_list); |
1781 | INIT_LIST_HEAD(&dev_priv->mm.deferred_free_list); |
1787 | INIT_LIST_HEAD(&dev_priv->mm.gtt_list); |
1782 | INIT_LIST_HEAD(&dev_priv->mm.gtt_list); |
1788 | for (i = 0; i < I915_NUM_RINGS; i++) |
1783 | for (i = 0; i < I915_NUM_RINGS; i++) |
1789 | init_ring_lists(&dev_priv->ring[i]); |
1784 | init_ring_lists(&dev_priv->ring[i]); |
1790 | for (i = 0; i < 16; i++) |
1785 | for (i = 0; i < I915_MAX_NUM_FENCES; i++) |
1791 | INIT_LIST_HEAD(&dev_priv->fence_regs[i].lru_list); |
1786 | INIT_LIST_HEAD(&dev_priv->fence_regs[i].lru_list); |
1792 | // INIT_DELAYED_WORK(&dev_priv->mm.retire_work, |
1787 | // INIT_DELAYED_WORK(&dev_priv->mm.retire_work, |
1793 | // i915_gem_retire_work_handler); |
1788 | // i915_gem_retire_work_handler); |
1794 | // init_completion(&dev_priv->error_completion); |
1789 | // init_completion(&dev_priv->error_completion); |