summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/video/fbdev/msm/mdss_compat_utils.c2
-rw-r--r--drivers/video/fbdev/msm/mdss_compat_utils.h1
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_overlay.c31
-rw-r--r--include/uapi/linux/msm_mdp.h19
4 files changed, 46 insertions, 7 deletions
diff --git a/drivers/video/fbdev/msm/mdss_compat_utils.c b/drivers/video/fbdev/msm/mdss_compat_utils.c
index ebb6e700e22e..9df9c97b5328 100644
--- a/drivers/video/fbdev/msm/mdss_compat_utils.c
+++ b/drivers/video/fbdev/msm/mdss_compat_utils.c
@@ -2295,6 +2295,8 @@ static int __from_user_mdp_overlay(struct mdp_overlay *ov,
put_user(data, &ov->transp_mask) ||
get_user(data, &ov32->flags) ||
put_user(data, &ov->flags) ||
+ get_user(data, &ov32->pipe_type) ||
+ put_user(data, &ov->pipe_type) ||
get_user(data, &ov32->id) ||
put_user(data, &ov->id) ||
get_user(data, &ov32->priority) ||
diff --git a/drivers/video/fbdev/msm/mdss_compat_utils.h b/drivers/video/fbdev/msm/mdss_compat_utils.h
index 740e952b53cc..cf4779aaad81 100644
--- a/drivers/video/fbdev/msm/mdss_compat_utils.h
+++ b/drivers/video/fbdev/msm/mdss_compat_utils.h
@@ -359,6 +359,7 @@ struct mdp_overlay32 {
uint32_t blend_op;
uint32_t transp_mask;
uint32_t flags;
+ uint32_t pipe_type;
uint32_t id;
uint8_t priority;
uint32_t user_data[6];
diff --git a/drivers/video/fbdev/msm/mdss_mdp_overlay.c b/drivers/video/fbdev/msm/mdss_mdp_overlay.c
index 1ba02b5a1fe9..ee2a2abf03ea 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_overlay.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_overlay.c
@@ -555,18 +555,34 @@ int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd,
is_vig_needed = true;
if (req->id == MSMFB_NEW_REQUEST) {
- if (req->flags & MDP_OV_PIPE_FORCE_DMA)
- pipe_type = MDSS_MDP_PIPE_TYPE_DMA;
- else if (fmt->is_yuv || (req->flags & MDP_OV_PIPE_SHARE) ||
- is_vig_needed)
+ switch (req->pipe_type) {
+ case PIPE_TYPE_VIG:
pipe_type = MDSS_MDP_PIPE_TYPE_VIG;
- else
+ break;
+ case PIPE_TYPE_RGB:
pipe_type = MDSS_MDP_PIPE_TYPE_RGB;
+ break;
+ case PIPE_TYPE_DMA:
+ pipe_type = MDSS_MDP_PIPE_TYPE_DMA;
+ break;
+ case PIPE_TYPE_AUTO:
+ default:
+ if (req->flags & MDP_OV_PIPE_FORCE_DMA)
+ pipe_type = MDSS_MDP_PIPE_TYPE_DMA;
+ else if (fmt->is_yuv ||
+ (req->flags & MDP_OV_PIPE_SHARE) ||
+ is_vig_needed)
+ pipe_type = MDSS_MDP_PIPE_TYPE_VIG;
+ else
+ pipe_type = MDSS_MDP_PIPE_TYPE_RGB;
+ break;
+ }
pipe = mdss_mdp_pipe_alloc(mixer, pipe_type, left_blend_pipe);
/* RGB pipes can be used instead of DMA */
- if (!pipe && (pipe_type == MDSS_MDP_PIPE_TYPE_DMA)) {
+ if ((req->pipe_type == PIPE_TYPE_AUTO) && !pipe &&
+ (pipe_type == MDSS_MDP_PIPE_TYPE_DMA)) {
pr_debug("giving RGB pipe for fb%d. flags:0x%x\n",
mfd->index, req->flags);
pipe_type = MDSS_MDP_PIPE_TYPE_RGB;
@@ -575,7 +591,8 @@ int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd,
}
/* VIG pipes can also support RGB format */
- if (!pipe && pipe_type == MDSS_MDP_PIPE_TYPE_RGB) {
+ if ((req->pipe_type == PIPE_TYPE_AUTO) && !pipe &&
+ (pipe_type == MDSS_MDP_PIPE_TYPE_RGB)) {
pr_debug("giving ViG pipe for fb%d. flags:0x%x\n",
mfd->index, req->flags);
pipe_type = MDSS_MDP_PIPE_TYPE_VIG;
diff --git a/include/uapi/linux/msm_mdp.h b/include/uapi/linux/msm_mdp.h
index 8a289a3d9a54..cf965d45883a 100644
--- a/include/uapi/linux/msm_mdp.h
+++ b/include/uapi/linux/msm_mdp.h
@@ -552,6 +552,23 @@ struct mdp_scale_data {
};
/**
+ * enum mdp_overlay_pipe_type - Different pipe type set by userspace
+ *
+ * @PIPE_TYPE_AUTO: Not specified, pipe will be selected according to flags.
+ * @PIPE_TYPE_VIG: VIG pipe.
+ * @PIPE_TYPE_RGB: RGB pipe.
+ * @PIPE_TYPE_DMA: DMA pipe.
+ * @PIPE_TYPE_MAX: Used to track maximum number of pipe type.
+ */
+enum mdp_overlay_pipe_type {
+ PIPE_TYPE_AUTO = 0,
+ PIPE_TYPE_VIG,
+ PIPE_TYPE_RGB,
+ PIPE_TYPE_DMA,
+ PIPE_TYPE_MAX,
+};
+
+/**
* struct mdp_overlay - overlay surface structure
* @src: Source image information (width, height, format).
* @src_rect: Source crop rectangle, portion of image that will be fetched.
@@ -573,6 +590,7 @@ struct mdp_scale_data {
* The color should be in same format as the source image format.
* @flags: This is used to customize operation of overlay. See MDP flags
* for more information.
+ * @pipe_type: Used to specify the type of overlay pipe.
* @user_data: DEPRECATED* Used to store user application specific information.
* @bg_color: Solid color used to fill the overlay surface when no source
* buffer is provided.
@@ -610,6 +628,7 @@ struct mdp_overlay {
uint32_t blend_op;
uint32_t transp_mask;
uint32_t flags;
+ uint32_t pipe_type;
uint32_t id;
uint8_t priority;
uint32_t user_data[6];