Lines Matching refs:reg
52 static void i915_gem_write_fence(struct drm_device *dev, int reg,
1409 struct drm_i915_fence_reg *reg;
1411 reg = &dev_priv->fence_regs[obj->fence_reg];
1412 list_move_tail(®->lru_list, &dev_priv->mm.fence_list, (caddr_t)reg);
1765 struct drm_i915_fence_reg *reg = &dev_priv->fence_regs[i];
1771 if (reg->obj) {
1772 i915_gem_object_update_fence(reg->obj, reg,
1773 reg->obj->tiling_mode);
2115 /* release the fence reg _after_ flushing */
2162 static void i965_write_fence_reg(struct drm_device *dev, int reg,
2177 fence_reg += reg * 8;
2214 static void i915_write_fence_reg(struct drm_device *dev, int reg,
2249 if (reg < 8)
2250 reg = FENCE_REG_830_0 + reg * 4;
2252 reg = FENCE_REG_945_8 + (reg - 8) * 4;
2254 I915_WRITE(reg, val);
2255 POSTING_READ(reg);
2258 static void i830_write_fence_reg(struct drm_device *dev, int reg,
2286 I915_WRITE(FENCE_REG_830_0 + reg * 4, val);
2287 POSTING_READ(FENCE_REG_830_0 + reg * 4);
2295 static void i915_gem_write_fence(struct drm_device *dev, int reg,
2303 if (i915_gem_object_needs_mb(dev_priv->fence_regs[reg].obj))
2314 case 4: i965_write_fence_reg(dev, reg, obj); break;
2315 case 3: i915_write_fence_reg(dev, reg, obj); break;
2316 case 2: i830_write_fence_reg(dev, reg, obj); break;
2338 int reg = fence_number(dev_priv, fence);
2340 i915_gem_write_fence(obj->base.dev, reg, enable ? obj : NULL);
2343 obj->fence_reg = reg;
2395 struct drm_i915_fence_reg *reg, *avail;
2398 /* First try to find a free reg */
2401 reg = &dev_priv->fence_regs[i];
2402 if (!reg->obj)
2403 return reg;
2405 if (!reg->pin_count)
2406 avail = reg;
2413 list_for_each_entry(reg, struct drm_i915_fence_reg, &dev_priv->mm.fence_list, lru_list) {
2414 if (reg->pin_count)
2417 return reg;
2424 * i915_gem_object_get_fence_reg - set up a fence reg for an object
2425 * @obj: object to map through a fence reg
2432 * It then sets up the reg based on the object's properties: address, pitch
2443 struct drm_i915_fence_reg *reg;
2457 reg = &dev_priv->fence_regs[obj->fence_reg];
2459 list_move_tail(®->lru_list,
2460 &dev_priv->mm.fence_list, (caddr_t)reg);
2464 reg = i915_find_fence_reg(dev);
2465 if (reg == NULL)
2468 if (reg->obj) {
2469 struct drm_i915_gem_object *old = reg->obj;
2480 i915_gem_object_update_fence(obj, reg, enable);