summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2018-03-30 16:11:25 +0200
committerThierry Reding <treding@nvidia.com>2018-05-17 17:44:48 +0200
commite1189921b5ff9dcfec52b21cf12bb52c5dccd34d (patch)
tree5f07dcbec1db0bbdda2ce9e98999824dbf13aae2 /drivers/gpu
parentdrm/tegra: Adding new typedef vm_fault_t (diff)
downloadlinux-e1189921b5ff9dcfec52b21cf12bb52c5dccd34d.tar.xz
linux-e1189921b5ff9dcfec52b21cf12bb52c5dccd34d.zip
drm/tegra: Remove duplicate framebuffer num_planes
drm_framebuffer already stores num_planes for us. Signed-off-by: Daniel Stone <daniels@collabora.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: linux-tegra@vger.kernel.org Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/tegra/drm.h1
-rw-r--r--drivers/gpu/drm/tegra/fb.c6
2 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h
index fe263cf58f34..61a4657e45fa 100644
--- a/drivers/gpu/drm/tegra/drm.h
+++ b/drivers/gpu/drm/tegra/drm.h
@@ -32,7 +32,6 @@ struct reset_control;
struct tegra_fb {
struct drm_framebuffer base;
struct tegra_bo **planes;
- unsigned int num_planes;
};
#ifdef CONFIG_DRM_FBDEV_EMULATION
diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c
index e69434909a42..75badf371721 100644
--- a/drivers/gpu/drm/tegra/fb.c
+++ b/drivers/gpu/drm/tegra/fb.c
@@ -107,7 +107,7 @@ static void tegra_fb_destroy(struct drm_framebuffer *framebuffer)
struct tegra_fb *fb = to_tegra_fb(framebuffer);
unsigned int i;
- for (i = 0; i < fb->num_planes; i++) {
+ for (i = 0; i < framebuffer->format->num_planes; i++) {
struct tegra_bo *bo = fb->planes[i];
if (bo) {
@@ -155,11 +155,9 @@ static struct tegra_fb *tegra_fb_alloc(struct drm_device *drm,
return ERR_PTR(-ENOMEM);
}
- fb->num_planes = num_planes;
-
drm_helper_mode_fill_fb_struct(drm, &fb->base, mode_cmd);
- for (i = 0; i < fb->num_planes; i++)
+ for (i = 0; i < fb->base.format->num_planes; i++)
fb->planes[i] = planes[i];
err = drm_framebuffer_init(drm, &fb->base, &tegra_fb_funcs);