diff options
| author | Benet Clark <benetc@codeaurora.org> | 2014-01-06 18:15:09 -0800 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:26:53 -0700 |
| commit | 1321744e157a9231df34ceaefd36212307f2f0cc (patch) | |
| tree | ff7784fcf0d2a8d80a3293af85c66e586d4bca27 /drivers/video/fbdev | |
| parent | 63ca8edc268faa92720bdead3699bd10fb61da07 (diff) | |
msm: mdss: Add histogram LUT compat ioctl to PP compat layer
Added the histogram LUT to the PP LUT compat framework.
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Change-Id: I85970b987ff5ef034884601b30d045edeca4277b
Diffstat (limited to 'drivers/video/fbdev')
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_compat_utils.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/drivers/video/fbdev/msm/mdss_compat_utils.c b/drivers/video/fbdev/msm/mdss_compat_utils.c index 6da37e87b7cf..177b64836d9a 100644 --- a/drivers/video/fbdev/msm/mdss_compat_utils.c +++ b/drivers/video/fbdev/msm/mdss_compat_utils.c @@ -642,6 +642,54 @@ static int __to_user_pgc_lut_data( return 0; } +static int __from_user_hist_lut_data( + struct mdp_hist_lut_data32 __user *hist_lut32, + struct mdp_hist_lut_data __user *hist_lut) +{ + uint32_t data; + + if (copy_in_user(&hist_lut->block, + &hist_lut32->block, + sizeof(uint32_t)) || + copy_in_user(&hist_lut->ops, + &hist_lut32->ops, + sizeof(uint32_t)) || + copy_in_user(&hist_lut->len, + &hist_lut32->len, + sizeof(uint32_t))) + return -EFAULT; + + if (get_user(data, &hist_lut32->data) || + put_user(compat_ptr(data), &hist_lut->data)) + return -EFAULT; + + return 0; +} + +static int __to_user_hist_lut_data( + struct mdp_hist_lut_data32 __user *hist_lut32, + struct mdp_hist_lut_data __user *hist_lut) +{ + unsigned long data; + + if (copy_in_user(&hist_lut32->block, + &hist_lut->block, + sizeof(uint32_t)) || + copy_in_user(&hist_lut32->ops, + &hist_lut->ops, + sizeof(uint32_t)) || + copy_in_user(&hist_lut32->len, + &hist_lut->len, + sizeof(uint32_t))) + return -EFAULT; + + if (get_user(data, &hist_lut->data) || + put_user((compat_caddr_t) data, &hist_lut32->data)) + return -EFAULT; + + return 0; +} + static int __from_user_lut_cfg_data( struct mdp_lut_cfg_data32 __user *lut_cfg32, struct mdp_lut_cfg_data __user *lut_cfg) @@ -669,6 +717,11 @@ static int __from_user_lut_cfg_data( compat_ptr((uintptr_t)&lut_cfg32->data.pgc_lut_data), &lut_cfg->data.pgc_lut_data); break; + case mdp_lut_hist: + ret = __from_user_hist_lut_data( + compat_ptr((uintptr_t)&lut_cfg32->data.hist_lut_data), + &lut_cfg->data.hist_lut_data); + break; default: break; } @@ -703,6 +756,11 @@ static int __to_user_lut_cfg_data( compat_ptr((uintptr_t)&lut_cfg32->data.pgc_lut_data), &lut_cfg->data.pgc_lut_data); break; + case mdp_lut_hist: + ret = __to_user_hist_lut_data( + compat_ptr((uintptr_t)&lut_cfg32->data.hist_lut_data), + &lut_cfg->data.hist_lut_data); + break; default: break; } |
