aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/sun4i/sun4i_drv.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-11-28 19:21:23 -0500
committerDave Airlie <airlied@redhat.com>2018-11-28 19:28:49 -0500
commit61647c77cb15354a329cbb36fe7a2253b36b51b1 (patch)
tree59d887f99bc4a2bdddc7cfc1d81794c2a4cdc759 /drivers/gpu/drm/sun4i/sun4i_drv.c
parent1a31c26ed7b495f152e3103dc7c68e3307a39541 (diff)
parent08f73d668048ffa3ba6b1426b6ba0a89b16aefd7 (diff)
Merge tag 'drm-misc-next-2018-11-28' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for v4.21: Core Changes: - Merge drm_info.c into drm_debugfs.c - Complete the fake drm_crtc_commit's hw_done/flip_done sooner. - Remove deprecated drm_obj_ref/unref functions. All drivers use get/put now. - Decrease stack use of drm_gem_prime_mmap. - Improve documentation for dumb callbacks. Driver Changes: - Add edid support to virtio. - Wait on implicit fence in meson and sun4i. - Add support for BGRX8888 to sun4i. - Preparation patches for sun4i driver to start supporting linear and tiled YUV formats. - Add support for HDMI 1.4 4k modes to meson, and support for VIC alternate timings. - Drop custom dumb_map in vkms. - Small fixes and cleanups to v3d. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/151a3270-b1be-ed75-bd58-6b29d741f592@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/sun4i/sun4i_drv.c')
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_drv.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
index ef773d36baf0..ccdeae6299eb 100644
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -28,6 +28,16 @@
28#include "sun4i_tcon.h" 28#include "sun4i_tcon.h"
29#include "sun8i_tcon_top.h" 29#include "sun8i_tcon_top.h"
30 30
31static int drm_sun4i_gem_dumb_create(struct drm_file *file_priv,
32 struct drm_device *drm,
33 struct drm_mode_create_dumb *args)
34{
35 /* The hardware only allows even pitches for YUV buffers. */
36 args->pitch = ALIGN(DIV_ROUND_UP(args->width * args->bpp, 8), 2);
37
38 return drm_gem_cma_dumb_create_internal(file_priv, drm, args);
39}
40
31DEFINE_DRM_GEM_CMA_FOPS(sun4i_drv_fops); 41DEFINE_DRM_GEM_CMA_FOPS(sun4i_drv_fops);
32 42
33static struct drm_driver sun4i_drv_driver = { 43static struct drm_driver sun4i_drv_driver = {
@@ -42,7 +52,7 @@ static struct drm_driver sun4i_drv_driver = {
42 .minor = 0, 52 .minor = 0,
43 53
44 /* GEM Operations */ 54 /* GEM Operations */
45 .dumb_create = drm_gem_cma_dumb_create, 55 .dumb_create = drm_sun4i_gem_dumb_create,
46 .gem_free_object_unlocked = drm_gem_cma_free_object, 56 .gem_free_object_unlocked = drm_gem_cma_free_object,
47 .gem_vm_ops = &drm_gem_cma_vm_ops, 57 .gem_vm_ops = &drm_gem_cma_vm_ops,
48 58