msm: mdss: Fix compat IOCTLS in rotator and primary
Update structures in mdss compat layer with the new interface changes in mdss headers, so that 32_to_64 backward compatibility is maintained. Change-Id: I1b75ee6d0d13438fedbaf045a3cdc7f47bf32ba2 Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org> Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
This commit is contained in:
parent
7d62d1df16
commit
b3e5488a19
4 changed files with 62 additions and 4 deletions
|
@ -225,6 +225,7 @@ static struct mdp_input_layer *__create_layer_list(
|
|||
layer->transp_mask = layer32->transp_mask;
|
||||
layer->bg_color = layer32->bg_color;
|
||||
layer->blend_op = layer32->blend_op;
|
||||
layer->color_space = layer32->color_space;
|
||||
layer->src_rect = layer32->src_rect;
|
||||
layer->dst_rect = layer32->dst_rect;
|
||||
layer->buffer = layer32->buffer;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
@ -15,6 +15,15 @@
|
|||
#ifndef MDSS_COMPAT_UTILS_H
|
||||
#define MDSS_COMPAT_UTILS_H
|
||||
|
||||
/*
|
||||
* To allow proper structure padding for 64bit/32bit target
|
||||
*/
|
||||
#ifdef __LP64
|
||||
#define MDP_LAYER_COMMIT_V1_PAD 3
|
||||
#else
|
||||
#define MDP_LAYER_COMMIT_V1_PAD 4
|
||||
#endif
|
||||
|
||||
struct mdp_buf_sync32 {
|
||||
u32 flags;
|
||||
u32 acq_fen_fd_cnt;
|
||||
|
@ -498,7 +507,8 @@ struct mdp_input_layer32 {
|
|||
uint16_t z_order;
|
||||
uint32_t transp_mask;
|
||||
uint32_t bg_color;
|
||||
enum mdss_mdp_blend_op blend_op;
|
||||
enum mdss_mdp_blend_op blend_op;
|
||||
enum mdp_color_space color_space;
|
||||
struct mdp_rect src_rect;
|
||||
struct mdp_rect dst_rect;
|
||||
compat_caddr_t scale;
|
||||
|
@ -512,7 +522,8 @@ struct mdp_output_layer32 {
|
|||
uint32_t flags;
|
||||
uint32_t writeback_ndx;
|
||||
struct mdp_layer_buffer buffer;
|
||||
uint32_t reserved[6];
|
||||
enum mdp_color_space color_space;
|
||||
uint32_t reserved[5];
|
||||
};
|
||||
struct mdp_layer_commit_v1_32 {
|
||||
uint32_t flags;
|
||||
|
@ -523,7 +534,9 @@ struct mdp_layer_commit_v1_32 {
|
|||
uint32_t input_layer_cnt;
|
||||
compat_caddr_t output_layer;
|
||||
int retire_fence;
|
||||
uint32_t reserved[6];
|
||||
compat_caddr_t dest_scaler;
|
||||
uint32_t dest_scaler_cnt;
|
||||
uint32_t reserved[MDP_LAYER_COMMIT_V1_PAD];
|
||||
};
|
||||
|
||||
struct mdp_layer_commit32 {
|
||||
|
|
|
@ -2386,6 +2386,31 @@ handle_request32_err:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static unsigned int __do_compat_ioctl_rot(unsigned int cmd32)
|
||||
{
|
||||
unsigned int cmd;
|
||||
|
||||
switch (cmd32) {
|
||||
case MDSS_ROTATION_REQUEST32:
|
||||
cmd = MDSS_ROTATION_REQUEST;
|
||||
break;
|
||||
case MDSS_ROTATION_OPEN32:
|
||||
cmd = MDSS_ROTATION_OPEN;
|
||||
break;
|
||||
case MDSS_ROTATION_CLOSE32:
|
||||
cmd = MDSS_ROTATION_CLOSE;
|
||||
break;
|
||||
case MDSS_ROTATION_CONFIG32:
|
||||
cmd = MDSS_ROTATION_CONFIG;
|
||||
break;
|
||||
default:
|
||||
cmd = cmd32;
|
||||
break;
|
||||
}
|
||||
|
||||
return cmd;
|
||||
}
|
||||
|
||||
static long mdss_rotator_compat_ioctl(struct file *file, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
|
@ -2408,6 +2433,8 @@ static long mdss_rotator_compat_ioctl(struct file *file, unsigned int cmd,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
cmd = __do_compat_ioctl_rot(cmd);
|
||||
|
||||
switch (cmd) {
|
||||
case MDSS_ROTATION_REQUEST:
|
||||
ATRACE_BEGIN("rotator_request32");
|
||||
|
|
|
@ -187,6 +187,23 @@ struct mdss_rot_mgr {
|
|||
};
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
|
||||
/* open a rotation session */
|
||||
#define MDSS_ROTATION_OPEN32 \
|
||||
_IOWR(MDSS_ROTATOR_IOCTL_MAGIC, 1, compat_caddr_t)
|
||||
|
||||
/* change the rotation session configuration */
|
||||
#define MDSS_ROTATION_CONFIG32 \
|
||||
_IOWR(MDSS_ROTATOR_IOCTL_MAGIC, 2, compat_caddr_t)
|
||||
|
||||
/* queue the rotation request */
|
||||
#define MDSS_ROTATION_REQUEST32 \
|
||||
_IOWR(MDSS_ROTATOR_IOCTL_MAGIC, 3, compat_caddr_t)
|
||||
|
||||
/* close a rotation session with the specified rotation session ID */
|
||||
#define MDSS_ROTATION_CLOSE32 \
|
||||
_IOW(MDSS_ROTATOR_IOCTL_MAGIC, 4, unsigned int)
|
||||
|
||||
struct mdp_rotation_request32 {
|
||||
uint32_t version;
|
||||
uint32_t flags;
|
||||
|
|
Loading…
Add table
Reference in a new issue