diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2014-11-03 23:13:27 +0300 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2015-01-25 15:28:02 +0300 |
commit | 8837deeab462a30d5a760fa1ae7c29242d985700 (patch) | |
tree | 501c06a949c46235f6f70752b5b93127f379e2a9 /drivers/gpu/drm/exynos/exynos_drm_plane.c | |
parent | 1e3b423d0b79dfa25e5f09f558da264d4050eca8 (diff) | |
download | linux-8837deeab462a30d5a760fa1ae7c29242d985700.tar.xz |
drm/exynos: remove struct exynos_drm_overlay
struct exynos_drm_overlay has no practical advantage nor serves as
important piece of the exynos API design. The only place it was used
was inside the struct exynos_plane which was just causing a extra
access overhead. Users had to access the overlay first and just then
get the plane information it contains.
This patch merges struct exynos_drm_overlay into struct exynos_plane.
It also renames struct exynos_plane to struct exynos_drm_plane.
The rational is to cut one step to access plane information.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_plane.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_plane.c | 85 |
1 files changed, 37 insertions, 48 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 7d768612e567..843f74175094 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -18,14 +18,6 @@ #include "exynos_drm_gem.h" #include "exynos_drm_plane.h" -#define to_exynos_plane(x) container_of(x, struct exynos_plane, base) - -struct exynos_plane { - struct drm_plane base; - struct exynos_drm_overlay overlay; - bool enabled; -}; - static const uint32_t formats[] = { DRM_FORMAT_XRGB8888, DRM_FORMAT_ARGB8888, @@ -75,9 +67,8 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, uint32_t src_x, uint32_t src_y, uint32_t src_w, uint32_t src_h) { - struct exynos_plane *exynos_plane = to_exynos_plane(plane); + struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); struct exynos_drm_manager *manager = to_exynos_crtc(crtc)->manager; - struct exynos_drm_overlay *overlay = &exynos_plane->overlay; unsigned int actual_w; unsigned int actual_h; int nr; @@ -92,10 +83,10 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, return -EFAULT; } - overlay->dma_addr[i] = buffer->dma_addr; + exynos_plane->dma_addr[i] = buffer->dma_addr; DRM_DEBUG_KMS("buffer: %d, dma_addr = 0x%lx\n", - i, (unsigned long)overlay->dma_addr[i]); + i, (unsigned long)exynos_plane->dma_addr[i]); } actual_w = exynos_plane_get_size(crtc_x, crtc_w, crtc->mode.hdisplay); @@ -114,54 +105,52 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, } /* set drm framebuffer data. */ - overlay->fb_x = src_x; - overlay->fb_y = src_y; - overlay->fb_width = fb->width; - overlay->fb_height = fb->height; - overlay->src_width = src_w; - overlay->src_height = src_h; - overlay->bpp = fb->bits_per_pixel; - overlay->pitch = fb->pitches[0]; - overlay->pixel_format = fb->pixel_format; - - /* set overlay range to be displayed. */ - overlay->crtc_x = crtc_x; - overlay->crtc_y = crtc_y; - overlay->crtc_width = actual_w; - overlay->crtc_height = actual_h; + exynos_plane->fb_x = src_x; + exynos_plane->fb_y = src_y; + exynos_plane->fb_width = fb->width; + exynos_plane->fb_height = fb->height; + exynos_plane->src_width = src_w; + exynos_plane->src_height = src_h; + exynos_plane->bpp = fb->bits_per_pixel; + exynos_plane->pitch = fb->pitches[0]; + exynos_plane->pixel_format = fb->pixel_format; + + /* set plane range to be displayed. */ + exynos_plane->crtc_x = crtc_x; + exynos_plane->crtc_y = crtc_y; + exynos_plane->crtc_width = actual_w; + exynos_plane->crtc_height = actual_h; /* set drm mode data. */ - overlay->mode_width = crtc->mode.hdisplay; - overlay->mode_height = crtc->mode.vdisplay; - overlay->refresh = crtc->mode.vrefresh; - overlay->scan_flag = crtc->mode.flags; + exynos_plane->mode_width = crtc->mode.hdisplay; + exynos_plane->mode_height = crtc->mode.vdisplay; + exynos_plane->refresh = crtc->mode.vrefresh; + exynos_plane->scan_flag = crtc->mode.flags; - DRM_DEBUG_KMS("overlay : offset_x/y(%d,%d), width/height(%d,%d)", - overlay->crtc_x, overlay->crtc_y, - overlay->crtc_width, overlay->crtc_height); + DRM_DEBUG_KMS("plane : offset_x/y(%d,%d), width/height(%d,%d)", + exynos_plane->crtc_x, exynos_plane->crtc_y, + exynos_plane->crtc_width, exynos_plane->crtc_height); plane->crtc = crtc; if (manager->ops->win_mode_set) - manager->ops->win_mode_set(manager, overlay); + manager->ops->win_mode_set(manager, exynos_plane); return 0; } void exynos_plane_commit(struct drm_plane *plane) { - struct exynos_plane *exynos_plane = to_exynos_plane(plane); - struct exynos_drm_overlay *overlay = &exynos_plane->overlay; + struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); struct exynos_drm_manager *manager = to_exynos_crtc(plane->crtc)->manager; if (manager->ops->win_commit) - manager->ops->win_commit(manager, overlay->zpos); + manager->ops->win_commit(manager, exynos_plane->zpos); } void exynos_plane_dpms(struct drm_plane *plane, int mode) { - struct exynos_plane *exynos_plane = to_exynos_plane(plane); - struct exynos_drm_overlay *overlay = &exynos_plane->overlay; + struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); struct exynos_drm_manager *manager; if (mode == DRM_MODE_DPMS_ON) { @@ -170,7 +159,7 @@ void exynos_plane_dpms(struct drm_plane *plane, int mode) manager = to_exynos_crtc(plane->crtc)->manager; if (manager->ops->win_enable) - manager->ops->win_enable(manager, overlay->zpos); + manager->ops->win_enable(manager, exynos_plane->zpos); exynos_plane->enabled = true; } else { @@ -179,7 +168,7 @@ void exynos_plane_dpms(struct drm_plane *plane, int mode) manager = to_exynos_crtc(plane->crtc)->manager; if (manager->ops->win_disable) - manager->ops->win_disable(manager, overlay->zpos); + manager->ops->win_disable(manager, exynos_plane->zpos); exynos_plane->enabled = false; } @@ -215,7 +204,7 @@ static int exynos_disable_plane(struct drm_plane *plane) static void exynos_plane_destroy(struct drm_plane *plane) { - struct exynos_plane *exynos_plane = to_exynos_plane(plane); + struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); exynos_disable_plane(plane); drm_plane_cleanup(plane); @@ -227,11 +216,11 @@ static int exynos_plane_set_property(struct drm_plane *plane, uint64_t val) { struct drm_device *dev = plane->dev; - struct exynos_plane *exynos_plane = to_exynos_plane(plane); + struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); struct exynos_drm_private *dev_priv = dev->dev_private; if (property == dev_priv->plane_zpos_property) { - exynos_plane->overlay.zpos = val; + exynos_plane->zpos = val; return 0; } @@ -268,10 +257,10 @@ struct drm_plane *exynos_plane_init(struct drm_device *dev, unsigned long possible_crtcs, enum drm_plane_type type) { - struct exynos_plane *exynos_plane; + struct exynos_drm_plane *exynos_plane; int err; - exynos_plane = kzalloc(sizeof(struct exynos_plane), GFP_KERNEL); + exynos_plane = kzalloc(sizeof(struct exynos_drm_plane), GFP_KERNEL); if (!exynos_plane) return ERR_PTR(-ENOMEM); @@ -285,7 +274,7 @@ struct drm_plane *exynos_plane_init(struct drm_device *dev, } if (type == DRM_PLANE_TYPE_PRIMARY) - exynos_plane->overlay.zpos = DEFAULT_ZPOS; + exynos_plane->zpos = DEFAULT_ZPOS; else exynos_plane_attach_zpos_property(&exynos_plane->base); |