Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: vsp1: drm: Extend frame completion API to the DU driver

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>

+9 -6
+2 -2
drivers/gpu/drm/rcar-du/rcar_du_vsp.c
··· 27 27 #include "rcar_du_kms.h" 28 28 #include "rcar_du_vsp.h" 29 29 30 - static void rcar_du_vsp_complete(void *private, bool completed, u32 crc) 30 + static void rcar_du_vsp_complete(void *private, unsigned int status, u32 crc) 31 31 { 32 32 struct rcar_du_crtc *crtc = private; 33 33 34 34 if (crtc->vblank_enable) 35 35 drm_crtc_handle_vblank(&crtc->crtc); 36 36 37 - if (completed) 37 + if (status & VSP1_DU_STATUS_COMPLETE) 38 38 rcar_du_crtc_finish_page_flip(crtc); 39 39 40 40 drm_crtc_add_crc_entry(&crtc->crtc, false, 0, &crc);
+1
drivers/media/platform/vsp1/vsp1_dl.h
··· 17 17 struct vsp1_dl_list; 18 18 struct vsp1_dl_manager; 19 19 20 + /* Keep these flags in sync with VSP1_DU_STATUS_* in include/media/vsp1.h. */ 20 21 #define VSP1_DL_FRAME_END_COMPLETED BIT(0) 21 22 #define VSP1_DL_FRAME_END_INTERNAL BIT(1) 22 23
+2 -2
drivers/media/platform/vsp1/vsp1_drm.c
··· 34 34 unsigned int completion) 35 35 { 36 36 struct vsp1_drm_pipeline *drm_pipe = to_vsp1_drm_pipeline(pipe); 37 - bool complete = completion & VSP1_DL_FRAME_END_COMPLETED; 38 37 39 38 if (drm_pipe->du_complete) { 40 39 struct vsp1_entity *uif = drm_pipe->uif; 40 + unsigned int status = completion & VSP1_DU_STATUS_COMPLETE; 41 41 u32 crc; 42 42 43 43 crc = uif ? vsp1_uif_get_crc(to_uif(&uif->subdev)) : 0; 44 - drm_pipe->du_complete(drm_pipe->du_private, complete, crc); 44 + drm_pipe->du_complete(drm_pipe->du_private, status, crc); 45 45 } 46 46 47 47 if (completion & VSP1_DL_FRAME_END_INTERNAL) {
+1 -1
drivers/media/platform/vsp1/vsp1_drm.h
··· 42 42 struct vsp1_du_crc_config crc; 43 43 44 44 /* Frame synchronisation */ 45 - void (*du_complete)(void *data, bool completed, u32 crc); 45 + void (*du_complete)(void *data, unsigned int status, u32 crc); 46 46 void *du_private; 47 47 }; 48 48
+3 -1
include/media/vsp1.h
··· 17 17 18 18 int vsp1_du_init(struct device *dev); 19 19 20 + #define VSP1_DU_STATUS_COMPLETE BIT(0) 21 + 20 22 /** 21 23 * struct vsp1_du_lif_config - VSP LIF configuration 22 24 * @width: output frame width ··· 34 32 unsigned int height; 35 33 bool interlaced; 36 34 37 - void (*callback)(void *data, bool completed, u32 crc); 35 + void (*callback)(void *data, unsigned int status, u32 crc); 38 36 void *callback_data; 39 37 }; 40 38