drm/tegra: Remove duplicate framebuffer num_planes
authorDaniel Stone <daniels@collabora.com>
Fri, 30 Mar 2018 14:11:25 +0000 (15:11 +0100)
committerThierry Reding <treding@nvidia.com>
Thu, 17 May 2018 15:44:48 +0000 (17:44 +0200)
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>
drivers/gpu/drm/tegra/drm.h
drivers/gpu/drm/tegra/fb.c

index fe263cf58f343c3fac7ac9167f628d984c8103f5..61a4657e45fa481ea041b0845355376152764404 100644 (file)
@@ -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
index e69434909a4298469fb0b6010fdf440c0f471ff2..75badf37172170182c5a571f5f7538fda09b7b95 100644 (file)
@@ -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);