if (work)
armada_drm_crtc_complete_frame_work(dcrtc, work);
- wake_up(&dcrtc->frame_wait);
+ wake_up(&drm_to_armada_plane(dcrtc->crtc.primary)->frame_wait);
}
}
adj->crtc_vtotal, tm, bm);
/* Wait for pending flips to complete */
- wait_event(dcrtc->frame_wait, !dcrtc->frame_work);
+ wait_event(drm_to_armada_plane(dcrtc->crtc.primary)->frame_wait,
+ !dcrtc->frame_work);
drm_crtc_vblank_off(crtc);
armada_reg_queue_end(regs, i);
/* Wait for pending flips to complete */
- wait_event(dcrtc->frame_wait, !dcrtc->frame_work);
+ wait_event(drm_to_armada_plane(dcrtc->crtc.primary)->frame_wait,
+ !dcrtc->frame_work);
/* Take a reference to the new fb as we're using it */
drm_framebuffer_reference(crtc->primary->fb);
.destroy = drm_primary_helper_destroy,
};
+int armada_drm_plane_init(struct armada_plane *plane)
+{
+ init_waitqueue_head(&plane->frame_wait);
+
+ return 0;
+}
+
static struct drm_prop_enum_list armada_drm_csc_yuv_enum_list[] = {
{ CSC_AUTO, "Auto" },
{ CSC_YUV_CCIR601, "CCIR601" },
spin_lock_init(&dcrtc->irq_lock);
dcrtc->irq_ena = CLEAN_SPU_IRQ_ISR;
INIT_LIST_HEAD(&dcrtc->vbl_list);
- init_waitqueue_head(&dcrtc->frame_wait);
/* Initialize some registers which we don't otherwise set */
writel_relaxed(0x00000001, dcrtc->base + LCD_CFG_SCLK_DIV);
if (!primary)
return -ENOMEM;
+ ret = armada_drm_plane_init(primary);
+ if (ret) {
+ kfree(primary);
+ return ret;
+ }
+
ret = drm_universal_plane_init(drm, &primary->base, 0,
&armada_primary_plane_funcs,
armada_primary_formats,
struct armada_plane {
struct drm_plane base;
+ wait_queue_head_t frame_wait;
};
#define drm_to_armada_plane(p) container_of(p, struct armada_plane, base)
+int armada_drm_plane_init(struct armada_plane *plane);
+
struct armada_crtc {
struct drm_crtc crtc;
const struct armada_variant *variant;
uint32_t dumb_ctrl;
uint32_t spu_iopad_ctrl;
- wait_queue_head_t frame_wait;
struct armada_frame_work *frame_work;
spinlock_t irq_lock;
struct {
struct armada_vbl_event update;
struct armada_regs regs[13];
- wait_queue_head_t wait;
} vbl;
struct armada_ovl_plane_properties prop;
};
armada_drm_crtc_update_regs(dcrtc, dplane->vbl.regs);
armada_ovl_retire_fb(dplane, NULL);
- wake_up(&dplane->vbl.wait);
+ wake_up(&dplane->base.frame_wait);
}
static int
dcrtc->base + LCD_SPU_SRAM_PARA1);
}
- wait_event_timeout(dplane->vbl.wait,
+ wait_event_timeout(dplane->base.frame_wait,
list_empty(&dplane->vbl.update.node),
HZ/25);
if (!dplane)
return -ENOMEM;
- init_waitqueue_head(&dplane->vbl.wait);
+ ret = armada_drm_plane_init(&dplane->base);
+ if (ret) {
+ kfree(dplane);
+ return ret;
+ }
+
armada_drm_vbl_event_init(&dplane->vbl.update, armada_ovl_plane_vbl,
dplane);