From c655913a3bdd7ef6413814482983c3beff00bdc0 Mon Sep 17 00:00:00 2001 From: Kamil Debski Date: Mon, 30 Jun 2014 10:45:25 +0200 Subject: v4l2-mfc-example: Add DRM support Patch adding support for DRM video rendering. Signed-off-by: Kamil Debski --- v4l2-mfc-example/common.h | 49 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) (limited to 'v4l2-mfc-example/common.h') diff --git a/v4l2-mfc-example/common.h b/v4l2-mfc-example/common.h index 3f55283..aff8972 100644 --- a/v4l2-mfc-example/common.h +++ b/v4l2-mfc-example/common.h @@ -36,6 +36,14 @@ /* When DEBUG is defined debug messages are printed on the screen. * Otherwise only error messages are displayed. */ #define DEBUG +/* Remove #define DRM will disable DRM support */ +#define DRM + +#ifdef DRM +#include +#include +#include +#endif #ifdef ADD_DETAILS #define err(msg, ...) \ @@ -76,7 +84,7 @@ #define FIMC_CAP_PLANES 1 /* Maximum number of frame buffers - used for double buffering and * vsyns synchronisation */ -#define FB_MAX_BUFS 2 +#define MAX_BUFS 2 /* The buffer is free to use by MFC */ #define BUF_FREE 0 @@ -96,12 +104,35 @@ struct instance { int offs; } in; + /* DRM related parameters */ + struct { + char *name; + int fd; + + int fb[MAX_BUFS]; + int crtc[MAX_BUFS]; + + int width; + int height; + + char *p[MAX_BUFS]; + + unsigned int conn_id; + unsigned int crtc_id; +#ifdef DRM + struct drm_exynos_gem_create gem[MAX_BUFS]; + struct drm_exynos_gem_mmap mmap[MAX_BUFS]; + drmModeRes *resources; +#endif + char enabled; + + } drm; + /* Frame buffer related parameters */ struct { char *name; int fd; - char *p[FB_MAX_BUFS]; - int cur_buf; + char *p[MAX_BUFS]; int buffers; int width; int height; @@ -111,7 +142,7 @@ struct instance { int stride; int size; int full_size; - int double_buf; + char enabled; } fb; /* FIMC related parameter */ @@ -124,6 +155,16 @@ struct instance { * the MFC thread */ sem_t done; char enabled; + + int cur_buf; + int double_buf; + int size; + int buffers; + int bpp; + int width; + int stride; + int height; + char *p[MAX_BUFS]; } fimc; /* MFC related parameters */ -- cgit v1.2.3