Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 444ac87b authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'exynos-drm-next-for-v4.18' of...

Merge tag 'exynos-drm-next-for-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next

- Add S5PV210 FIMD variant support.

- Add IPP v2 framework.
  . it is a rewritten version of the Exynos mem-to-mem image processing
    framework which supprts color space conversion, image up/down-scaling
    and rotation. This new version replaces existing userspace API with
    new easy-to-use and simple ones so we have already applied the use of
    these API to real user, Tizen Platform[1], and also makes existing
    Scaler, FIMC, GScaler and Rotator drivers to use IPP v2 core API.

    And below are patch lists we have applied to a real user,
    https://git.tizen.org/cgit/platform/adaptation/samsung_exynos/libtdm-exynos/log/?h=tizen&qt=grep&q=ipp
    https://git.tizen.org/cgit/platform/adaptation/samsung_exynos/libtdm-exynos/commit/?h=tizen&id=b59be207365d10efd489e6f71c8a045b558c44fe
    https://git.tizen.org/cgit/platform/kernel/linux-exynos/log/?h=tizen&qt=grep&q=ipp

    TDM(Tizen Display Manager) is a Display HAL for Tizen platform.
    Ps. Only real user using IPP API is Tizen.

    [1] https://www.tizen.org/



- Two cleanups
  . One is to just remove mode_set callback from MIPI-DSI driver
    because drm_display_mode data is already available from crtc
    atomic state.
  . And other is to just use new return type, vm_fault_t
    for page fault handler.

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

# gpg: Signature made Mon 14 May 2018 14:23:53 AEST
# gpg:                using RSA key 573834890C4312B8
# gpg: Can't check signature: public key not found
Link: https://patchwork.freedesktop.org/patch/msgid/1526276453-29879-1-git-send-email-inki.dae@samsung.com
parents ba72385b e8929999
Loading
Loading
Loading
Loading
+27 −0
Original line number Original line Diff line number Diff line
* Samsung Exynos Image Scaler

Required properties:
  - compatible : value should be one of the following:
	(a) "samsung,exynos5420-scaler" for Scaler IP in Exynos5420
	(b) "samsung,exynos5433-scaler" for Scaler IP in Exynos5433

  - reg : Physical base address of the IP registers and length of memory
	  mapped region.

  - interrupts : Interrupt specifier for scaler interrupt, according to format
		 specific to interrupt parent.

  - clocks : Clock specifier for scaler clock, according to generic clock
	     bindings. (See Documentation/devicetree/bindings/clock/exynos*.txt)

  - clock-names : Names of clocks. For exynos scaler, it should be "mscl"
		  on 5420 and "pclk", "aclk" and "aclk_xiu" on 5433.

Example:
	scaler@12800000 {
		compatible = "samsung,exynos5420-scaler";
		reg = <0x12800000 0x1294>;
		interrupts = <0 220 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&clock CLK_MSCL0>;
		clock-names = "mscl";
	};
+3 −1
Original line number Original line Diff line number Diff line
@@ -56,7 +56,9 @@ static int dumb_vga_get_modes(struct drm_connector *connector)
	}
	}


	drm_mode_connector_update_edid_property(connector, edid);
	drm_mode_connector_update_edid_property(connector, edid);
	return drm_add_edid_modes(connector, edid);
	ret = drm_add_edid_modes(connector, edid);
	kfree(edid);
	return ret;


fallback:
fallback:
	/*
	/*
+14 −4
Original line number Original line Diff line number Diff line
config DRM_EXYNOS
config DRM_EXYNOS
	tristate "DRM Support for Samsung SoC EXYNOS Series"
	tristate "DRM Support for Samsung SoC EXYNOS Series"
	depends on OF && DRM && (ARCH_S3C64XX || ARCH_EXYNOS || ARCH_MULTIPLATFORM)
	depends on OF && DRM && (ARCH_S3C64XX || ARCH_S5PV210 || ARCH_EXYNOS || ARCH_MULTIPLATFORM)
	select DRM_KMS_HELPER
	select DRM_KMS_HELPER
	select VIDEOMODE_HELPERS
	select VIDEOMODE_HELPERS
	select SND_SOC_HDMI_CODEC if SND_SOC
	select SND_SOC_HDMI_CODEC if SND_SOC
@@ -95,21 +95,31 @@ config DRM_EXYNOS_G2D
	help
	help
	  Choose this option if you want to use Exynos G2D for DRM.
	  Choose this option if you want to use Exynos G2D for DRM.


config DRM_EXYNOS_IPP
	bool

config DRM_EXYNOS_FIMC
config DRM_EXYNOS_FIMC
	bool "FIMC"
	bool "FIMC"
	depends on BROKEN && MFD_SYSCON
	select DRM_EXYNOS_IPP
	help
	help
	  Choose this option if you want to use Exynos FIMC for DRM.
	  Choose this option if you want to use Exynos FIMC for DRM.


config DRM_EXYNOS_ROTATOR
config DRM_EXYNOS_ROTATOR
	bool "Rotator"
	bool "Rotator"
	depends on BROKEN
	select DRM_EXYNOS_IPP
	help
	help
	  Choose this option if you want to use Exynos Rotator for DRM.
	  Choose this option if you want to use Exynos Rotator for DRM.


config DRM_EXYNOS_SCALER
	bool "Scaler"
	select DRM_EXYNOS_IPP
	help
	  Choose this option if you want to use Exynos Scaler for DRM.

config DRM_EXYNOS_GSC
config DRM_EXYNOS_GSC
	bool "GScaler"
	bool "GScaler"
	depends on BROKEN && ARCH_EXYNOS5 && VIDEO_SAMSUNG_EXYNOS_GSC=n
	depends on VIDEO_SAMSUNG_EXYNOS_GSC=n
	select DRM_EXYNOS_IPP
	help
	help
	  Choose this option if you want to use Exynos GSC for DRM.
	  Choose this option if you want to use Exynos GSC for DRM.


+2 −0
Original line number Original line Diff line number Diff line
@@ -18,8 +18,10 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_MIXER) += exynos_mixer.o
exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)	+= exynos_hdmi.o
exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)	+= exynos_hdmi.o
exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)	+= exynos_drm_vidi.o
exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)	+= exynos_drm_vidi.o
exynosdrm-$(CONFIG_DRM_EXYNOS_G2D)	+= exynos_drm_g2d.o
exynosdrm-$(CONFIG_DRM_EXYNOS_G2D)	+= exynos_drm_g2d.o
exynosdrm-$(CONFIG_DRM_EXYNOS_IPP)	+= exynos_drm_ipp.o
exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)	+= exynos_drm_fimc.o
exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)	+= exynos_drm_fimc.o
exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR)	+= exynos_drm_rotator.o
exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR)	+= exynos_drm_rotator.o
exynosdrm-$(CONFIG_DRM_EXYNOS_SCALER)	+= exynos_drm_scaler.o
exynosdrm-$(CONFIG_DRM_EXYNOS_GSC)	+= exynos_drm_gsc.o
exynosdrm-$(CONFIG_DRM_EXYNOS_GSC)	+= exynos_drm_gsc.o
exynosdrm-$(CONFIG_DRM_EXYNOS_MIC)     += exynos_drm_mic.o
exynosdrm-$(CONFIG_DRM_EXYNOS_MIC)     += exynos_drm_mic.o


+32 −3
Original line number Original line Diff line number Diff line
@@ -27,15 +27,23 @@
#include "exynos_drm_fb.h"
#include "exynos_drm_fb.h"
#include "exynos_drm_gem.h"
#include "exynos_drm_gem.h"
#include "exynos_drm_plane.h"
#include "exynos_drm_plane.h"
#include "exynos_drm_ipp.h"
#include "exynos_drm_vidi.h"
#include "exynos_drm_vidi.h"
#include "exynos_drm_g2d.h"
#include "exynos_drm_g2d.h"
#include "exynos_drm_iommu.h"
#include "exynos_drm_iommu.h"


#define DRIVER_NAME	"exynos"
#define DRIVER_NAME	"exynos"
#define DRIVER_DESC	"Samsung SoC DRM"
#define DRIVER_DESC	"Samsung SoC DRM"
#define DRIVER_DATE	"20110530"
#define DRIVER_DATE	"20180330"

/*
 * Interface history:
 *
 * 1.0 - Original version
 * 1.1 - Upgrade IPP driver to version 2.0
 */
#define DRIVER_MAJOR	1
#define DRIVER_MAJOR	1
#define DRIVER_MINOR	0
#define DRIVER_MINOR	1


static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
{
{
@@ -88,6 +96,16 @@ static const struct drm_ioctl_desc exynos_ioctls[] = {
			DRM_AUTH | DRM_RENDER_ALLOW),
			DRM_AUTH | DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(EXYNOS_G2D_EXEC, exynos_g2d_exec_ioctl,
	DRM_IOCTL_DEF_DRV(EXYNOS_G2D_EXEC, exynos_g2d_exec_ioctl,
			DRM_AUTH | DRM_RENDER_ALLOW),
			DRM_AUTH | DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_RESOURCES,
			exynos_drm_ipp_get_res_ioctl,
			DRM_AUTH | DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_CAPS, exynos_drm_ipp_get_caps_ioctl,
			DRM_AUTH | DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_LIMITS,
			exynos_drm_ipp_get_limits_ioctl,
			DRM_AUTH | DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(EXYNOS_IPP_COMMIT, exynos_drm_ipp_commit_ioctl,
			DRM_AUTH | DRM_RENDER_ALLOW),
};
};


static const struct file_operations exynos_drm_driver_fops = {
static const struct file_operations exynos_drm_driver_fops = {
@@ -184,6 +202,7 @@ struct exynos_drm_driver_info {
#define DRM_COMPONENT_DRIVER	BIT(0)	/* supports component framework */
#define DRM_COMPONENT_DRIVER	BIT(0)	/* supports component framework */
#define DRM_VIRTUAL_DEVICE	BIT(1)	/* create virtual platform device */
#define DRM_VIRTUAL_DEVICE	BIT(1)	/* create virtual platform device */
#define DRM_DMA_DEVICE		BIT(2)	/* can be used for dma allocations */
#define DRM_DMA_DEVICE		BIT(2)	/* can be used for dma allocations */
#define DRM_FIMC_DEVICE		BIT(3)	/* devices shared with V4L2 subsystem */


#define DRV_PTR(drv, cond) (IS_ENABLED(cond) ? &drv : NULL)
#define DRV_PTR(drv, cond) (IS_ENABLED(cond) ? &drv : NULL)


@@ -223,10 +242,16 @@ static struct exynos_drm_driver_info exynos_drm_drivers[] = {
		DRV_PTR(g2d_driver, CONFIG_DRM_EXYNOS_G2D),
		DRV_PTR(g2d_driver, CONFIG_DRM_EXYNOS_G2D),
	}, {
	}, {
		DRV_PTR(fimc_driver, CONFIG_DRM_EXYNOS_FIMC),
		DRV_PTR(fimc_driver, CONFIG_DRM_EXYNOS_FIMC),
		DRM_COMPONENT_DRIVER | DRM_FIMC_DEVICE,
	}, {
	}, {
		DRV_PTR(rotator_driver, CONFIG_DRM_EXYNOS_ROTATOR),
		DRV_PTR(rotator_driver, CONFIG_DRM_EXYNOS_ROTATOR),
		DRM_COMPONENT_DRIVER
	}, {
		DRV_PTR(scaler_driver, CONFIG_DRM_EXYNOS_SCALER),
		DRM_COMPONENT_DRIVER
	}, {
	}, {
		DRV_PTR(gsc_driver, CONFIG_DRM_EXYNOS_GSC),
		DRV_PTR(gsc_driver, CONFIG_DRM_EXYNOS_GSC),
		DRM_COMPONENT_DRIVER
	}, {
	}, {
		&exynos_drm_platform_driver,
		&exynos_drm_platform_driver,
		DRM_VIRTUAL_DEVICE
		DRM_VIRTUAL_DEVICE
@@ -254,7 +279,11 @@ static struct component_match *exynos_drm_match_add(struct device *dev)
					    &info->driver->driver,
					    &info->driver->driver,
					    (void *)platform_bus_type.match))) {
					    (void *)platform_bus_type.match))) {
			put_device(p);
			put_device(p);
			component_match_add(dev, &match, compare_dev, d);

			if (!(info->flags & DRM_FIMC_DEVICE) ||
			    exynos_drm_check_fimc_device(d) == 0)
				component_match_add(dev, &match,
						    compare_dev, d);
			p = d;
			p = d;
		}
		}
		put_device(p);
		put_device(p);
Loading