aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorYoungJun Cho <yj44.cho@samsung.com>2013-03-13 03:55:48 -0400
committerInki Dae <inki.dae@samsung.com>2013-03-20 06:09:10 -0400
commitf3d2fc4a7315d8dd39e6fb37122a3aa08fea6e62 (patch)
treee9640746b0a97f55bad38024c28f4a000b92583f /drivers/gpu
parent7ad018140cc9c0e3388243e524f8410e5f174658 (diff)
drm/exynos: Clean up some G2D codes for readability
This patch just cleans up G2D codes for readability. For this, it changes the member of g2d_cmdlist_node, obj_type into buf_type. Changelog v2: - Revert irrelevant codes. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_g2d.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
index 1ff11443f552..7c1aac3871da 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
@@ -131,13 +131,12 @@ struct g2d_cmdlist_userptr {
131 bool in_pool; 131 bool in_pool;
132 bool out_of_list; 132 bool out_of_list;
133}; 133};
134
135struct g2d_cmdlist_node { 134struct g2d_cmdlist_node {
136 struct list_head list; 135 struct list_head list;
137 struct g2d_cmdlist *cmdlist; 136 struct g2d_cmdlist *cmdlist;
138 unsigned int map_nr; 137 unsigned int map_nr;
139 unsigned long handles[MAX_BUF_ADDR_NR]; 138 unsigned long handles[MAX_BUF_ADDR_NR];
140 unsigned int obj_type[MAX_BUF_ADDR_NR]; 139 unsigned int buf_type[MAX_BUF_ADDR_NR];
141 dma_addr_t dma_addr; 140 dma_addr_t dma_addr;
142 141
143 struct drm_exynos_pending_g2d_event *event; 142 struct drm_exynos_pending_g2d_event *event;
@@ -524,7 +523,7 @@ static int g2d_map_cmdlist_gem(struct g2d_data *g2d,
524 offset = cmdlist->last - (i * 2 + 1); 523 offset = cmdlist->last - (i * 2 + 1);
525 handle = cmdlist->data[offset]; 524 handle = cmdlist->data[offset];
526 525
527 if (node->obj_type[i] == BUF_TYPE_GEM) { 526 if (node->buf_type[i] == BUF_TYPE_GEM) {
528 addr = exynos_drm_gem_get_dma_addr(drm_dev, handle, 527 addr = exynos_drm_gem_get_dma_addr(drm_dev, handle,
529 file); 528 file);
530 if (IS_ERR(addr)) { 529 if (IS_ERR(addr)) {
@@ -568,7 +567,7 @@ static void g2d_unmap_cmdlist_gem(struct g2d_data *g2d,
568 for (i = 0; i < node->map_nr; i++) { 567 for (i = 0; i < node->map_nr; i++) {
569 unsigned long handle = node->handles[i]; 568 unsigned long handle = node->handles[i];
570 569
571 if (node->obj_type[i] == BUF_TYPE_GEM) 570 if (node->buf_type[i] == BUF_TYPE_GEM)
572 exynos_drm_gem_put_dma_addr(subdrv->drm_dev, handle, 571 exynos_drm_gem_put_dma_addr(subdrv->drm_dev, handle,
573 filp); 572 filp);
574 else 573 else
@@ -576,7 +575,7 @@ static void g2d_unmap_cmdlist_gem(struct g2d_data *g2d,
576 false); 575 false);
577 576
578 node->handles[i] = 0; 577 node->handles[i] = 0;
579 node->obj_type[i] = 0; 578 node->buf_type[i] = 0;
580 } 579 }
581 580
582 node->map_nr = 0; 581 node->map_nr = 0;
@@ -642,7 +641,6 @@ static void g2d_runqueue_worker(struct work_struct *work)
642 struct g2d_data *g2d = container_of(work, struct g2d_data, 641 struct g2d_data *g2d = container_of(work, struct g2d_data,
643 runqueue_work); 642 runqueue_work);
644 643
645
646 mutex_lock(&g2d->runqueue_mutex); 644 mutex_lock(&g2d->runqueue_mutex);
647 clk_disable(g2d->gate_clk); 645 clk_disable(g2d->gate_clk);
648 pm_runtime_put_sync(g2d->dev); 646 pm_runtime_put_sync(g2d->dev);
@@ -730,7 +728,7 @@ static int g2d_check_reg_offset(struct device *dev,
730 reg_offset = (cmdlist->data[index] & 728 reg_offset = (cmdlist->data[index] &
731 ~0x7fffffff) >> 31; 729 ~0x7fffffff) >> 31;
732 if (reg_offset) { 730 if (reg_offset) {
733 node->obj_type[i] = BUF_TYPE_USERPTR; 731 node->buf_type[i] = BUF_TYPE_USERPTR;
734 cmdlist->data[index] &= ~G2D_BUF_USERPTR; 732 cmdlist->data[index] &= ~G2D_BUF_USERPTR;
735 } 733 }
736 } 734 }
@@ -752,8 +750,8 @@ static int g2d_check_reg_offset(struct device *dev,
752 if (!for_addr) 750 if (!for_addr)
753 goto err; 751 goto err;
754 752
755 if (node->obj_type[i] != BUF_TYPE_USERPTR) 753 if (node->buf_type[i] != BUF_TYPE_USERPTR)
756 node->obj_type[i] = BUF_TYPE_GEM; 754 node->buf_type[i] = BUF_TYPE_GEM;
757 break; 755 break;
758 default: 756 default:
759 if (for_addr) 757 if (for_addr)