From 9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 Mon Sep 17 00:00:00 2001 From: Yunhong Jiang Date: Tue, 4 Aug 2015 12:17:53 -0700 Subject: Add the rt linux 4.1.3-rt3 as base Import the rt linux 4.1.3-rt3 as OPNFV kvm base. It's from git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-4.1.y-rt and the base is: commit 0917f823c59692d751951bf5ea699a2d1e2f26a2 Author: Sebastian Andrzej Siewior Date: Sat Jul 25 12:13:34 2015 +0200 Prepare v4.1.3-rt3 Signed-off-by: Sebastian Andrzej Siewior We lose all the git history this way and it's not good. We should apply another opnfv project repo in future. Change-Id: I87543d81c9df70d99c5001fbdf646b202c19f423 Signed-off-by: Yunhong Jiang --- kernel/drivers/gpu/drm/shmobile/Kconfig | 15 + kernel/drivers/gpu/drm/shmobile/Makefile | 7 + .../drivers/gpu/drm/shmobile/shmob_drm_backlight.c | 90 +++ .../drivers/gpu/drm/shmobile/shmob_drm_backlight.h | 23 + kernel/drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 757 +++++++++++++++++++++ kernel/drivers/gpu/drm/shmobile/shmob_drm_crtc.h | 60 ++ kernel/drivers/gpu/drm/shmobile/shmob_drm_drv.c | 360 ++++++++++ kernel/drivers/gpu/drm/shmobile/shmob_drm_drv.h | 47 ++ kernel/drivers/gpu/drm/shmobile/shmob_drm_kms.c | 160 +++++ kernel/drivers/gpu/drm/shmobile/shmob_drm_kms.h | 34 + kernel/drivers/gpu/drm/shmobile/shmob_drm_plane.c | 263 +++++++ kernel/drivers/gpu/drm/shmobile/shmob_drm_plane.h | 22 + kernel/drivers/gpu/drm/shmobile/shmob_drm_regs.h | 311 +++++++++ 13 files changed, 2149 insertions(+) create mode 100644 kernel/drivers/gpu/drm/shmobile/Kconfig create mode 100644 kernel/drivers/gpu/drm/shmobile/Makefile create mode 100644 kernel/drivers/gpu/drm/shmobile/shmob_drm_backlight.c create mode 100644 kernel/drivers/gpu/drm/shmobile/shmob_drm_backlight.h create mode 100644 kernel/drivers/gpu/drm/shmobile/shmob_drm_crtc.c create mode 100644 kernel/drivers/gpu/drm/shmobile/shmob_drm_crtc.h create mode 100644 kernel/drivers/gpu/drm/shmobile/shmob_drm_drv.c create mode 100644 kernel/drivers/gpu/drm/shmobile/shmob_drm_drv.h create mode 100644 kernel/drivers/gpu/drm/shmobile/shmob_drm_kms.c create mode 100644 kernel/drivers/gpu/drm/shmobile/shmob_drm_kms.h create mode 100644 kernel/drivers/gpu/drm/shmobile/shmob_drm_plane.c create mode 100644 kernel/drivers/gpu/drm/shmobile/shmob_drm_plane.h create mode 100644 kernel/drivers/gpu/drm/shmobile/shmob_drm_regs.h (limited to 'kernel/drivers/gpu/drm/shmobile') diff --git a/kernel/drivers/gpu/drm/shmobile/Kconfig b/kernel/drivers/gpu/drm/shmobile/Kconfig new file mode 100644 index 000000000..b9202aa6f --- /dev/null +++ b/kernel/drivers/gpu/drm/shmobile/Kconfig @@ -0,0 +1,15 @@ +config DRM_SHMOBILE + tristate "DRM Support for SH Mobile" + depends on DRM && ARM && HAVE_DMA_ATTRS + depends on ARCH_SHMOBILE || COMPILE_TEST + depends on FB_SH_MOBILE_MERAM || !FB_SH_MOBILE_MERAM + select BACKLIGHT_CLASS_DEVICE + select BACKLIGHT_LCD_SUPPORT + select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER + select DRM_KMS_CMA_HELPER + select DRM_GEM_CMA_HELPER + help + Choose this option if you have an SH Mobile chipset. + If M is selected the module will be called shmob-drm. + diff --git a/kernel/drivers/gpu/drm/shmobile/Makefile b/kernel/drivers/gpu/drm/shmobile/Makefile new file mode 100644 index 000000000..4c3eeb355 --- /dev/null +++ b/kernel/drivers/gpu/drm/shmobile/Makefile @@ -0,0 +1,7 @@ +shmob-drm-y := shmob_drm_backlight.o \ + shmob_drm_crtc.o \ + shmob_drm_drv.o \ + shmob_drm_kms.o \ + shmob_drm_plane.o + +obj-$(CONFIG_DRM_SHMOBILE) += shmob-drm.o diff --git a/kernel/drivers/gpu/drm/shmobile/shmob_drm_backlight.c b/kernel/drivers/gpu/drm/shmobile/shmob_drm_backlight.c new file mode 100644 index 000000000..33dd41afe --- /dev/null +++ b/kernel/drivers/gpu/drm/shmobile/shmob_drm_backlight.c @@ -0,0 +1,90 @@ +/* + * shmob_drm_backlight.c -- SH Mobile DRM Backlight + * + * Copyright (C) 2012 Renesas Electronics Corporation + * + * Laurent Pinchart (laurent.pinchart@ideasonboard.com) + * + * 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. + */ + +#include + +#include "shmob_drm_backlight.h" +#include "shmob_drm_crtc.h" +#include "shmob_drm_drv.h" + +static int shmob_drm_backlight_update(struct backlight_device *bdev) +{ + struct shmob_drm_connector *scon = bl_get_data(bdev); + struct shmob_drm_device *sdev = scon->connector.dev->dev_private; + const struct shmob_drm_backlight_data *bdata = &sdev->pdata->backlight; + int brightness = bdev->props.brightness; + + if (bdev->props.power != FB_BLANK_UNBLANK || + bdev->props.state & BL_CORE_SUSPENDED) + brightness = 0; + + return bdata->set_brightness(brightness); +} + +static int shmob_drm_backlight_get_brightness(struct backlight_device *bdev) +{ + struct shmob_drm_connector *scon = bl_get_data(bdev); + struct shmob_drm_device *sdev = scon->connector.dev->dev_private; + const struct shmob_drm_backlight_data *bdata = &sdev->pdata->backlight; + + return bdata->get_brightness(); +} + +static const struct backlight_ops shmob_drm_backlight_ops = { + .options = BL_CORE_SUSPENDRESUME, + .update_status = shmob_drm_backlight_update, + .get_brightness = shmob_drm_backlight_get_brightness, +}; + +void shmob_drm_backlight_dpms(struct shmob_drm_connector *scon, int mode) +{ + if (scon->backlight == NULL) + return; + + scon->backlight->props.power = mode == DRM_MODE_DPMS_ON + ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN; + backlight_update_status(scon->backlight); +} + +int shmob_drm_backlight_init(struct shmob_drm_connector *scon) +{ + struct shmob_drm_device *sdev = scon->connector.dev->dev_private; + const struct shmob_drm_backlight_data *bdata = &sdev->pdata->backlight; + struct drm_connector *connector = &scon->connector; + struct drm_device *dev = connector->dev; + struct backlight_device *backlight; + + if (!bdata->max_brightness) + return 0; + + backlight = backlight_device_register(bdata->name, dev->dev, scon, + &shmob_drm_backlight_ops, NULL); + if (IS_ERR(backlight)) { + dev_err(dev->dev, "unable to register backlight device: %ld\n", + PTR_ERR(backlight)); + return PTR_ERR(backlight); + } + + backlight->props.max_brightness = bdata->max_brightness; + backlight->props.brightness = bdata->max_brightness; + backlight->props.power = FB_BLANK_POWERDOWN; + backlight_update_status(backlight); + + scon->backlight = backlight; + return 0; +} + +void shmob_drm_backlight_exit(struct shmob_drm_connector *scon) +{ + backlight_device_unregister(scon->backlight); +} diff --git a/kernel/drivers/gpu/drm/shmobile/shmob_drm_backlight.h b/kernel/drivers/gpu/drm/shmobile/shmob_drm_backlight.h new file mode 100644 index 000000000..bac719ecc --- /dev/null +++ b/kernel/drivers/gpu/drm/shmobile/shmob_drm_backlight.h @@ -0,0 +1,23 @@ +/* + * shmob_drm_backlight.h -- SH Mobile DRM Backlight + * + * Copyright (C) 2012 Renesas Electronics Corporation + * + * Laurent Pinchart (laurent.pinchart@ideasonboard.com) + * + * 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. + */ + +#ifndef __SHMOB_DRM_BACKLIGHT_H__ +#define __SHMOB_DRM_BACKLIGHT_H__ + +struct shmob_drm_connector; + +void shmob_drm_backlight_dpms(struct shmob_drm_connector *scon, int mode); +int shmob_drm_backlight_init(struct shmob_drm_connector *scon); +void shmob_drm_backlight_exit(struct shmob_drm_connector *scon); + +#endif /* __SHMOB_DRM_BACKLIGHT_H__ */ diff --git a/kernel/drivers/gpu/drm/shmobile/shmob_drm_crtc.c b/kernel/drivers/gpu/drm/shmobile/shmob_drm_crtc.c new file mode 100644 index 000000000..859ccb658 --- /dev/null +++ b/kernel/drivers/gpu/drm/shmobile/shmob_drm_crtc.c @@ -0,0 +1,757 @@ +/* + * shmob_drm_crtc.c -- SH Mobile DRM CRTCs + * + * Copyright (C) 2012 Renesas Electronics Corporation + * + * Laurent Pinchart (laurent.pinchart@ideasonboard.com) + * + * 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. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include