From: yzq Date: Wed, 26 Mar 2014 03:48:43 +0000 (+0800) Subject: rk3288 chromium: drm grafic fb support for x11 mali gpu X-Git-Tag: firefly_0821_release~5825 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bdafdac384d56555736584775236dbd817a1cdda;p=firefly-linux-kernel-4.4.55.git rk3288 chromium: drm grafic fb support for x11 mali gpu --- diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index b16c50ee769c..35a7b0fb073f 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -201,6 +201,8 @@ config DRM_SAVAGE source "drivers/gpu/drm/exynos/Kconfig" +source "drivers/gpu/drm/rockchip/Kconfig" + source "drivers/gpu/drm/vmwgfx/Kconfig" source "drivers/gpu/drm/gma500/Kconfig" diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 1c9f24396002..d7a431945e0b 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -45,6 +45,7 @@ obj-$(CONFIG_DRM_VMWGFX)+= vmwgfx/ obj-$(CONFIG_DRM_VIA) +=via/ obj-$(CONFIG_DRM_NOUVEAU) +=nouveau/ obj-$(CONFIG_DRM_EXYNOS) +=exynos/ +obj-$(CONFIG_DRM_ROCKCHIP) +=rockchip/ obj-$(CONFIG_DRM_GMA500) += gma500/ obj-$(CONFIG_DRM_UDL) += udl/ obj-$(CONFIG_DRM_AST) += ast/ diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 8759d699bd8e..ad4c73425995 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -3461,7 +3461,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, ret = -ENOSPC; goto out; } - + fb->pixel_format = crtc->fb->pixel_format; if (crtc->fb->pixel_format != fb->pixel_format) { DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n"); ret = -EINVAL; diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 16f3ec579b3b..e892bcbe188c 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c @@ -37,7 +37,7 @@ #include #include -unsigned int drm_debug = 0; /* 1 to enable debug output */ +unsigned int drm_debug = 0xf; /* 1 to enable debug output */ EXPORT_SYMBOL(drm_debug); unsigned int drm_vblank_offdelay = 5000; /* Default to 5000 msecs. */ diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig new file mode 100644 index 000000000000..3c7efc47f45a --- /dev/null +++ b/drivers/gpu/drm/rockchip/Kconfig @@ -0,0 +1,54 @@ +config DRM_ROCKCHIP + tristate "DRM Support for ROCKCHIP " + depends on DRM && ARCH_MULTIPLATFORM + select DRM_KMS_HELPER + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + select VT_HW_CONSOLE_BINDING if FRAMEBUFFER_CONSOLE + help + Choose this option if you have a ROCKCHIP soc chipset. + If M is selected the module will be called rockchipdrm. + +config DRM_ROCKCHIP_IOMMU + bool "ROCKCHIP DRM IOMMU Support" + depends on DRM_ROCKCHIP && ARM_DMA_USE_IOMMU + help + Choose this option if you want to use IOMMU feature for DRM. + +config DRM_ROCKCHIP_DMABUF + bool "ROCKCHIP DRM DMABUF" + depends on DRM_ROCKCHIP + help + Choose this option if you want to use DMABUF feature for DRM. + +config DRM_RK3188_FIMD + bool "RK3188 DRM FIMD" + depends on OF && DRM_ROCKCHIP + select FB_MODE_HELPERS + select VIDEOMODE_HELPERS + help + Choose this option if you want to use Rockchip FIMD for DRM. + +config DRM_RK3288_FIMD + bool "RK3288 DRM FIMD" + depends on OF && DRM_ROCKCHIP + select FB_MODE_HELPERS + select VIDEOMODE_HELPERS + help + Choose this option if you want to use Rockchip FIMD for DRM. + + +config DRM_ROCKCHIP_HDMI + bool "Rockchip DRM HDMI" + depends on DRM_ROCKCHIP + help + Choose this option if you want to use Rockchip HDMI for DRM. + +config DRM_ROCKCHIP_VIDI + bool "Rockchip DRM Virtual Display" + depends on DRM_ROCKCHIP + help + Choose this option if you want to use rockchip VIDI for DRM. + +source "drivers/gpu/drm/rockchip/screen/Kconfig" diff --git a/drivers/gpu/drm/rockchip/Makefile b/drivers/gpu/drm/rockchip/Makefile new file mode 100644 index 000000000000..ad6e460a6a79 --- /dev/null +++ b/drivers/gpu/drm/rockchip/Makefile @@ -0,0 +1,22 @@ +# +# Makefile for the drm device driver. This driver provides support for the +# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. + +ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/rockchip +rockchipdrm-y := rockchip_drm_drv.o rockchip_drm_encoder.o rockchip_drm_connector.o \ + rockchip_drm_crtc.o rockchip_drm_fbdev.o rockchip_drm_fb.o \ + rockchip_drm_buf.o rockchip_drm_gem.o rockchip_drm_core.o \ + rockchip_drm_plane.o + +rockchipdrm-$(CONFIG_DRM_ROCKCHIP_IOMMU) += rockchip_drm_iommu.o +rockchipdrm-$(CONFIG_DRM_ROCKCHIP_DMABUF) += rockchip_drm_dmabuf.o +rockchipdrm-$(CONFIG_DRM_RK3188_FIMD) += rk3188_drm_fimd.o +rockchipdrm-$(CONFIG_DRM_RK3288_FIMD) += rk3288_drm_fimd.o +rockchipdrm-$(CONFIG_DRM_ROCKCHIP_HDMI) += rockchip_hdmi.o rockchip_mixer.o \ + rockchip_ddc.o rockchip_hdmiphy.o \ + rockchip_drm_hdmi.o +rockchipdrm-$(CONFIG_DRM_ROCKCHIP_VIDI) += rockchip_drm_vidi.o + +obj-$(CONFIG_DRM_ROCKCHIP) += rockchipdrm.o +obj-y += screen/ +obj-y += transmitter/ diff --git a/drivers/gpu/drm/rockchip/rk3188_drm_fimd.c b/drivers/gpu/drm/rockchip/rk3188_drm_fimd.c new file mode 100644 index 000000000000..bbcd12a96490 --- /dev/null +++ b/drivers/gpu/drm/rockchip/rk3188_drm_fimd.c @@ -0,0 +1,1170 @@ +/* + * rk3188_drm_fimd.c + * + * Copyright (C) ROCKCHIP, Inc. + * Author:yzq + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * 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