Skip to content

Commit

Permalink
drm/exynos: Move dma_addr out of exynos_drm_fb
Browse files Browse the repository at this point in the history
This can be calculated from the GEM BO DMA address as well as the offset
stored in the base framebuffer.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
  • Loading branch information
Daniel Stone authored and Inki Dae committed Apr 17, 2018
1 parent b11954a commit 7b30508
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/gpu/drm/exynos/exynos_drm_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
*/
struct exynos_drm_fb {
struct drm_framebuffer fb;
dma_addr_t dma_addr[MAX_FB_BUFFER];
};

static int check_fb_gem_memory_type(struct drm_device *drm_dev,
Expand Down Expand Up @@ -91,8 +90,6 @@ exynos_drm_framebuffer_init(struct drm_device *dev,
goto err;

exynos_fb->fb.obj[i] = &exynos_gem[i]->base;
exynos_fb->dma_addr[i] = exynos_gem[i]->dma_addr
+ mode_cmd->offsets[i];
}

drm_helper_mode_fill_fb_struct(dev, &exynos_fb->fb, mode_cmd);
Expand Down Expand Up @@ -160,12 +157,13 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,

dma_addr_t exynos_drm_fb_dma_addr(struct drm_framebuffer *fb, int index)
{
struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb);
struct exynos_drm_gem *exynos_gem;

if (WARN_ON_ONCE(index >= MAX_FB_BUFFER))
return 0;

return exynos_fb->dma_addr[index];
exynos_gem = to_exynos_gem(fb->obj[index]);
return exynos_gem->dma_addr + fb->offsets[index];
}

static struct drm_mode_config_helper_funcs exynos_drm_mode_config_helpers = {
Expand Down

0 comments on commit 7b30508

Please sign in to comment.