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....@gmail.com>
---
drivers/video/sunxi/disp/dev_fb.c | 6 ++++--
drivers/video/sunxi/disp/dev_fb.h | 2 +-
drivers/video/sunxi/disp/disp_ump.c | 9 ++++++---
include/video/sunxi_disp_ioctl.h | 2 ++
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 a40286e..e06910a 100644
--- a/drivers/video/sunxi/disp/dev_fb.c
+++ b/drivers/video/sunxi/disp/dev_fb.c
@@ -1364,8 +1364,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 84e76ab..13e6f71 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 1efc573..a29dc55 100644
--- a/drivers/video/sunxi/disp/disp_ump.c
+++ b/drivers/video/sunxi/disp/disp_ump.c
@@ -44,9 +44,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 b4d1151..5ba03b2 100644
--- a/include/video/sunxi_disp_ioctl.h
+++ b/include/video/sunxi_disp_ioctl.h
@@ -863,6 +863,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
--
1.7.8.6