Skip to contentSkip to conversation

drm/radeon: rework page flip handling v4

PATCH New Alex Deucher 1 participant 1 message Jun 3, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: rework page flip handling v4

From: Christian König <[email protected]>

Instead of trying to flip inside the vblank period when the buffer is idle, offload blocking for idle to a kernel thread and program the flip directly into the hardware.

v2: add error handling, fix EBUSY handling
v3: add proper exclusive_lock handling
v4: update crtc->primary->fb when the flip actually happens

---
 drivers/gpu/drm/radeon/radeon.h         |  16 ++-
 drivers/gpu/drm/radeon/radeon_display.c | 239 ++++++++++++++++++--------------
 drivers/gpu/drm/radeon/radeon_mode.h    |   4 +-
 3 files changed, 147 insertions(+), 112 deletions(-)
drivers/gpu/drm/radeon/radeon.h +9 -7
index 2eaa330..dd4da88 100644
@@ -676,14 +676,16 @@ void radeon_doorbell_free(struct radeon_device *rdev, u32 doorbell);
  * IRQS.
  */
 
-struct radeon_unpin_work {
-	struct work_struct work;
-	struct radeon_device *rdev;
-	int crtc_id;
-	struct radeon_fence *fence;
+struct radeon_flip_work {
+	struct work_struct		flip_work;
+	struct work_struct		unpin_work;
+	struct radeon_device		*rdev;
+	int				crtc_id;
+	struct drm_framebuffer		*fb;
 	struct drm_pending_vblank_event *event;
-	struct radeon_bo *old_rbo;
-	u64 new_crtc_base;
+	struct radeon_bo		*old_rbo;
+	struct radeon_bo		*new_rbo;
+	struct radeon_fence		*fence;
 };
 
 struct r500_irq_stat_regs {
drivers/gpu/drm/radeon/radeon_display.c +136 -103

339 lines not on this page · raw message

drivers/gpu/drm/radeon/radeon_mode.h +2 -2
index 718be1a..ea72ad8 100644
@@ -325,8 +325,8 @@ struct radeon_crtc {
 	struct drm_display_mode native_mode;
 	int pll_id;
 	/* page flipping */
-	struct radeon_unpin_work *unpin_work;
-	int deferred_flip_completion;
+	struct workqueue_struct *flip_queue;
+	struct radeon_flip_work *flip_work;
 	/* pll sharing */
 	struct radeon_atom_ss ss;
 	bool ss_enabled;
Signature · 6 lines
1.8.3.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel