summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiarhei Siamashka <siarhei.siamashka@gmail.com>2013-01-11 12:50:55 +0400
committerAlejandro Mery <amery@geeks.cl>2013-01-14 14:35:52 +0400
commit89a5378dd5ef60c1d3fba0aa96cc543dfe65266c (patch)
treefa556fe662f5c5752055b4d1f85b255643209823
parent81b834f148a276392098fbdf83c5a3fa982fc68f (diff)
downloadlinux-sunxi-89a5378dd5ef60c1d3fba0aa96cc543dfe65266c.tar.xz
sunxi: disp_ump: Introduce a new ioctl for UMP wrapping the whole framebuffersunxi-v3.0.57-r1
There are two ioctls (GET_UMP_SECURE_ID_BUF1 and GET_UMP_SECURE_ID_BUF2) available for similar purpose already. And they are used by xf86-video-mali X11 DDX driver. In order not to clash with them, we just can add a new ioctl. This ioctl is needed for the new, soon to be announced xf86-video-sunxifb X11 DDX driver. Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
-rw-r--r--drivers/video/sunxi/disp/dev_fb.c6
-rw-r--r--drivers/video/sunxi/disp/dev_fb.h2
-rw-r--r--drivers/video/sunxi/disp/disp_ump.c9
-rw-r--r--include/video/sunxi_disp_ioctl.h2
4 files changed, 13 insertions, 6 deletions
diff --git a/drivers/video/sunxi/disp/dev_fb.c b/drivers/video/sunxi/disp/dev_fb.c
index 15531a76b25d..3ac43412f917 100644
--- a/drivers/video/sunxi/disp/dev_fb.c
+++ b/drivers/video/sunxi/disp/dev_fb.c
@@ -1335,8 +1335,10 @@ static int Fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
#ifdef CONFIG_FB_SUNXI_UMP
case GET_UMP_SECURE_ID_BUF2: /* flow trough */
- secure_id_buf_num = 1;
- case GET_UMP_SECURE_ID_BUF1:
+ secure_id_buf_num++;
+ case GET_UMP_SECURE_ID_BUF1: /* flow trough */
+ secure_id_buf_num++;
+ case GET_UMP_SECURE_ID_SUNXI_FB:
{
if (!disp_get_ump_secure_id)
request_module("disp_ump");
diff --git a/drivers/video/sunxi/disp/dev_fb.h b/drivers/video/sunxi/disp/dev_fb.h
index 0ccfb457de0b..8fe7bbfc4b25 100644
--- a/drivers/video/sunxi/disp/dev_fb.h
+++ b/drivers/video/sunxi/disp/dev_fb.h
@@ -57,7 +57,7 @@ typedef struct {
unsigned long wait_count[SUNXI_MAX_FB];
__u32 pseudo_palette[SUNXI_MAX_FB][16];
#ifdef CONFIG_FB_SUNXI_UMP
- ump_dd_handle ump_wrapped_buffer[SUNXI_MAX_FB][2];
+ ump_dd_handle ump_wrapped_buffer[SUNXI_MAX_FB][3];
#endif
/* screen_base address, allocated with disp_malloc() */
void *malloc_screen_base[SUNXI_MAX_FB];
diff --git a/drivers/video/sunxi/disp/disp_ump.c b/drivers/video/sunxi/disp/disp_ump.c
index 802c0efb449a..df1757b46b94 100644
--- a/drivers/video/sunxi/disp/disp_ump.c
+++ b/drivers/video/sunxi/disp/disp_ump.c
@@ -42,9 +42,12 @@ static int _disp_get_ump_secure_id(struct fb_info *info, fb_info_t *g_fbi,
if (!g_fbi->ump_wrapped_buffer[info->node][buf]) {
ump_dd_physical_block ump_memory_description;
- ump_memory_description.addr =
- info->fix.smem_start + (buf_len * buf);
- ump_memory_description.size = buf_len;
+ ump_memory_description.addr = info->fix.smem_start;
+ ump_memory_description.size = info->fix.smem_len;
+ if (buf > 0) {
+ ump_memory_description.addr += (buf_len * (buf - 1));
+ ump_memory_description.size = buf_len;
+ }
g_fbi->ump_wrapped_buffer[info->node][buf] =
ump_dd_handle_create_from_phys_blocks
(&ump_memory_description, 1);
diff --git a/include/video/sunxi_disp_ioctl.h b/include/video/sunxi_disp_ioctl.h
index 53a3d0fe744d..295b8d853fa6 100644
--- a/include/video/sunxi_disp_ioctl.h
+++ b/include/video/sunxi_disp_ioctl.h
@@ -876,6 +876,8 @@ typedef enum tag_DISP_CMD {
#define GET_UMP_SECURE_ID_BUF1 _IOWR('m', 310, unsigned int)
#define GET_UMP_SECURE_ID_BUF2 _IOWR('m', 311, unsigned int)
+#define GET_UMP_SECURE_ID_SUNXI_FB _IOWR('s', 100, unsigned int)
+
#define FBIOGET_LAYER_HDL_0 0x4700
#define FBIOGET_LAYER_HDL_1 0x4701