diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_overlay.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_overlay.c | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c index b0e17b06eb6e..d7ad5139d17c 100644 --- a/drivers/gpu/drm/i915/intel_overlay.c +++ b/drivers/gpu/drm/i915/intel_overlay.c | |||
@@ -211,9 +211,8 @@ static void intel_overlay_unmap_regs_atomic(struct intel_overlay *overlay) | |||
211 | static int intel_overlay_on(struct intel_overlay *overlay) | 211 | static int intel_overlay_on(struct intel_overlay *overlay) |
212 | { | 212 | { |
213 | struct drm_device *dev = overlay->dev; | 213 | struct drm_device *dev = overlay->dev; |
214 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
215 | int ret; | 214 | int ret; |
216 | RING_LOCALS; | 215 | drm_i915_private_t *dev_priv = dev->dev_private; |
217 | 216 | ||
218 | BUG_ON(overlay->active); | 217 | BUG_ON(overlay->active); |
219 | 218 | ||
@@ -227,11 +226,13 @@ static int intel_overlay_on(struct intel_overlay *overlay) | |||
227 | OUT_RING(MI_NOOP); | 226 | OUT_RING(MI_NOOP); |
228 | ADVANCE_LP_RING(); | 227 | ADVANCE_LP_RING(); |
229 | 228 | ||
230 | overlay->last_flip_req = i915_add_request(dev, NULL, 0); | 229 | overlay->last_flip_req = |
230 | i915_add_request(dev, NULL, 0, &dev_priv->render_ring); | ||
231 | if (overlay->last_flip_req == 0) | 231 | if (overlay->last_flip_req == 0) |
232 | return -ENOMEM; | 232 | return -ENOMEM; |
233 | 233 | ||
234 | ret = i915_do_wait_request(dev, overlay->last_flip_req, 1); | 234 | ret = i915_do_wait_request(dev, |
235 | overlay->last_flip_req, 1, &dev_priv->render_ring); | ||
235 | if (ret != 0) | 236 | if (ret != 0) |
236 | return ret; | 237 | return ret; |
237 | 238 | ||
@@ -248,7 +249,6 @@ static void intel_overlay_continue(struct intel_overlay *overlay, | |||
248 | drm_i915_private_t *dev_priv = dev->dev_private; | 249 | drm_i915_private_t *dev_priv = dev->dev_private; |
249 | u32 flip_addr = overlay->flip_addr; | 250 | u32 flip_addr = overlay->flip_addr; |
250 | u32 tmp; | 251 | u32 tmp; |
251 | RING_LOCALS; | ||
252 | 252 | ||
253 | BUG_ON(!overlay->active); | 253 | BUG_ON(!overlay->active); |
254 | 254 | ||
@@ -265,7 +265,8 @@ static void intel_overlay_continue(struct intel_overlay *overlay, | |||
265 | OUT_RING(flip_addr); | 265 | OUT_RING(flip_addr); |
266 | ADVANCE_LP_RING(); | 266 | ADVANCE_LP_RING(); |
267 | 267 | ||
268 | overlay->last_flip_req = i915_add_request(dev, NULL, 0); | 268 | overlay->last_flip_req = |
269 | i915_add_request(dev, NULL, 0, &dev_priv->render_ring); | ||
269 | } | 270 | } |
270 | 271 | ||
271 | static int intel_overlay_wait_flip(struct intel_overlay *overlay) | 272 | static int intel_overlay_wait_flip(struct intel_overlay *overlay) |
@@ -274,10 +275,10 @@ static int intel_overlay_wait_flip(struct intel_overlay *overlay) | |||
274 | drm_i915_private_t *dev_priv = dev->dev_private; | 275 | drm_i915_private_t *dev_priv = dev->dev_private; |
275 | int ret; | 276 | int ret; |
276 | u32 tmp; | 277 | u32 tmp; |
277 | RING_LOCALS; | ||
278 | 278 | ||
279 | if (overlay->last_flip_req != 0) { | 279 | if (overlay->last_flip_req != 0) { |
280 | ret = i915_do_wait_request(dev, overlay->last_flip_req, 1); | 280 | ret = i915_do_wait_request(dev, overlay->last_flip_req, |
281 | 1, &dev_priv->render_ring); | ||
281 | if (ret == 0) { | 282 | if (ret == 0) { |
282 | overlay->last_flip_req = 0; | 283 | overlay->last_flip_req = 0; |
283 | 284 | ||
@@ -296,11 +297,13 @@ static int intel_overlay_wait_flip(struct intel_overlay *overlay) | |||
296 | OUT_RING(MI_NOOP); | 297 | OUT_RING(MI_NOOP); |
297 | ADVANCE_LP_RING(); | 298 | ADVANCE_LP_RING(); |
298 | 299 | ||
299 | overlay->last_flip_req = i915_add_request(dev, NULL, 0); | 300 | overlay->last_flip_req = |
301 | i915_add_request(dev, NULL, 0, &dev_priv->render_ring); | ||
300 | if (overlay->last_flip_req == 0) | 302 | if (overlay->last_flip_req == 0) |
301 | return -ENOMEM; | 303 | return -ENOMEM; |
302 | 304 | ||
303 | ret = i915_do_wait_request(dev, overlay->last_flip_req, 1); | 305 | ret = i915_do_wait_request(dev, overlay->last_flip_req, |
306 | 1, &dev_priv->render_ring); | ||
304 | if (ret != 0) | 307 | if (ret != 0) |
305 | return ret; | 308 | return ret; |
306 | 309 | ||
@@ -314,9 +317,8 @@ static int intel_overlay_off(struct intel_overlay *overlay) | |||
314 | { | 317 | { |
315 | u32 flip_addr = overlay->flip_addr; | 318 | u32 flip_addr = overlay->flip_addr; |
316 | struct drm_device *dev = overlay->dev; | 319 | struct drm_device *dev = overlay->dev; |
317 | drm_i915_private_t *dev_priv = dev->dev_private; | 320 | drm_i915_private_t *dev_priv = dev->dev_private; |
318 | int ret; | 321 | int ret; |
319 | RING_LOCALS; | ||
320 | 322 | ||
321 | BUG_ON(!overlay->active); | 323 | BUG_ON(!overlay->active); |
322 | 324 | ||
@@ -336,11 +338,13 @@ static int intel_overlay_off(struct intel_overlay *overlay) | |||
336 | OUT_RING(MI_NOOP); | 338 | OUT_RING(MI_NOOP); |
337 | ADVANCE_LP_RING(); | 339 | ADVANCE_LP_RING(); |
338 | 340 | ||
339 | overlay->last_flip_req = i915_add_request(dev, NULL, 0); | 341 | overlay->last_flip_req = |
342 | i915_add_request(dev, NULL, 0, &dev_priv->render_ring); | ||
340 | if (overlay->last_flip_req == 0) | 343 | if (overlay->last_flip_req == 0) |
341 | return -ENOMEM; | 344 | return -ENOMEM; |
342 | 345 | ||
343 | ret = i915_do_wait_request(dev, overlay->last_flip_req, 1); | 346 | ret = i915_do_wait_request(dev, overlay->last_flip_req, |
347 | 1, &dev_priv->render_ring); | ||
344 | if (ret != 0) | 348 | if (ret != 0) |
345 | return ret; | 349 | return ret; |
346 | 350 | ||
@@ -354,11 +358,13 @@ static int intel_overlay_off(struct intel_overlay *overlay) | |||
354 | OUT_RING(MI_NOOP); | 358 | OUT_RING(MI_NOOP); |
355 | ADVANCE_LP_RING(); | 359 | ADVANCE_LP_RING(); |
356 | 360 | ||
357 | overlay->last_flip_req = i915_add_request(dev, NULL, 0); | 361 | overlay->last_flip_req = |
362 | i915_add_request(dev, NULL, 0, &dev_priv->render_ring); | ||
358 | if (overlay->last_flip_req == 0) | 363 | if (overlay->last_flip_req == 0) |
359 | return -ENOMEM; | 364 | return -ENOMEM; |
360 | 365 | ||
361 | ret = i915_do_wait_request(dev, overlay->last_flip_req, 1); | 366 | ret = i915_do_wait_request(dev, overlay->last_flip_req, |
367 | 1, &dev_priv->render_ring); | ||
362 | if (ret != 0) | 368 | if (ret != 0) |
363 | return ret; | 369 | return ret; |
364 | 370 | ||
@@ -390,22 +396,23 @@ int intel_overlay_recover_from_interrupt(struct intel_overlay *overlay, | |||
390 | int interruptible) | 396 | int interruptible) |
391 | { | 397 | { |
392 | struct drm_device *dev = overlay->dev; | 398 | struct drm_device *dev = overlay->dev; |
393 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
394 | struct drm_gem_object *obj; | 399 | struct drm_gem_object *obj; |
400 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
395 | u32 flip_addr; | 401 | u32 flip_addr; |
396 | int ret; | 402 | int ret; |
397 | RING_LOCALS; | ||
398 | 403 | ||
399 | if (overlay->hw_wedged == HW_WEDGED) | 404 | if (overlay->hw_wedged == HW_WEDGED) |
400 | return -EIO; | 405 | return -EIO; |
401 | 406 | ||
402 | if (overlay->last_flip_req == 0) { | 407 | if (overlay->last_flip_req == 0) { |
403 | overlay->last_flip_req = i915_add_request(dev, NULL, 0); | 408 | overlay->last_flip_req = |
409 | i915_add_request(dev, NULL, 0, &dev_priv->render_ring); | ||
404 | if (overlay->last_flip_req == 0) | 410 | if (overlay->last_flip_req == 0) |
405 | return -ENOMEM; | 411 | return -ENOMEM; |
406 | } | 412 | } |
407 | 413 | ||
408 | ret = i915_do_wait_request(dev, overlay->last_flip_req, interruptible); | 414 | ret = i915_do_wait_request(dev, overlay->last_flip_req, |
415 | interruptible, &dev_priv->render_ring); | ||
409 | if (ret != 0) | 416 | if (ret != 0) |
410 | return ret; | 417 | return ret; |
411 | 418 | ||
@@ -429,12 +436,13 @@ int intel_overlay_recover_from_interrupt(struct intel_overlay *overlay, | |||
429 | OUT_RING(MI_NOOP); | 436 | OUT_RING(MI_NOOP); |
430 | ADVANCE_LP_RING(); | 437 | ADVANCE_LP_RING(); |
431 | 438 | ||
432 | overlay->last_flip_req = i915_add_request(dev, NULL, 0); | 439 | overlay->last_flip_req = i915_add_request(dev, NULL, |
440 | 0, &dev_priv->render_ring); | ||
433 | if (overlay->last_flip_req == 0) | 441 | if (overlay->last_flip_req == 0) |
434 | return -ENOMEM; | 442 | return -ENOMEM; |
435 | 443 | ||
436 | ret = i915_do_wait_request(dev, overlay->last_flip_req, | 444 | ret = i915_do_wait_request(dev, overlay->last_flip_req, |
437 | interruptible); | 445 | interruptible, &dev_priv->render_ring); |
438 | if (ret != 0) | 446 | if (ret != 0) |
439 | return ret; | 447 | return ret; |
440 | 448 | ||