Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2019-05-14 09:15:41 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2019-05-14 09:59:48 +0200
commit4a07be1c5f17dd97e87ff6dc934c7b58b5ad067d (patch)
treeacfedafe46a95555817271e36ab59190dd52c58e
parent25e583cd95975669790bef940dd4551462e15e22 (diff)
drm/meson: add size and alignment requirements for dumb buffers (bnc#1113722)
-rw-r--r--patches.drm/0005-drm-meson-add-size-and-alignment-requirements-for-du.patch53
-rw-r--r--series.conf1
2 files changed, 54 insertions, 0 deletions
diff --git a/patches.drm/0005-drm-meson-add-size-and-alignment-requirements-for-du.patch b/patches.drm/0005-drm-meson-add-size-and-alignment-requirements-for-du.patch
new file mode 100644
index 0000000000..65e89c9db0
--- /dev/null
+++ b/patches.drm/0005-drm-meson-add-size-and-alignment-requirements-for-du.patch
@@ -0,0 +1,53 @@
+From 852ce7285c99e3f7b56e76511e1b33c645a2b648 Mon Sep 17 00:00:00 2001
+From: Neil Armstrong <narmstrong@baylibre.com>
+Date: Mon, 8 Apr 2019 11:01:37 +0200
+Subject: drm/meson: add size and alignment requirements for dumb buffers
+Git-commit: 852ce7285c99e3f7b56e76511e1b33c645a2b648
+Patch-mainline: v5.2-rc1
+References: bnc#1113722
+
+The Amlogic SoCs Canvas buffers stride must be aligned on 64bytes
+and overall size should be aligned on PAGE width.
+
+Adds a custom dumb_create op to adds these requirements.
+
+Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller")
+Suggested-by: Sky Zhou <sky.zhou@amlogic.com>
+Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
+Reviewed-by: Sky Zhou <sky.zhou@amlogic.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20190408090137.2402-1-narmstrong@baylibre.com
+Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
+---
+ drivers/gpu/drm/meson/meson_drv.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/meson/meson_drv.c
++++ b/drivers/gpu/drm/meson/meson_drv.c
+@@ -93,6 +93,18 @@ static irqreturn_t meson_irq(int irq, vo
+ 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 = {
+@@ -115,7 +127,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,
+ .dumb_destroy = drm_gem_dumb_destroy,
+ .dumb_map_offset = drm_gem_cma_dumb_map_offset,
+ .gem_free_object_unlocked = drm_gem_cma_free_object,
diff --git a/series.conf b/series.conf
index 335c5dd47a..1c9256560f 100644
--- a/series.conf
+++ b/series.conf
@@ -21817,6 +21817,7 @@
patches.drm/drm-i915-Fix-I915_EXEC_RING_MASK.patch
patches.drm/drm-fb-helper-dpms_legacy-Only-set-on-connectors-in-.patch
patches.drm/0004-drm-i915-gvt-Fix-incorrect-mask-of-mmio-0x22028-in-g.patch
+ patches.drm/0005-drm-meson-add-size-and-alignment-requirements-for-du.patch
patches.drm/drm-rockchip-shutdown-drm-subsystem-on-shutdown.patch
patches.drivers/ALSA-timer-Unify-timer-callback-process-code.patch
patches.drivers/ALSA-timer-Make-sure-to-clear-pending-ack-list.patch