* [PATCH 1/4] drm/exynos: remove unnecessary NULL assignment
@ 2015-09-16 5:29 Joonyoung Shim
2015-09-16 5:29 ` [PATCH 2/4] drm/exynos: staticize exynos_drm_gem_init() Joonyoung Shim
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Joonyoung Shim @ 2015-09-16 5:29 UTC (permalink / raw)
To: dri-devel; +Cc: sw0312.kim
They will be freed right or was freed already, so NULL assignment is
unnecessary.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---
drivers/gpu/drm/exynos/exynos_drm_gem.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index f12fbc3..8dce40d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -117,8 +117,6 @@ static void exynos_drm_free_buf(struct exynos_drm_gem_obj *obj)
} else
dma_free_attrs(dev->dev, obj->size, obj->pages,
(dma_addr_t)obj->dma_addr, &obj->dma_attrs);
-
- obj->dma_addr = (dma_addr_t)NULL;
}
static int exynos_drm_gem_handle_create(struct drm_gem_object *obj,
@@ -167,7 +165,6 @@ out:
drm_gem_object_release(obj);
kfree(exynos_gem_obj);
- exynos_gem_obj = NULL;
}
unsigned long exynos_drm_gem_get_size(struct drm_device *dev,
--
1.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/4] drm/exynos: staticize exynos_drm_gem_init()
2015-09-16 5:29 [PATCH 1/4] drm/exynos: remove unnecessary NULL assignment Joonyoung Shim
@ 2015-09-16 5:29 ` Joonyoung Shim
2015-09-21 16:10 ` Gustavo Padovan
2015-09-16 5:29 ` [PATCH 3/4] drm/exynos: cleanup function calling written twice Joonyoung Shim
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Joonyoung Shim @ 2015-09-16 5:29 UTC (permalink / raw)
To: dri-devel; +Cc: sw0312.kim
The exynos_drm_gem_init() is used only in exynos_drm_gem.c file. Make it
static and don't export it.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---
drivers/gpu/drm/exynos/exynos_drm_gem.c | 3 +--
drivers/gpu/drm/exynos/exynos_drm_gem.h | 4 ----
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index 8dce40d..fcb6a2c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -187,8 +187,7 @@ unsigned long exynos_drm_gem_get_size(struct drm_device *dev,
return exynos_gem_obj->size;
}
-
-struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev,
+static struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev,
unsigned long size)
{
struct exynos_drm_gem_obj *exynos_gem_obj;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.h b/drivers/gpu/drm/exynos/exynos_drm_gem.h
index cd62f84..610ccad 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.h
@@ -59,10 +59,6 @@ struct page **exynos_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask);
/* destroy a buffer with gem object */
void exynos_drm_gem_destroy(struct exynos_drm_gem_obj *exynos_gem_obj);
-/* create a private gem object and initialize it. */
-struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev,
- unsigned long size);
-
/* create a new buffer with gem object */
struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev,
unsigned int flags,
--
1.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/4] drm/exynos: cleanup function calling written twice
2015-09-16 5:29 [PATCH 1/4] drm/exynos: remove unnecessary NULL assignment Joonyoung Shim
2015-09-16 5:29 ` [PATCH 2/4] drm/exynos: staticize exynos_drm_gem_init() Joonyoung Shim
@ 2015-09-16 5:29 ` Joonyoung Shim
2015-09-21 18:26 ` Gustavo Padovan
2015-09-16 5:29 ` [PATCH 4/4] drm/exynos: cleanup line feed in exynos_drm_gem_get_ioctl Joonyoung Shim
2015-09-21 16:10 ` [PATCH 1/4] drm/exynos: remove unnecessary NULL assignment Gustavo Padovan
3 siblings, 1 reply; 8+ messages in thread
From: Joonyoung Shim @ 2015-09-16 5:29 UTC (permalink / raw)
To: dri-devel; +Cc: sw0312.kim
By if statment, some function callings are written twice. It needs
several line feed by indentation in if statment. Make to one function
calling from outside if statment.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---
drivers/gpu/drm/exynos/exynos_drm_gem.c | 56 ++++++++++++++-------------------
1 file changed, 23 insertions(+), 33 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index fcb6a2c..5bc0fc3 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -56,24 +56,25 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem_obj *obj)
nr_pages = obj->size >> PAGE_SHIFT;
if (!is_drm_iommu_supported(dev)) {
- dma_addr_t start_addr;
- unsigned int i = 0;
-
obj->pages = drm_calloc_large(nr_pages, sizeof(struct page *));
if (!obj->pages) {
DRM_ERROR("failed to allocate pages.\n");
return -ENOMEM;
}
+ }
- obj->cookie = dma_alloc_attrs(dev->dev,
- obj->size,
- &obj->dma_addr, GFP_KERNEL,
- &obj->dma_attrs);
- if (!obj->cookie) {
- DRM_ERROR("failed to allocate buffer.\n");
+ obj->cookie = dma_alloc_attrs(dev->dev, obj->size, &obj->dma_addr,
+ GFP_KERNEL, &obj->dma_attrs);
+ if (!obj->cookie) {
+ DRM_ERROR("failed to allocate buffer.\n");
+ if (obj->pages)
drm_free_large(obj->pages);
- return -ENOMEM;
- }
+ return -ENOMEM;
+ }
+
+ if (obj->pages) {
+ dma_addr_t start_addr;
+ unsigned int i = 0;
start_addr = obj->dma_addr;
while (i < nr_pages) {
@@ -82,13 +83,7 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem_obj *obj)
i++;
}
} else {
- obj->pages = dma_alloc_attrs(dev->dev, obj->size,
- &obj->dma_addr, GFP_KERNEL,
- &obj->dma_attrs);
- if (!obj->pages) {
- DRM_ERROR("failed to allocate buffer.\n");
- return -ENOMEM;
- }
+ obj->pages = obj->cookie;
}
DRM_DEBUG_KMS("dma_addr(0x%lx), size(0x%lx)\n",
@@ -110,13 +105,11 @@ static void exynos_drm_free_buf(struct exynos_drm_gem_obj *obj)
DRM_DEBUG_KMS("dma_addr(0x%lx), size(0x%lx)\n",
(unsigned long)obj->dma_addr, obj->size);
- if (!is_drm_iommu_supported(dev)) {
- dma_free_attrs(dev->dev, obj->size, obj->cookie,
- (dma_addr_t)obj->dma_addr, &obj->dma_attrs);
+ dma_free_attrs(dev->dev, obj->size, obj->cookie,
+ (dma_addr_t)obj->dma_addr, &obj->dma_attrs);
+
+ if (!is_drm_iommu_supported(dev))
drm_free_large(obj->pages);
- } else
- dma_free_attrs(dev->dev, obj->size, obj->pages,
- (dma_addr_t)obj->dma_addr, &obj->dma_attrs);
}
static int exynos_drm_gem_handle_create(struct drm_gem_object *obj,
@@ -398,6 +391,7 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv,
struct drm_mode_create_dumb *args)
{
struct exynos_drm_gem_obj *exynos_gem_obj;
+ unsigned int flags;
int ret;
/*
@@ -409,16 +403,12 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv,
args->pitch = args->width * ((args->bpp + 7) / 8);
args->size = args->pitch * args->height;
- if (is_drm_iommu_supported(dev)) {
- exynos_gem_obj = exynos_drm_gem_create(dev,
- EXYNOS_BO_NONCONTIG | EXYNOS_BO_WC,
- args->size);
- } else {
- exynos_gem_obj = exynos_drm_gem_create(dev,
- EXYNOS_BO_CONTIG | EXYNOS_BO_WC,
- args->size);
- }
+ if (is_drm_iommu_supported(dev))
+ flags = EXYNOS_BO_NONCONTIG | EXYNOS_BO_WC;
+ else
+ flags = EXYNOS_BO_CONTIG | EXYNOS_BO_WC;
+ exynos_gem_obj = exynos_drm_gem_create(dev, flags, args->size);
if (IS_ERR(exynos_gem_obj)) {
dev_warn(dev->dev, "FB allocation failed.\n");
return PTR_ERR(exynos_gem_obj);
--
1.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/4] drm/exynos: cleanup line feed in exynos_drm_gem_get_ioctl
2015-09-16 5:29 [PATCH 1/4] drm/exynos: remove unnecessary NULL assignment Joonyoung Shim
2015-09-16 5:29 ` [PATCH 2/4] drm/exynos: staticize exynos_drm_gem_init() Joonyoung Shim
2015-09-16 5:29 ` [PATCH 3/4] drm/exynos: cleanup function calling written twice Joonyoung Shim
@ 2015-09-16 5:29 ` Joonyoung Shim
2015-09-21 18:26 ` Gustavo Padovan
2015-09-21 16:10 ` [PATCH 1/4] drm/exynos: remove unnecessary NULL assignment Gustavo Padovan
3 siblings, 1 reply; 8+ messages in thread
From: Joonyoung Shim @ 2015-09-16 5:29 UTC (permalink / raw)
To: dri-devel; +Cc: sw0312.kim
The beginning of statement in function is next line of a brace.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---
drivers/gpu/drm/exynos/exynos_drm_gem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index 5bc0fc3..31c5b64 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -331,7 +331,8 @@ int exynos_drm_gem_mmap_buffer(struct exynos_drm_gem_obj *exynos_gem_obj,
int exynos_drm_gem_get_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
-{ struct exynos_drm_gem_obj *exynos_gem_obj;
+{
+ struct exynos_drm_gem_obj *exynos_gem_obj;
struct drm_exynos_gem_info *args = data;
struct drm_gem_object *obj;
--
1.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/4] drm/exynos: remove unnecessary NULL assignment
2015-09-16 5:29 [PATCH 1/4] drm/exynos: remove unnecessary NULL assignment Joonyoung Shim
` (2 preceding siblings ...)
2015-09-16 5:29 ` [PATCH 4/4] drm/exynos: cleanup line feed in exynos_drm_gem_get_ioctl Joonyoung Shim
@ 2015-09-21 16:10 ` Gustavo Padovan
3 siblings, 0 replies; 8+ messages in thread
From: Gustavo Padovan @ 2015-09-21 16:10 UTC (permalink / raw)
To: Joonyoung Shim; +Cc: sw0312.kim, dri-devel
Hi Joonyoung,
2015-09-16 Joonyoung Shim <jy0922.shim@samsung.com>:
> They will be freed right or was freed already, so NULL assignment is
> unnecessary.
>
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
> ---
> drivers/gpu/drm/exynos/exynos_drm_gem.c | 3 ---
> 1 file changed, 3 deletions(-)
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Gustavo
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/4] drm/exynos: staticize exynos_drm_gem_init()
2015-09-16 5:29 ` [PATCH 2/4] drm/exynos: staticize exynos_drm_gem_init() Joonyoung Shim
@ 2015-09-21 16:10 ` Gustavo Padovan
0 siblings, 0 replies; 8+ messages in thread
From: Gustavo Padovan @ 2015-09-21 16:10 UTC (permalink / raw)
To: Joonyoung Shim; +Cc: sw0312.kim, dri-devel
Hi Joonyoung,
2015-09-16 Joonyoung Shim <jy0922.shim@samsung.com>:
> The exynos_drm_gem_init() is used only in exynos_drm_gem.c file. Make it
> static and don't export it.
>
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
> ---
> drivers/gpu/drm/exynos/exynos_drm_gem.c | 3 +--
> drivers/gpu/drm/exynos/exynos_drm_gem.h | 4 ----
> 2 files changed, 1 insertion(+), 6 deletions(-)
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Gustavo
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/4] drm/exynos: cleanup function calling written twice
2015-09-16 5:29 ` [PATCH 3/4] drm/exynos: cleanup function calling written twice Joonyoung Shim
@ 2015-09-21 18:26 ` Gustavo Padovan
0 siblings, 0 replies; 8+ messages in thread
From: Gustavo Padovan @ 2015-09-21 18:26 UTC (permalink / raw)
To: Joonyoung Shim; +Cc: sw0312.kim, dri-devel
Hi Joonyoung,
2015-09-16 Joonyoung Shim <jy0922.shim@samsung.com>:
> By if statment, some function callings are written twice. It needs
> several line feed by indentation in if statment. Make to one function
> calling from outside if statment.
>
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
> ---
> drivers/gpu/drm/exynos/exynos_drm_gem.c | 56 ++++++++++++++-------------------
> 1 file changed, 23 insertions(+), 33 deletions(-)
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Gustavo
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 4/4] drm/exynos: cleanup line feed in exynos_drm_gem_get_ioctl
2015-09-16 5:29 ` [PATCH 4/4] drm/exynos: cleanup line feed in exynos_drm_gem_get_ioctl Joonyoung Shim
@ 2015-09-21 18:26 ` Gustavo Padovan
0 siblings, 0 replies; 8+ messages in thread
From: Gustavo Padovan @ 2015-09-21 18:26 UTC (permalink / raw)
To: Joonyoung Shim; +Cc: sw0312.kim, dri-devel
Hi Joonyoung,
2015-09-16 Joonyoung Shim <jy0922.shim@samsung.com>:
> The beginning of statement in function is next line of a brace.
>
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
> ---
> drivers/gpu/drm/exynos/exynos_drm_gem.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Gustavo
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-09-21 18:26 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16 5:29 [PATCH 1/4] drm/exynos: remove unnecessary NULL assignment Joonyoung Shim
2015-09-16 5:29 ` [PATCH 2/4] drm/exynos: staticize exynos_drm_gem_init() Joonyoung Shim
2015-09-21 16:10 ` Gustavo Padovan
2015-09-16 5:29 ` [PATCH 3/4] drm/exynos: cleanup function calling written twice Joonyoung Shim
2015-09-21 18:26 ` Gustavo Padovan
2015-09-16 5:29 ` [PATCH 4/4] drm/exynos: cleanup line feed in exynos_drm_gem_get_ioctl Joonyoung Shim
2015-09-21 18:26 ` Gustavo Padovan
2015-09-21 16:10 ` [PATCH 1/4] drm/exynos: remove unnecessary NULL assignment Gustavo Padovan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.