diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-04-26 17:28:05 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-03 05:18:26 -0400 |
commit | 6d90c952cdd20158ec41a5c016c6fad73c9a8749 (patch) | |
tree | 21593af3ce72606e92b1bbb85d4eb453254f0e55 /drivers/gpu/drm/i915/intel_overlay.c | |
parent | 64c43c332156261d72e50e929203de116b1129a7 (diff) |
drm/i915: remove LP_RING&friends from modeset code
The LP refers to 'low priority' as opposed to the high priority
ring on gen2/3. So lets constrain its use to the code of that era.
Unfortunately we can't yet completely remove the associated
macros from common headers and shove them into i915_dma.c to
the other dri1 legacy support code, a few cleanups are still
missing for that.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_overlay.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_overlay.c | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c index e06e46a30757..0bfab0bf60f4 100644 --- a/drivers/gpu/drm/i915/intel_overlay.c +++ b/drivers/gpu/drm/i915/intel_overlay.c | |||
@@ -215,17 +215,18 @@ static int intel_overlay_do_wait_request(struct intel_overlay *overlay, | |||
215 | { | 215 | { |
216 | struct drm_device *dev = overlay->dev; | 216 | struct drm_device *dev = overlay->dev; |
217 | drm_i915_private_t *dev_priv = dev->dev_private; | 217 | drm_i915_private_t *dev_priv = dev->dev_private; |
218 | struct intel_ring_buffer *ring = &dev_priv->ring[RCS]; | ||
218 | int ret; | 219 | int ret; |
219 | 220 | ||
220 | BUG_ON(overlay->last_flip_req); | 221 | BUG_ON(overlay->last_flip_req); |
221 | ret = i915_add_request(LP_RING(dev_priv), NULL, request); | 222 | ret = i915_add_request(ring, NULL, request); |
222 | if (ret) { | 223 | if (ret) { |
223 | kfree(request); | 224 | kfree(request); |
224 | return ret; | 225 | return ret; |
225 | } | 226 | } |
226 | overlay->last_flip_req = request->seqno; | 227 | overlay->last_flip_req = request->seqno; |
227 | overlay->flip_tail = tail; | 228 | overlay->flip_tail = tail; |
228 | ret = i915_wait_request(LP_RING(dev_priv), overlay->last_flip_req); | 229 | ret = i915_wait_request(ring, overlay->last_flip_req); |
229 | if (ret) | 230 | if (ret) |
230 | return ret; | 231 | return ret; |
231 | i915_gem_retire_requests(dev); | 232 | i915_gem_retire_requests(dev); |
@@ -287,6 +288,7 @@ static int intel_overlay_on(struct intel_overlay *overlay) | |||
287 | { | 288 | { |
288 | struct drm_device *dev = overlay->dev; | 289 | struct drm_device *dev = overlay->dev; |
289 | struct drm_i915_private *dev_priv = dev->dev_private; | 290 | struct drm_i915_private *dev_priv = dev->dev_private; |
291 | struct intel_ring_buffer *ring = &dev_priv->ring[RCS]; | ||
290 | struct drm_i915_gem_request *request; | 292 | struct drm_i915_gem_request *request; |
291 | int pipe_a_quirk = 0; | 293 | int pipe_a_quirk = 0; |
292 | int ret; | 294 | int ret; |
@@ -306,17 +308,17 @@ static int intel_overlay_on(struct intel_overlay *overlay) | |||
306 | goto out; | 308 | goto out; |
307 | } | 309 | } |
308 | 310 | ||
309 | ret = BEGIN_LP_RING(4); | 311 | ret = intel_ring_begin(ring, 4); |
310 | if (ret) { | 312 | if (ret) { |
311 | kfree(request); | 313 | kfree(request); |
312 | goto out; | 314 | goto out; |
313 | } | 315 | } |
314 | 316 | ||
315 | OUT_RING(MI_OVERLAY_FLIP | MI_OVERLAY_ON); | 317 | intel_ring_emit(ring, MI_OVERLAY_FLIP | MI_OVERLAY_ON); |
316 | OUT_RING(overlay->flip_addr | OFC_UPDATE); | 318 | intel_ring_emit(ring, overlay->flip_addr | OFC_UPDATE); |
317 | OUT_RING(MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP); | 319 | intel_ring_emit(ring, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP); |
318 | OUT_RING(MI_NOOP); | 320 | intel_ring_emit(ring, MI_NOOP); |
319 | ADVANCE_LP_RING(); | 321 | intel_ring_advance(ring); |
320 | 322 | ||
321 | ret = intel_overlay_do_wait_request(overlay, request, NULL); | 323 | ret = intel_overlay_do_wait_request(overlay, request, NULL); |
322 | out: | 324 | out: |
@@ -332,6 +334,7 @@ static int intel_overlay_continue(struct intel_overlay *overlay, | |||
332 | { | 334 | { |
333 | struct drm_device *dev = overlay->dev; | 335 | struct drm_device *dev = overlay->dev; |
334 | drm_i915_private_t *dev_priv = dev->dev_private; | 336 | drm_i915_private_t *dev_priv = dev->dev_private; |
337 | struct intel_ring_buffer *ring = &dev_priv->ring[RCS]; | ||
335 | struct drm_i915_gem_request *request; | 338 | struct drm_i915_gem_request *request; |
336 | u32 flip_addr = overlay->flip_addr; | 339 | u32 flip_addr = overlay->flip_addr; |
337 | u32 tmp; | 340 | u32 tmp; |
@@ -351,16 +354,16 @@ static int intel_overlay_continue(struct intel_overlay *overlay, | |||
351 | if (tmp & (1 << 17)) | 354 | if (tmp & (1 << 17)) |
352 | DRM_DEBUG("overlay underrun, DOVSTA: %x\n", tmp); | 355 | DRM_DEBUG("overlay underrun, DOVSTA: %x\n", tmp); |
353 | 356 | ||
354 | ret = BEGIN_LP_RING(2); | 357 | ret = intel_ring_begin(ring, 2); |
355 | if (ret) { | 358 | if (ret) { |
356 | kfree(request); | 359 | kfree(request); |
357 | return ret; | 360 | return ret; |
358 | } | 361 | } |
359 | OUT_RING(MI_OVERLAY_FLIP | MI_OVERLAY_CONTINUE); | 362 | intel_ring_emit(ring, MI_OVERLAY_FLIP | MI_OVERLAY_CONTINUE); |
360 | OUT_RING(flip_addr); | 363 | intel_ring_emit(ring, flip_addr); |
361 | ADVANCE_LP_RING(); | 364 | intel_ring_advance(ring); |
362 | 365 | ||
363 | ret = i915_add_request(LP_RING(dev_priv), NULL, request); | 366 | ret = i915_add_request(ring, NULL, request); |
364 | if (ret) { | 367 | if (ret) { |
365 | kfree(request); | 368 | kfree(request); |
366 | return ret; | 369 | return ret; |
@@ -401,6 +404,7 @@ static int intel_overlay_off(struct intel_overlay *overlay) | |||
401 | { | 404 | { |
402 | struct drm_device *dev = overlay->dev; | 405 | struct drm_device *dev = overlay->dev; |
403 | struct drm_i915_private *dev_priv = dev->dev_private; | 406 | struct drm_i915_private *dev_priv = dev->dev_private; |
407 | struct intel_ring_buffer *ring = &dev_priv->ring[RCS]; | ||
404 | u32 flip_addr = overlay->flip_addr; | 408 | u32 flip_addr = overlay->flip_addr; |
405 | struct drm_i915_gem_request *request; | 409 | struct drm_i915_gem_request *request; |
406 | int ret; | 410 | int ret; |
@@ -417,20 +421,20 @@ static int intel_overlay_off(struct intel_overlay *overlay) | |||
417 | * of the hw. Do it in both cases */ | 421 | * of the hw. Do it in both cases */ |
418 | flip_addr |= OFC_UPDATE; | 422 | flip_addr |= OFC_UPDATE; |
419 | 423 | ||
420 | ret = BEGIN_LP_RING(6); | 424 | ret = intel_ring_begin(ring, 6); |
421 | if (ret) { | 425 | if (ret) { |
422 | kfree(request); | 426 | kfree(request); |
423 | return ret; | 427 | return ret; |
424 | } | 428 | } |
425 | /* wait for overlay to go idle */ | 429 | /* wait for overlay to go idle */ |
426 | OUT_RING(MI_OVERLAY_FLIP | MI_OVERLAY_CONTINUE); | 430 | intel_ring_emit(ring, MI_OVERLAY_FLIP | MI_OVERLAY_CONTINUE); |
427 | OUT_RING(flip_addr); | 431 | intel_ring_emit(ring, flip_addr); |
428 | OUT_RING(MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP); | 432 | intel_ring_emit(ring, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP); |
429 | /* turn overlay off */ | 433 | /* turn overlay off */ |
430 | OUT_RING(MI_OVERLAY_FLIP | MI_OVERLAY_OFF); | 434 | intel_ring_emit(ring, MI_OVERLAY_FLIP | MI_OVERLAY_OFF); |
431 | OUT_RING(flip_addr); | 435 | intel_ring_emit(ring, flip_addr); |
432 | OUT_RING(MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP); | 436 | intel_ring_emit(ring, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP); |
433 | ADVANCE_LP_RING(); | 437 | intel_ring_advance(ring); |
434 | 438 | ||
435 | return intel_overlay_do_wait_request(overlay, request, | 439 | return intel_overlay_do_wait_request(overlay, request, |
436 | intel_overlay_off_tail); | 440 | intel_overlay_off_tail); |
@@ -442,12 +446,13 @@ static int intel_overlay_recover_from_interrupt(struct intel_overlay *overlay) | |||
442 | { | 446 | { |
443 | struct drm_device *dev = overlay->dev; | 447 | struct drm_device *dev = overlay->dev; |
444 | drm_i915_private_t *dev_priv = dev->dev_private; | 448 | drm_i915_private_t *dev_priv = dev->dev_private; |
449 | struct intel_ring_buffer *ring = &dev_priv->ring[RCS]; | ||
445 | int ret; | 450 | int ret; |
446 | 451 | ||
447 | if (overlay->last_flip_req == 0) | 452 | if (overlay->last_flip_req == 0) |
448 | return 0; | 453 | return 0; |
449 | 454 | ||
450 | ret = i915_wait_request(LP_RING(dev_priv), overlay->last_flip_req); | 455 | ret = i915_wait_request(ring, overlay->last_flip_req); |
451 | if (ret) | 456 | if (ret) |
452 | return ret; | 457 | return ret; |
453 | i915_gem_retire_requests(dev); | 458 | i915_gem_retire_requests(dev); |
@@ -467,6 +472,7 @@ static int intel_overlay_release_old_vid(struct intel_overlay *overlay) | |||
467 | { | 472 | { |
468 | struct drm_device *dev = overlay->dev; | 473 | struct drm_device *dev = overlay->dev; |
469 | drm_i915_private_t *dev_priv = dev->dev_private; | 474 | drm_i915_private_t *dev_priv = dev->dev_private; |
475 | struct intel_ring_buffer *ring = &dev_priv->ring[RCS]; | ||
470 | int ret; | 476 | int ret; |
471 | 477 | ||
472 | /* Only wait if there is actually an old frame to release to | 478 | /* Only wait if there is actually an old frame to release to |
@@ -483,15 +489,15 @@ static int intel_overlay_release_old_vid(struct intel_overlay *overlay) | |||
483 | if (request == NULL) | 489 | if (request == NULL) |
484 | return -ENOMEM; | 490 | return -ENOMEM; |
485 | 491 | ||
486 | ret = BEGIN_LP_RING(2); | 492 | ret = intel_ring_begin(ring, 2); |
487 | if (ret) { | 493 | if (ret) { |
488 | kfree(request); | 494 | kfree(request); |
489 | return ret; | 495 | return ret; |
490 | } | 496 | } |
491 | 497 | ||
492 | OUT_RING(MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP); | 498 | intel_ring_emit(ring, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP); |
493 | OUT_RING(MI_NOOP); | 499 | intel_ring_emit(ring, MI_NOOP); |
494 | ADVANCE_LP_RING(); | 500 | intel_ring_advance(ring); |
495 | 501 | ||
496 | ret = intel_overlay_do_wait_request(overlay, request, | 502 | ret = intel_overlay_do_wait_request(overlay, request, |
497 | intel_overlay_release_old_vid_tail); | 503 | intel_overlay_release_old_vid_tail); |