[PATCHv4 15/36] drm/komeda: Make komeda_fb_none_size_check independent from framebuffer

Andrzej Pietrasiewicz
2019-12-13T21:24:58Z

All necessary data is now available in other data structures.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
---
drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
index d4e0df00180e..07520cec6fbd 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
@@ -99,13 +99,11 @@ komeda_fb_afbc_size_check(struct komeda_fb *kfb,

static int
komeda_fb_none_afbc_size_check(struct komeda_dev *mdev,
- struct komeda_fb *kfb,
const struct drm_format_info *info,
struct drm_gem_object **objs,
struct drm_file *file,
const struct drm_mode_fb_cmd2 *mode_cmd)
{
- struct drm_framebuffer *fb = &kfb->base;
struct drm_gem_object *obj;
u32 i, block_h;
u64 min_size;
@@ -114,9 +112,10 @@ komeda_fb_none_afbc_size_check(struct komeda_dev *mdev,
obj = objs[i];

block_h = drm_format_info_block_height(info, i);
- if ((fb->pitches[i] * block_h) % mdev->chip.bus_width) {
+ if ((mode_cmd->pitches[i] * block_h) % mdev->chip.bus_width) {
DRM_DEBUG_KMS("Pitch[%d]: 0x%x doesn't align to 0x%x\n",
- i, fb->pitches[i], mdev->chip.bus_width);
+ i, mode_cmd->pitches[i],
+ mdev->chip.bus_width);
return -EINVAL;
}

@@ -184,7 +183,7 @@ komeda_fb_create(struct drm_device *dev, struct drm_file *file,
return ERR_PTR(ret);
}

- ret = komeda_fb_none_afbc_size_check(mdev, kfb, info, objs,
+ ret = komeda_fb_none_afbc_size_check(mdev, info, objs,
file, mode_cmd);
for (i = 0; i < info->num_planes; ++i)
kfb->base.obj[i] = objs[i];