From 680e627d616d51d062ab83a6818dfdb3771cacc0 Mon Sep 17 00:00:00 2001 From: Meng Mingming Date: Mon, 14 Aug 2017 13:46:21 +0800 Subject: [PATCH] MLK-15321 drm,imx: Add DRM support for dpu-blit This patch adds DRM support for the blit engine, allowing DRM_RENDER_ALLOW ioctls() to be registered dynamically. Signed-off-by: Adrian Negreanu Signed-off-by: Marius Vlad Signed-off-by: Meng Mingming --- Changes since v3: Added support for registering DRM_RENDER ioctls dynamically, by replacing fops ioctl to a routed one (provided by drm core), where we get the chance to verify in the list of previously registered ioctls for a blit ioctls. --- drivers/gpu/drm/imx/dpu/Makefile | 3 + drivers/gpu/drm/imx/dpu/dpu-blit.c | 270 +++++++++++++++++++++++++++++ drivers/gpu/drm/imx/imx-drm-core.c | 96 +++++++++- drivers/gpu/drm/imx/imx-drm.h | 9 + include/uapi/drm/imx_drm.h | 73 ++++++++ 5 files changed, 449 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/drm/imx/dpu/dpu-blit.c create mode 100644 include/uapi/drm/imx_drm.h diff --git a/drivers/gpu/drm/imx/dpu/Makefile b/drivers/gpu/drm/imx/dpu/Makefile index f29915ff8fb8..c09e487aa5c2 100644 --- a/drivers/gpu/drm/imx/dpu/Makefile +++ b/drivers/gpu/drm/imx/dpu/Makefile @@ -2,3 +2,6 @@ ccflags-y += -Idrivers/gpu/drm/imx imx-dpu-crtc-objs := dpu-crtc.o dpu-plane.o dpu-kms.o obj-$(CONFIG_DRM_IMX_DPU) += imx-dpu-crtc.o + +imx-dpu-render-objs := dpu-blit.o +obj-$(CONFIG_DRM_IMX_DPU) += imx-dpu-render.o diff --git a/drivers/gpu/drm/imx/dpu/dpu-blit.c b/drivers/gpu/drm/imx/dpu/dpu-blit.c new file mode 100644 index 000000000000..6fed8f4f7aaa --- /dev/null +++ b/drivers/gpu/drm/imx/dpu/dpu-blit.c @@ -0,0 +1,270 @@ +/* + * Copyright 2017 NXP + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include