mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
drm/i915: Add intel_ring_cachline_align()
intel_ring_cachline_align() emits MI_NOOPs until the ring tail is aligned to a cacheline boundary. Cc: Bjoern C <[email protected]> Cc: Alexandru DAMIAN <[email protected]> Cc: Enrico Tagliavini <[email protected]> Suggested-by: Chris Wilson <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Cc: [email protected] (prereq for the next patch) Signed-off-by: Daniel Vetter <[email protected]>
This commit is contained in:
parent
1d2cb9a54a
commit
753b1ad4a2
2 changed files with 22 additions and 0 deletions
|
|
@ -1653,6 +1653,27 @@ int intel_ring_begin(struct intel_ring_buffer *ring,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Align the ring tail to a cacheline boundary */
|
||||
int intel_ring_cacheline_align(struct intel_ring_buffer *ring)
|
||||
{
|
||||
int num_dwords = (64 - (ring->tail & 63)) / sizeof(uint32_t);
|
||||
int ret;
|
||||
|
||||
if (num_dwords == 0)
|
||||
return 0;
|
||||
|
||||
ret = intel_ring_begin(ring, num_dwords);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
while (num_dwords--)
|
||||
intel_ring_emit(ring, MI_NOOP);
|
||||
|
||||
intel_ring_advance(ring);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void intel_ring_init_seqno(struct intel_ring_buffer *ring, u32 seqno)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = ring->dev->dev_private;
|
||||
|
|
|
|||
|
|
@ -233,6 +233,7 @@ intel_write_status_page(struct intel_ring_buffer *ring,
|
|||
void intel_cleanup_ring_buffer(struct intel_ring_buffer *ring);
|
||||
|
||||
int __must_check intel_ring_begin(struct intel_ring_buffer *ring, int n);
|
||||
int __must_check intel_ring_cacheline_align(struct intel_ring_buffer *ring);
|
||||
static inline void intel_ring_emit(struct intel_ring_buffer *ring,
|
||||
u32 data)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue