diff --git a/drivers/video/msm/msm_fb.c b/drivers/video/msm/msm_fb.c index a33d49d10be8..44743bc1baa7 100644 --- a/drivers/video/msm/msm_fb.c +++ b/drivers/video/msm/msm_fb.c @@ -3,7 +3,7 @@ * Core MSM framebuffer driver. * * Copyright (C) 2007 Google Incorporated - * Copyright (c) 2008-2013, Code Aurora Forum. All rights reserved. + * Copyright (c) 2008-2013, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -3672,6 +3672,23 @@ static int msmfb_display_commit(struct fb_info *info, return ret; } +static int msmfb_get_metadata(struct msm_fb_data_type *mfd, + struct msmfb_metadata *metadata_ptr) +{ + int ret = 0; + switch (metadata_ptr->op) { + case metadata_op_frame_rate: + metadata_ptr->data.panel_frame_rate = + mdp_get_panel_framerate(mfd); + break; + default: + pr_warn("Unsupported request to MDP META IOCTL.\n"); + ret = -EINVAL; + break; + } + return ret; +} + static int msm_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) { @@ -3690,6 +3707,7 @@ static int msm_fb_ioctl(struct fb_info *info, unsigned int cmd, struct mdp_page_protection fb_page_protection; struct msmfb_mdp_pp mdp_pp; struct mdp_buf_sync buf_sync; + struct msmfb_metadata mdp_metadata; int ret = 0; msm_fb_pan_idle(mfd); @@ -3986,6 +4004,17 @@ static int msm_fb_ioctl(struct fb_info *info, unsigned int cmd, ret = msmfb_display_commit(info, argp); break; + case MSMFB_METADATA_GET: + ret = copy_from_user(&mdp_metadata, argp, sizeof(mdp_metadata)); + if (ret) + return ret; + ret = msmfb_get_metadata(mfd, &mdp_metadata); + if (!ret) + ret = copy_to_user(argp, &mdp_metadata, + sizeof(mdp_metadata)); + + break; + default: MSM_FB_INFO("MDP: unknown ioctl (cmd=%x) received!\n", cmd); ret = -EINVAL; diff --git a/include/linux/msm_mdp.h b/include/linux/msm_mdp.h index 2c56ce0f3cb0..91d9b9ac2362 100644 --- a/include/linux/msm_mdp.h +++ b/include/linux/msm_mdp.h @@ -1,7 +1,7 @@ /* include/linux/msm_mdp.h * * Copyright (C) 2007 Google Incorporated - * Copyright (c) 2013 Code Aurora Forum. All rights reserved. + * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -73,6 +73,7 @@ #define MSMFB_BUFFER_SYNC _IOW(MSMFB_IOCTL_MAGIC, 162, struct mdp_buf_sync) #define MSMFB_DISPLAY_COMMIT _IOW(MSMFB_IOCTL_MAGIC, 164, \ struct mdp_display_commit) +#define MSMFB_METADATA_GET _IOW(MSMFB_IOCTL_MAGIC, 166, struct msmfb_metadata) #define FB_TYPE_3D_PANEL 0x10101010 #define MDP_IMGTYPE2_START 0x10000 @@ -496,6 +497,26 @@ struct msmfb_mdp_pp { } data; }; +enum { + metadata_op_none, + metadata_op_base_blend, + metadata_op_frame_rate, + metadata_op_max +}; + +struct mdp_blend_cfg { + uint32_t is_premultiplied; +}; + +struct msmfb_metadata { + uint32_t op; + uint32_t flags; + union { + struct mdp_blend_cfg blend_cfg; + uint32_t panel_frame_rate; + } data; +}; + #define MDP_MAX_FENCE_FD 10 #define MDP_BUF_SYNC_FLAG_WAIT 1