Skip to content

Commit

Permalink
sunxi: disp_ump: Introduce a new ioctl for UMP wrapping the whole fra…
Browse files Browse the repository at this point in the history
…mebuffer

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>
  • Loading branch information
ssvb authored and amery committed Jan 14, 2013
1 parent 81b834f commit 89a5378
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
6 changes: 4 additions & 2 deletions drivers/video/sunxi/disp/dev_fb.c
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/sunxi/disp/dev_fb.h
Expand Up @@ -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];
Expand Down
9 changes: 6 additions & 3 deletions drivers/video/sunxi/disp/disp_ump.c
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions include/video/sunxi_disp_ioctl.h
Expand Up @@ -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

Expand Down

0 comments on commit 89a5378

Please sign in to comment.