Merge tag 'drm-misc-next-2019-04-18' of git://anongit.freedesktop.org/drm/drm-misc...
[sfrench/cifs-2.6.git] / drivers / gpu / drm / meson / meson_drv.c
index faf1b1b0357cdf13d7f307cc3469687adf48ff0f..72b01e6be0d9da2d74bbb430cfe07c757625971b 100644 (file)
@@ -90,6 +90,18 @@ static irqreturn_t meson_irq(int irq, void *arg)
        return IRQ_HANDLED;
 }
 
+static int meson_dumb_create(struct drm_file *file, struct drm_device *dev,
+                            struct drm_mode_create_dumb *args)
+{
+       /*
+        * We need 64bytes aligned stride, and PAGE aligned size
+        */
+       args->pitch = ALIGN(DIV_ROUND_UP(args->width * args->bpp, 8), SZ_64);
+       args->size = PAGE_ALIGN(args->pitch * args->height);
+
+       return drm_gem_cma_dumb_create_internal(file, dev, args);
+}
+
 DEFINE_DRM_GEM_CMA_FOPS(fops);
 
 static struct drm_driver meson_driver = {
@@ -112,7 +124,7 @@ static struct drm_driver meson_driver = {
        .gem_prime_mmap         = drm_gem_cma_prime_mmap,
 
        /* GEM Ops */
-       .dumb_create            = drm_gem_cma_dumb_create,
+       .dumb_create            = meson_dumb_create,
        .gem_free_object_unlocked = drm_gem_cma_free_object,
        .gem_vm_ops             = &drm_gem_cma_vm_ops,