Rev 3031 | Rev 3480 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3031 | Rev 3243 | ||
---|---|---|---|
Line 146... | Line 146... | ||
146 | { |
146 | { |
147 | struct drm_i915_private *dev_priv = dev->dev_private; |
147 | struct drm_i915_private *dev_priv = dev->dev_private; |
148 | struct i915_hw_context *ctx; |
148 | struct i915_hw_context *ctx; |
149 | int ret, id; |
149 | int ret, id; |
Line 150... | Line 150... | ||
150 | 150 | ||
151 | ctx = kzalloc(sizeof(struct drm_i915_file_private), GFP_KERNEL); |
151 | ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); |
152 | if (ctx == NULL) |
152 | if (ctx == NULL) |
Line 153... | Line 153... | ||
153 | return ERR_PTR(-ENOMEM); |
153 | return ERR_PTR(-ENOMEM); |
154 | 154 | ||
Line 418... | Line 418... | ||
418 | * the next context has already started running. In fact, the below code |
418 | * the next context has already started running. In fact, the below code |
419 | * is a bit suboptimal because the retiring can occur simply after the |
419 | * is a bit suboptimal because the retiring can occur simply after the |
420 | * MI_SET_CONTEXT instead of when the next seqno has completed. |
420 | * MI_SET_CONTEXT instead of when the next seqno has completed. |
421 | */ |
421 | */ |
422 | if (from_obj != NULL) { |
422 | if (from_obj != NULL) { |
423 | u32 seqno = i915_gem_next_request_seqno(ring); |
- | |
424 | from_obj->base.read_domains = I915_GEM_DOMAIN_INSTRUCTION; |
423 | from_obj->base.read_domains = I915_GEM_DOMAIN_INSTRUCTION; |
425 | i915_gem_object_move_to_active(from_obj, ring, seqno); |
424 | i915_gem_object_move_to_active(from_obj, ring); |
426 | /* As long as MI_SET_CONTEXT is serializing, ie. it flushes the |
425 | /* As long as MI_SET_CONTEXT is serializing, ie. it flushes the |
427 | * whole damn pipeline, we don't need to explicitly mark the |
426 | * whole damn pipeline, we don't need to explicitly mark the |
428 | * object dirty. The only exception is that the context must be |
427 | * object dirty. The only exception is that the context must be |
429 | * correct in case the object gets swapped out. Ideally we'd be |
428 | * correct in case the object gets swapped out. Ideally we'd be |
430 | * able to defer doing this until we know the object would be |
429 | * able to defer doing this until we know the object would be |