media: vsp1: drm: Extend frame completion API to the DU driver
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Thu, 21 Feb 2019 01:38:06 +0000 (03:38 +0200)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Mon, 18 Mar 2019 15:24:09 +0000 (17:24 +0200)
The VSP1 driver will need to pass extra flags to the DU through the
frame completion API. Replace the completed bool flag by a bitmask to
support this.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/gpu/drm/rcar-du/rcar_du_vsp.c
drivers/media/platform/vsp1/vsp1_dl.h
drivers/media/platform/vsp1/vsp1_drm.c
drivers/media/platform/vsp1/vsp1_drm.h
include/media/vsp1.h

index 0878acc..d4aaad1 100644 (file)
 #include "rcar_du_kms.h"
 #include "rcar_du_vsp.h"
 
-static void rcar_du_vsp_complete(void *private, bool completed, u32 crc)
+static void rcar_du_vsp_complete(void *private, unsigned int status, u32 crc)
 {
        struct rcar_du_crtc *crtc = private;
 
        if (crtc->vblank_enable)
                drm_crtc_handle_vblank(&crtc->crtc);
 
-       if (completed)
+       if (status & VSP1_DU_STATUS_COMPLETE)
                rcar_du_crtc_finish_page_flip(crtc);
 
        drm_crtc_add_crc_entry(&crtc->crtc, false, 0, &crc);
index e0fdb14..079ba5a 100644 (file)
@@ -17,6 +17,7 @@ struct vsp1_dl_body_pool;
 struct vsp1_dl_list;
 struct vsp1_dl_manager;
 
+/* Keep these flags in sync with VSP1_DU_STATUS_* in include/media/vsp1.h. */
 #define VSP1_DL_FRAME_END_COMPLETED            BIT(0)
 #define VSP1_DL_FRAME_END_INTERNAL             BIT(1)
 
index d1c88e8..bd95683 100644 (file)
@@ -34,14 +34,14 @@ static void vsp1_du_pipeline_frame_end(struct vsp1_pipeline *pipe,
                                       unsigned int completion)
 {
        struct vsp1_drm_pipeline *drm_pipe = to_vsp1_drm_pipeline(pipe);
-       bool complete = completion & VSP1_DL_FRAME_END_COMPLETED;
 
        if (drm_pipe->du_complete) {
                struct vsp1_entity *uif = drm_pipe->uif;
+               unsigned int status = completion & VSP1_DU_STATUS_COMPLETE;
                u32 crc;
 
                crc = uif ? vsp1_uif_get_crc(to_uif(&uif->subdev)) : 0;
-               drm_pipe->du_complete(drm_pipe->du_private, complete, crc);
+               drm_pipe->du_complete(drm_pipe->du_private, status, crc);
        }
 
        if (completion & VSP1_DL_FRAME_END_INTERNAL) {
index 8dfd274..e85ad43 100644 (file)
@@ -42,7 +42,7 @@ struct vsp1_drm_pipeline {
        struct vsp1_du_crc_config crc;
 
        /* Frame synchronisation */
-       void (*du_complete)(void *data, bool completed, u32 crc);
+       void (*du_complete)(void *data, unsigned int status, u32 crc);
        void *du_private;
 };
 
index 1cf8683..8774969 100644 (file)
@@ -17,6 +17,8 @@ struct device;
 
 int vsp1_du_init(struct device *dev);
 
+#define VSP1_DU_STATUS_COMPLETE                BIT(0)
+
 /**
  * struct vsp1_du_lif_config - VSP LIF configuration
  * @width: output frame width
@@ -32,7 +34,7 @@ struct vsp1_du_lif_config {
        unsigned int height;
        bool interlaced;
 
-       void (*callback)(void *data, bool completed, u32 crc);
+       void (*callback)(void *data, unsigned int status, u32 crc);
        void *callback_data;
 };