fbdev: msm: fix issue preventing cursor_buf address to be stored

Fix bug in cursor which prevents the virtual address of the
registers to be stored in the driver context.

Change-Id: Ica8a9548911da5a32903893b0e494d052e366285
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
This commit is contained in:
Krishna Manikandan 2017-06-06 15:04:49 +05:30
parent 2bfc0eda7e
commit 23e2061c07
4 changed files with 8 additions and 8 deletions

View file

@ -272,7 +272,7 @@ struct mdss_smmu_ops {
void (*smmu_unmap_dma_buf)(struct sg_table *table, int domain,
int dir, struct dma_buf *dma_buf);
int (*smmu_dma_alloc_coherent)(struct device *dev, size_t size,
dma_addr_t *phys, dma_addr_t *iova, void *cpu_addr,
dma_addr_t *phys, dma_addr_t *iova, void **cpu_addr,
gfp_t gfp, int domain);
void (*smmu_dma_free_coherent)(struct device *dev, size_t size,
void *cpu_addr, dma_addr_t phys, dma_addr_t iova,

View file

@ -4413,7 +4413,7 @@ static int mdss_mdp_hw_cursor_pipe_update(struct msm_fb_data_type *mfd,
if (!mfd->cursor_buf && (cursor->set & FB_CUR_SETIMAGE)) {
ret = mdss_smmu_dma_alloc_coherent(&pdev->dev,
cursor_frame_size, (dma_addr_t *) &mfd->cursor_buf_phys,
&mfd->cursor_buf_iova, mfd->cursor_buf,
&mfd->cursor_buf_iova, &mfd->cursor_buf,
GFP_KERNEL, MDSS_IOMMU_DOMAIN_UNSECURE);
if (ret) {
pr_err("can't allocate cursor buffer rc:%d\n", ret);
@ -4601,7 +4601,7 @@ static int mdss_mdp_hw_cursor_update(struct msm_fb_data_type *mfd,
if (!mfd->cursor_buf && (cursor->set & FB_CUR_SETIMAGE)) {
ret = mdss_smmu_dma_alloc_coherent(&pdev->dev,
cursor_frame_size, (dma_addr_t *) &mfd->cursor_buf_phys,
&mfd->cursor_buf_iova, mfd->cursor_buf,
&mfd->cursor_buf_iova, &mfd->cursor_buf,
GFP_KERNEL, MDSS_IOMMU_DOMAIN_UNSECURE);
if (ret) {
pr_err("can't allocate cursor buffer rc:%d\n", ret);
@ -4649,7 +4649,7 @@ static int mdss_mdp_hw_cursor_update(struct msm_fb_data_type *mfd,
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON);
if (cursor->set & FB_CUR_SETIMAGE) {
if (mfd->cursor_buf && (cursor->set & FB_CUR_SETIMAGE)) {
u32 cursor_addr;
ret = copy_from_user(mfd->cursor_buf, img->data,
img->width * img->height * 4);

View file

@ -477,7 +477,7 @@ static void mdss_smmu_unmap_dma_buf_v2(struct sg_table *table, int domain,
* bank device
*/
static int mdss_smmu_dma_alloc_coherent_v2(struct device *dev, size_t size,
dma_addr_t *phys, dma_addr_t *iova, void *cpu_addr,
dma_addr_t *phys, dma_addr_t *iova, void **cpu_addr,
gfp_t gfp, int domain)
{
struct mdss_smmu_client *mdss_smmu = mdss_smmu_get_cb(domain);
@ -486,8 +486,8 @@ static int mdss_smmu_dma_alloc_coherent_v2(struct device *dev, size_t size,
return -EINVAL;
}
cpu_addr = dma_alloc_coherent(mdss_smmu->base.dev, size, iova, gfp);
if (!cpu_addr) {
*cpu_addr = dma_alloc_coherent(mdss_smmu->base.dev, size, iova, gfp);
if (!*cpu_addr) {
pr_err("dma alloc coherent failed!\n");
return -ENOMEM;
}

View file

@ -253,7 +253,7 @@ static inline void mdss_smmu_unmap_dma_buf(struct sg_table *table, int domain,
}
static inline int mdss_smmu_dma_alloc_coherent(struct device *dev, size_t size,
dma_addr_t *phys, dma_addr_t *iova, void *cpu_addr,
dma_addr_t *phys, dma_addr_t *iova, void **cpu_addr,
gfp_t gfp, int domain)
{
struct mdss_data_type *mdata = mdss_mdp_get_mdata();