[PATCH 0/8] drm: msm: module rework

2016-02-22 Thread Arnd Bergmann
On Monday 22 February 2016 17:36:36 Rob Clark wrote:
> On Mon, Feb 22, 2016 at 4:08 PM, Arnd Bergmann  wrote:
> > I saw some regressions on today's Linux-next kernel after
> > the Makefiles got reworked and tried to come up with a quick
> > fix. This ended up taking much longer, but the new version should
> > be cleaner and I no longer get any build errors in this
> > driver.
> 
> fyi, for the time being, I've already kicked out the kconfig/makefile
> splitup patches..
> 
> I'll go ahead and pull in the hdmi symbol rename patch, since that is
> a sane thing to do.

Ok, thanks

>  I'm less sure about splitting things up into separate .ko's.

I think it's generally a good idea to split it up like that, though
it could be taken a little further. Having one .ko file per
platform_driver seems to be a very sensible split here, the
main advantage being that you enforce a strict layering between
the subdrivers.

>  And I think having the .ko name not match the drm
> driver name (ie. what is passed in to drmOpen() in userspace) would
> cause issues since libdrm could try to modprobe $drivername.ko.  (I
> *think* that only matters in the non-udev case?  Which is at least not
> a common case, but breaking userspace is breaking userspace...)

Ah, I see. Yes, that is unfortunate, but patch 2 then definitely has
to be dropped even if you decide to take the others.

With udev, the autoloading purely depends on the MODULE_DEVICE_TABLE
in the top module, which should work fine, and without patch 2, all
the other drivers get loaded automatically when the main driver
gets probed.

Arnd


[Bug 94231] Problems compiling libdrm since glibc 2.23

2016-02-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=94231

Mike Frysinger  changed:

   What|Removed |Added

 CC||vapier at gentoo.org

--- Comment #12 from Mike Frysinger  ---
it's really not that difficult to test for & include the sys/sysmacros.h header
directly when you're using the non-standard functions they provide.  this is
the API under BSD systems, and where Linux C libs have already moved/are moving
towards.  *this* is the deprecation period.

upstream glibc will take a more measured approach including updating their
docs, but realistically, no one is going to read those until they see breakage.
 the Gentoo changes are only in an opt-in dev-only build, so it too isn't
hitting people randomly.

as the upstream thread shows, if you used the (long time documented)
AC_HEADER_MAJOR macro in autoconf, then this wouldn't have impacted drm.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/c061aadb/attachment.html>


[Bug 93217] [tonga] [powerplay] Radon M395X isn't initialised with the powerplay branch

2016-02-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=93217

--- Comment #31 from Mike Lothian  ---
Sorry I'm a wee bit confused at what you'd like me to do

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/1a9600b2/attachment.html>


[PATCH] drm/layerscape: reduce excessive stack usage

2016-02-22 Thread Arnd Bergmann
The fsl-dcu driver copies a drm_mode_config object to its
stack but then only accesses a single member (dpms_property)
once. The data structure is large enough to trigger a warning
about the amount of kernel stack being used:

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c: In function 
'fsl_dcu_drm_connector_create':
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c:182:1: error: the frame size of 1040 
bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

This changes the fsl_dcu_drm_connector_create() function to
only access the drm_mode_config by reference, which is also
more efficient.

Signed-off-by: Arnd Bergmann 
Fixes: 109eee2f2a18 ("drm/layerscape: Add Freescale DCU DRM driver")
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c 
b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
index 8780deba5e8a..92149152db44 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
@@ -131,7 +131,7 @@ int fsl_dcu_drm_connector_create(struct fsl_dcu_drm_device 
*fsl_dev,
 struct drm_encoder *encoder)
 {
struct drm_connector *connector = &fsl_dev->connector.base;
-   struct drm_mode_config mode_config = fsl_dev->drm->mode_config;
+   struct drm_mode_config *mode_config = &fsl_dev->drm->mode_config;
struct device_node *panel_node;
int ret;

@@ -153,7 +153,7 @@ int fsl_dcu_drm_connector_create(struct fsl_dcu_drm_device 
*fsl_dev,
goto err_sysfs;

drm_object_property_set_value(&connector->base,
- mode_config.dpms_property,
+ mode_config->dpms_property,
  DRM_MODE_DPMS_OFF);

panel_node = of_parse_phandle(fsl_dev->np, "fsl,panel", 0);
-- 
2.7.0



[PATCH 8/8] drm: msm: separate out module driver registration

2016-02-22 Thread Arnd Bergmann
The msm driver currently has a single module_init() function but
consists of multiple modules that each register a platform driver.

This changes the msm_drm_register() function to not call the
other functions but instead rely on module load order and/or
link order to ensure that the other modules were probed earlier.

The patch is not tested but should not change behavior.

Signed-off-by: Arnd Bergmann 
---
 drivers/gpu/drm/msm/dsi/dsi.c | 17 -
 drivers/gpu/drm/msm/dsi/phy/dsi_phy.c |  2 +-
 drivers/gpu/drm/msm/edp/edp.c | 15 +--
 drivers/gpu/drm/msm/hdmi/hdmi.c   | 16 +++-
 drivers/gpu/drm/msm/hdmi/hdmi.h   |  2 +-
 drivers/gpu/drm/msm/hdmi/hdmi_phy.c   |  2 +-
 drivers/gpu/drm/msm/msm_drv.c |  6 --
 drivers/gpu/drm/msm/msm_drv.h | 28 
 8 files changed, 27 insertions(+), 61 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index 8523a7cdc419..db260814dfff 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -172,21 +172,28 @@ static struct platform_driver dsi_driver = {
},
 };

-void __init msm_dsi_register(void)
+static int __init msm_dsi_register(void)
 {
+   int ret;
+
DBG("");
msm_dsi_phy_driver_register();
-   platform_driver_register(&dsi_driver);
+   ret = platform_driver_register(&dsi_driver);
+
+   if (ret)
+   msm_dsi_phy_driver_unregister();
+
+   return ret;
 }
-EXPORT_SYMBOL_GPL(msm_dsi_register);
+module_init(msm_dsi_register);

-void __exit msm_dsi_unregister(void)
+static void __exit msm_dsi_unregister(void)
 {
DBG("");
msm_dsi_phy_driver_unregister();
platform_driver_unregister(&dsi_driver);
 }
-EXPORT_SYMBOL_GPL(msm_dsi_unregister);
+module_exit(msm_dsi_unregister);

 int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
struct drm_encoder *encoders[MSM_DSI_ENCODER_NUM])
diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c 
b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
index 91a95fb04a4a..ab7106c150da 100644
--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
+++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
@@ -393,7 +393,7 @@ void __init msm_dsi_phy_driver_register(void)
platform_driver_register(&dsi_phy_platform_driver);
 }

-void __exit msm_dsi_phy_driver_unregister(void)
+void msm_dsi_phy_driver_unregister(void)
 {
platform_driver_unregister(&dsi_phy_platform_driver);
 }
diff --git a/drivers/gpu/drm/msm/edp/edp.c b/drivers/gpu/drm/msm/edp/edp.c
index 48645d0d649a..fb952bb4e0e0 100644
--- a/drivers/gpu/drm/msm/edp/edp.c
+++ b/drivers/gpu/drm/msm/edp/edp.c
@@ -131,20 +131,7 @@ static struct platform_driver edp_driver = {
.of_match_table = dt_match,
},
 };
-
-void __init msm_edp_register(void)
-{
-   DBG("");
-   platform_driver_register(&edp_driver);
-}
-EXPORT_SYMBOL_GPL(msm_edp_register);
-
-void __exit msm_edp_unregister(void)
-{
-   DBG("");
-   platform_driver_unregister(&edp_driver);
-}
-EXPORT_SYMBOL_GPL(msm_edp_unregister);
+module_platform_driver(edp_driver);

 /* Second part of initialization, the drm/kms level modeset_init */
 int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 8e01d942d1c9..20c77d933556 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -518,16 +518,22 @@ static struct platform_driver msm_hdmi_driver = {
},
 };

-void __init msm_hdmi_register(void)
+static int __init msm_hdmi_register(void)
 {
+   int ret;
+
msm_hdmi_phy_driver_register();
-   platform_driver_register(&msm_hdmi_driver);
+   ret = platform_driver_register(&msm_hdmi_driver);
+   if (ret)
+   msm_hdmi_phy_driver_unregister();
+
+   return ret;
 }
-EXPORT_SYMBOL_GPL(msm_hdmi_register);
+module_init(msm_hdmi_register);

-void __exit msm_hdmi_unregister(void)
+static void __exit msm_hdmi_unregister(void)
 {
platform_driver_unregister(&msm_hdmi_driver);
msm_hdmi_phy_driver_unregister();
 }
-EXPORT_SYMBOL_GPL(msm_hdmi_unregister);
+module_exit(msm_hdmi_unregister);
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdmi.h
index b04a64664673..23702d0057e4 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.h
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.h
@@ -190,7 +190,7 @@ void msm_hdmi_phy_resource_disable(struct hdmi_phy *phy);
 void msm_hdmi_phy_powerup(struct hdmi_phy *phy, unsigned long int pixclock);
 void msm_hdmi_phy_powerdown(struct hdmi_phy *phy);
 void __init msm_hdmi_phy_driver_register(void);
-void __exit msm_hdmi_phy_driver_unregister(void);
+void msm_hdmi_phy_driver_unregister(void);

 #ifdef CONFIG_COMMON_CLK
 int msm_hdmi_pll_8960_init(struct platform_device *pdev);
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c 
b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c
in

[PATCH 7/8] drm: msm: move HDMI into separate module

2016-02-22 Thread Arnd Bergmann
Moving around the Makefile for HDMI caused a link error with
the main driver referring to a builtin module that has no
exported symbols:

drivers/gpu/built-in.o: In function `msm_drm_register':
:(.init.text+0x654): undefined reference to `msm_hdmi_register'

This changes the EDP symbol to a 'tristate' so we can build it
as a module, and exports the symbols as necessary.

Signed-off-by: Arnd Bergmann 
Fixes: 883656affe4d ("drm/msm/hdmi: Create separate Makefile/Kconfig")
---
 drivers/gpu/drm/msm/Makefile  | 2 +-
 drivers/gpu/drm/msm/hdmi/Kconfig  | 7 ++-
 drivers/gpu/drm/msm/hdmi/Makefile | 6 --
 drivers/gpu/drm/msm/hdmi/hdmi.c   | 3 +++
 drivers/gpu/drm/msm/msm_drv.h | 2 +-
 5 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
index e67bdaa14635..06fd13989476 100644
--- a/drivers/gpu/drm/msm/Makefile
+++ b/drivers/gpu/drm/msm/Makefile
@@ -40,7 +40,7 @@ drm-msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
 drm-msm-$(CONFIG_COMMON_CLK) += mdp/mdp4/mdp4_lvds_pll.o

 obj-$(CONFIG_DRM_MSM_DSI_MODULE) += dsi/
-obj-$(CONFIG_DRM_MSM_HDMI) += hdmi/
+obj-$(CONFIG_DRM_MSM_HDMI_MODULE) += hdmi/
 obj-$(CONFIG_DRM_MSM_EDP_MODULE) += edp/

 obj-$(CONFIG_DRM_MSM)  += drm-msm.o drm_msm_helper.o
diff --git a/drivers/gpu/drm/msm/hdmi/Kconfig b/drivers/gpu/drm/msm/hdmi/Kconfig
index 4b24e1e4bac4..8e9abaeae758 100644
--- a/drivers/gpu/drm/msm/hdmi/Kconfig
+++ b/drivers/gpu/drm/msm/hdmi/Kconfig
@@ -1,7 +1,12 @@
 config DRM_MSM_HDMI
-   bool "Enable HDMI support in MSM DRM driver"
+   tristate "Enable HDMI support in MSM DRM driver"
depends on DRM_MSM
default y
help
  Choose this option if you have a need for HDMI connector
  support.
+
+config DRM_MSM_HDMI_MODULE
+   tristate
+   default y if DRM_MSM=y && DRM_MSM_HDMI=m
+   default DRM_MSM_HDMI
diff --git a/drivers/gpu/drm/msm/hdmi/Makefile 
b/drivers/gpu/drm/msm/hdmi/Makefile
index 799dbca89bd4..6cb4598f48d7 100644
--- a/drivers/gpu/drm/msm/hdmi/Makefile
+++ b/drivers/gpu/drm/msm/hdmi/Makefile
@@ -1,6 +1,8 @@
 ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/msm

-obj-y := hdmi.o hdmi_phy.o hdmi_audio.o hdmi_bridge.o hdmi_connector.o \
+obj-$(CONFIG_DRM_MSM_HDMI_MODULE) += drm-msm-hdmi.o
+
+drm-msm-hdmi-y := hdmi.o hdmi_phy.o hdmi_audio.o hdmi_bridge.o 
hdmi_connector.o \
 hdmi_hdcp.o hdmi_i2c.o hdmi_phy_8960.o hdmi_phy_8x60.o hdmi_phy_8x74.o

-obj-$(CONFIG_COMMON_CLK) += hdmi_pll_8960.o hdmi_phy_8996.o
+drm-msm-hdmi-$(CONFIG_COMMON_CLK) += hdmi_pll_8960.o hdmi_phy_8996.o
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 3bcfb1ded8b3..8e01d942d1c9 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -343,6 +343,7 @@ fail:

return ret;
 }
+EXPORT_SYMBOL_GPL(msm_hdmi_modeset_init);

 /*
  * The hdmi device:
@@ -522,9 +523,11 @@ void __init msm_hdmi_register(void)
msm_hdmi_phy_driver_register();
platform_driver_register(&msm_hdmi_driver);
 }
+EXPORT_SYMBOL_GPL(msm_hdmi_register);

 void __exit msm_hdmi_unregister(void)
 {
platform_driver_unregister(&msm_hdmi_driver);
msm_hdmi_phy_driver_unregister();
 }
+EXPORT_SYMBOL_GPL(msm_hdmi_unregister);
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index 8786738a6832..905c17e373e7 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -244,7 +244,7 @@ struct drm_fb_helper *msm_fbdev_init(struct drm_device 
*dev);
 void msm_fbdev_free(struct drm_device *dev);

 struct hdmi;
-#ifdef CONFIG_DRM_MSM_HDMI
+#if IS_ENABLED(CONFIG_DRM_MSM_HDMI)
 int msm_hdmi_modeset_init(struct hdmi *hdmi, struct drm_device *dev,
struct drm_encoder *encoder);
 void __init msm_hdmi_register(void);
-- 
2.7.0



[PATCH 6/8] drm: msm: move EDP into separate module

2016-02-22 Thread Arnd Bergmann
Moving around the Makefile for EDP caused a link error with
the main driver referring to a builtin module that has no
exported symbols:

drivers/gpu/built-in.o: In function `msm_drm_register':
:(.init.text+0x654): undefined reference to `msm_edp_register'

This changes the EDP symbol to a 'tristate' so we can build it
as a module, and exports the symbols as necessary.

Fixes: 75a5cfa5739f ("drm/msm/edp: Create separate Makefile/Kconfig")
---
 drivers/gpu/drm/msm/Makefile | 2 +-
 drivers/gpu/drm/msm/edp/Kconfig  | 7 ++-
 drivers/gpu/drm/msm/edp/Makefile | 4 +++-
 drivers/gpu/drm/msm/edp/edp.c| 4 
 drivers/gpu/drm/msm/msm_drv.h| 2 +-
 5 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
index 4b18a2c670b9..e67bdaa14635 100644
--- a/drivers/gpu/drm/msm/Makefile
+++ b/drivers/gpu/drm/msm/Makefile
@@ -41,7 +41,7 @@ drm-msm-$(CONFIG_COMMON_CLK) += mdp/mdp4/mdp4_lvds_pll.o

 obj-$(CONFIG_DRM_MSM_DSI_MODULE) += dsi/
 obj-$(CONFIG_DRM_MSM_HDMI) += hdmi/
-obj-$(CONFIG_DRM_MSM_EDP) += edp/
+obj-$(CONFIG_DRM_MSM_EDP_MODULE) += edp/

 obj-$(CONFIG_DRM_MSM)  += drm-msm.o drm_msm_helper.o

diff --git a/drivers/gpu/drm/msm/edp/Kconfig b/drivers/gpu/drm/msm/edp/Kconfig
index 576d8c2fd713..b4cecabebc1d 100644
--- a/drivers/gpu/drm/msm/edp/Kconfig
+++ b/drivers/gpu/drm/msm/edp/Kconfig
@@ -1,7 +1,12 @@
 config DRM_MSM_EDP
-   bool "Enable EDP support in MSM DRM driver"
+   tristate "Enable EDP support in MSM DRM driver"
depends on DRM_MSM
default y
help
  Choose this option if you have a need for Embedded Display
  Port encoder support.
+
+config DRM_MSM_EDP_MODULE
+   tristate
+   default y if DRM_MSM=y && DRM_MSM_EDP=m
+   default DRM_MSM_EDP
diff --git a/drivers/gpu/drm/msm/edp/Makefile b/drivers/gpu/drm/msm/edp/Makefile
index e623d59d1706..37c45037f76f 100644
--- a/drivers/gpu/drm/msm/edp/Makefile
+++ b/drivers/gpu/drm/msm/edp/Makefile
@@ -1,3 +1,5 @@
 ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/msm

-obj-y := edp.o edp_aux.o edp_bridge.o edp_connector.o edp_ctrl.o edp_phy.o
+obj-$(CONFIG_DRM_MSM_EDP_MODULE) := drm-msm-edp.o
+
+drm-msm-edp-y := edp.o edp_aux.o edp_bridge.o edp_connector.o edp_ctrl.o 
edp_phy.o
diff --git a/drivers/gpu/drm/msm/edp/edp.c b/drivers/gpu/drm/msm/edp/edp.c
index 0940e84b2821..48645d0d649a 100644
--- a/drivers/gpu/drm/msm/edp/edp.c
+++ b/drivers/gpu/drm/msm/edp/edp.c
@@ -11,6 +11,7 @@
  * GNU General Public License for more details.
  */

+#include 
 #include 
 #include "edp.h"

@@ -136,12 +137,14 @@ void __init msm_edp_register(void)
DBG("");
platform_driver_register(&edp_driver);
 }
+EXPORT_SYMBOL_GPL(msm_edp_register);

 void __exit msm_edp_unregister(void)
 {
DBG("");
platform_driver_unregister(&edp_driver);
 }
+EXPORT_SYMBOL_GPL(msm_edp_unregister);

 /* Second part of initialization, the drm/kms level modeset_init */
 int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
@@ -206,3 +209,4 @@ fail:

return ret;
 }
+EXPORT_SYMBOL_GPL(msm_edp_modeset_init);
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index 86df81b46eb0..8786738a6832 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -266,7 +266,7 @@ static inline void __exit msm_hdmi_unregister(void)
 #endif

 struct msm_edp;
-#ifdef CONFIG_DRM_MSM_EDP
+#if IS_ENABLED(CONFIG_DRM_MSM_EDP)
 void __init msm_edp_register(void);
 void __exit msm_edp_unregister(void);
 int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
-- 
2.7.0



[PATCH 5/8] drm: msm: move DSI into separate module

2016-02-22 Thread Arnd Bergmann
Moving around the Makefile for DSI caused a link error with
the main driver referring to a builtin module that has no
exported symbols:

drivers/gpu/built-in.o: In function `msm_drm_register':
:(.init.text+0x654): undefined reference to `msm_dsi_register'

This changes the DSI symbol to a 'tristate' so we can build it
as a module, and exports the symbols as necessary.

Signed-off-by: Arnd Bergmann 
---
 drivers/gpu/drm/msm/Makefile|  4 ++--
 drivers/gpu/drm/msm/dsi/Kconfig |  7 ++-
 drivers/gpu/drm/msm/dsi/Makefile| 16 +---
 drivers/gpu/drm/msm/dsi/dsi.c   |  6 --
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h |  2 +-
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h |  2 +-
 drivers/gpu/drm/msm/msm_drv.h   |  2 +-
 7 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
index 6817e9390153..4b18a2c670b9 100644
--- a/drivers/gpu/drm/msm/Makefile
+++ b/drivers/gpu/drm/msm/Makefile
@@ -33,13 +33,13 @@ drm-msm-y := \
msm_rd.o \
msm_ringbuffer.o

-drm-msm-$(CONFIG_DRM_MSM_DSI) += mdp/mdp4/mdp4_dsi_encoder.o \
+drm-msm-$(CONFIG_DRM_MSM_DSI_MODULE) += mdp/mdp4/mdp4_dsi_encoder.o \
 mdp/mdp5/mdp5_cmd_encoder.o

 drm-msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
 drm-msm-$(CONFIG_COMMON_CLK) += mdp/mdp4/mdp4_lvds_pll.o

-obj-$(CONFIG_DRM_MSM_DSI) += dsi/
+obj-$(CONFIG_DRM_MSM_DSI_MODULE) += dsi/
 obj-$(CONFIG_DRM_MSM_HDMI) += hdmi/
 obj-$(CONFIG_DRM_MSM_EDP) += edp/

diff --git a/drivers/gpu/drm/msm/dsi/Kconfig b/drivers/gpu/drm/msm/dsi/Kconfig
index 91dcf21bfc03..9cddaf0229f7 100644
--- a/drivers/gpu/drm/msm/dsi/Kconfig
+++ b/drivers/gpu/drm/msm/dsi/Kconfig
@@ -1,5 +1,5 @@
 config DRM_MSM_DSI
-   bool "Enable DSI support in MSM DRM driver"
+   tristate "Enable DSI support in MSM DRM driver"
depends on DRM_MSM
select DRM_PANEL
select DRM_MIPI_DSI
@@ -8,6 +8,11 @@ config DRM_MSM_DSI
  Choose this option if you have a need for MIPI DSI connector
  support.

+config DRM_MSM_DSI_MODULE
+   tristate
+   default y if DRM_MSM=y && DRM_MSM_DSI=m
+   default DRM_MSM_DSI
+
 if DRM_MSM_DSI

 config DRM_MSM_DSI_PLL
diff --git a/drivers/gpu/drm/msm/dsi/Makefile b/drivers/gpu/drm/msm/dsi/Makefile
index 26c8fb689229..53d1cdc16748 100644
--- a/drivers/gpu/drm/msm/dsi/Makefile
+++ b/drivers/gpu/drm/msm/dsi/Makefile
@@ -1,13 +1,15 @@
 ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/msm -Idrivers/gpu/drm/msm/dsi

-obj-y := dsi.o dsi_cfg.o dsi_host.o dsi_manager.o phy/dsi_phy.o
+obj-$(CONFIG_DRM_MSM_DSI_MODULE) += drm-msm-dsi.o

-obj-$(CONFIG_DRM_MSM_DSI_28NM_PHY) += phy/dsi_phy_28nm.o
-obj-$(CONFIG_DRM_MSM_DSI_20NM_PHY) += phy/dsi_phy_20nm.o
-obj-$(CONFIG_DRM_MSM_DSI_28NM_8960_PHY) += phy/dsi_phy_28nm_8960.o
+drm-msm-dsi-y := dsi.o dsi_cfg.o dsi_host.o dsi_manager.o phy/dsi_phy.o
+
+drm-msm-dsi-$(CONFIG_DRM_MSM_DSI_28NM_PHY) += phy/dsi_phy_28nm.o
+drm-msm-dsi-$(CONFIG_DRM_MSM_DSI_20NM_PHY) += phy/dsi_phy_20nm.o
+drm-msm-dsi-$(CONFIG_DRM_MSM_DSI_28NM_8960_PHY) += phy/dsi_phy_28nm_8960.o

 ifeq ($(CONFIG_DRM_MSM_DSI_PLL),y)
-obj-y += pll/dsi_pll.o
-obj-$(CONFIG_DRM_MSM_DSI_28NM_PHY) += pll/dsi_pll_28nm.o
-obj-$(CONFIG_DRM_MSM_DSI_28NM_8960_PHY) += pll/dsi_pll_28nm_8960.o
+drm-msm-dsi-y += pll/dsi_pll.o
+drm-msm-dsi-$(CONFIG_DRM_MSM_DSI_28NM_PHY) += pll/dsi_pll_28nm.o
+drm-msm-dsi-$(CONFIG_DRM_MSM_DSI_28NM_8960_PHY) += pll/dsi_pll_28nm_8960.o
 endif
diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index 6edcd6f57e70..8523a7cdc419 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -10,7 +10,7 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  */
-
+#include 
 #include "dsi.h"

 struct drm_encoder *msm_dsi_get_encoder(struct msm_dsi *msm_dsi)
@@ -178,6 +178,7 @@ void __init msm_dsi_register(void)
msm_dsi_phy_driver_register();
platform_driver_register(&dsi_driver);
 }
+EXPORT_SYMBOL_GPL(msm_dsi_register);

 void __exit msm_dsi_unregister(void)
 {
@@ -185,6 +186,7 @@ void __exit msm_dsi_unregister(void)
msm_dsi_phy_driver_unregister();
platform_driver_unregister(&dsi_driver);
 }
+EXPORT_SYMBOL_GPL(msm_dsi_unregister);

 int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
struct drm_encoder *encoders[MSM_DSI_ENCODER_NUM])
@@ -262,4 +264,4 @@ fail:

return ret;
 }
-
+EXPORT_SYMBOL_GPL(msm_dsi_modeset_init);
diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h 
b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h
index b2828717be2a..3a9e7879d535 100644
--- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h
+++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h
@@ -217,7 +217,7 @@ struct drm_encoder *mdp4_lcdc_encoder_init(struct 
drm_device *dev,
 struct drm_connector *mdp4_lvds_connector_init(struct drm_device *dev,
struct device_no

[PATCH 4/8] drm: msm: split out GEM code into helper module

2016-02-22 Thread Arnd Bergmann
The GEM code is used by dsi, so it can't be part of
the main module. This exports all functions that are called
by other code, and puts it into the helper module.

Signed-off-by: Arnd Bergmann 
---
 drivers/gpu/drm/msm/Makefile  |  3 +--
 drivers/gpu/drm/msm/msm_gem.c | 29 +
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
index acc02aef1b42..6817e9390153 100644
--- a/drivers/gpu/drm/msm/Makefile
+++ b/drivers/gpu/drm/msm/Makefile
@@ -25,7 +25,6 @@ drm-msm-y := \
msm_atomic.o \
msm_drv.o \
msm_fb.o \
-   msm_gem.o \
msm_gem_prime.o \
msm_gem_submit.o \
msm_gpu.o \
@@ -46,4 +45,4 @@ obj-$(CONFIG_DRM_MSM_EDP) += edp/

 obj-$(CONFIG_DRM_MSM)  += drm-msm.o drm_msm_helper.o

-drm_msm_helper-y   += msm_iotrace.o msm_fence.o
+drm_msm_helper-y   += msm_iotrace.o msm_fence.o msm_gem.o
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index 3cedb8d5c855..1d64febee274 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -143,11 +143,13 @@ struct page **msm_gem_get_pages(struct drm_gem_object 
*obj)
mutex_unlock(&dev->struct_mutex);
return p;
 }
+EXPORT_SYMBOL_GPL(msm_gem_get_pages);

 void msm_gem_put_pages(struct drm_gem_object *obj)
 {
/* when we start tracking the pin count, then do something here */
 }
+EXPORT_SYMBOL_GPL(msm_gem_put_pages);

 int msm_gem_mmap_obj(struct drm_gem_object *obj,
struct vm_area_struct *vma)
@@ -177,6 +179,7 @@ int msm_gem_mmap_obj(struct drm_gem_object *obj,

return 0;
 }
+EXPORT_SYMBOL_GPL(msm_gem_mmap_obj);

 int msm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
 {
@@ -190,6 +193,7 @@ int msm_gem_mmap(struct file *filp, struct vm_area_struct 
*vma)

return msm_gem_mmap_obj(vma->vm_private_data, vma);
 }
+EXPORT_SYMBOL_GPL(msm_gem_mmap);

 int msm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
@@ -246,6 +250,7 @@ out:
return VM_FAULT_SIGBUS;
}
 }
+EXPORT_SYMBOL_GPL(msm_gem_fault);

 /** get mmap offset */
 static uint64_t mmap_offset(struct drm_gem_object *obj)
@@ -274,6 +279,7 @@ uint64_t msm_gem_mmap_offset(struct drm_gem_object *obj)
mutex_unlock(&obj->dev->struct_mutex);
return offset;
 }
+EXPORT_SYMBOL_GPL(msm_gem_mmap_offset);

 /* should be called under struct_mutex.. although it can be called
  * from atomic context without struct_mutex to acquire an extra
@@ -316,6 +322,7 @@ int msm_gem_get_iova_locked(struct drm_gem_object *obj, int 
id,

return ret;
 }
+EXPORT_SYMBOL_GPL(msm_gem_get_iova_locked);

 /* get iova, taking a reference.  Should have a matching put */
 int msm_gem_get_iova(struct drm_gem_object *obj, int id, uint32_t *iova)
@@ -336,6 +343,7 @@ int msm_gem_get_iova(struct drm_gem_object *obj, int id, 
uint32_t *iova)
mutex_unlock(&obj->dev->struct_mutex);
return ret;
 }
+EXPORT_SYMBOL_GPL(msm_gem_get_iova);

 /* get iova without taking a reference, used in places where you have
  * already done a 'msm_gem_get_iova()'.
@@ -346,6 +354,7 @@ uint32_t msm_gem_iova(struct drm_gem_object *obj, int id)
WARN_ON(!msm_obj->domain[id].iova);
return msm_obj->domain[id].iova;
 }
+EXPORT_SYMBOL_GPL(msm_gem_iova);

 void msm_gem_put_iova(struct drm_gem_object *obj, int id)
 {
@@ -356,6 +365,7 @@ void msm_gem_put_iova(struct drm_gem_object *obj, int id)
// if another _get_iova_locked() fails we can start unmapping
// things that are no longer needed..
 }
+EXPORT_SYMBOL_GPL(msm_gem_put_iova);

 int msm_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
struct drm_mode_create_dumb *args)
@@ -365,6 +375,7 @@ int msm_gem_dumb_create(struct drm_file *file, struct 
drm_device *dev,
return msm_gem_new_handle(dev, file, args->size,
MSM_BO_SCANOUT | MSM_BO_WC, &args->handle);
 }
+EXPORT_SYMBOL_GPL(msm_gem_dumb_create);

 int msm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
uint32_t handle, uint64_t *offset)
@@ -386,6 +397,7 @@ int msm_gem_dumb_map_offset(struct drm_file *file, struct 
drm_device *dev,
 fail:
return ret;
 }
+EXPORT_SYMBOL_GPL(msm_gem_dumb_map_offset);

 void *msm_gem_vaddr_locked(struct drm_gem_object *obj)
 {
@@ -400,6 +412,7 @@ void *msm_gem_vaddr_locked(struct drm_gem_object *obj)
}
return msm_obj->vaddr;
 }
+EXPORT_SYMBOL_GPL(msm_gem_vaddr_locked);

 void *msm_gem_vaddr(struct drm_gem_object *obj)
 {
@@ -409,6 +422,7 @@ void *msm_gem_vaddr(struct drm_gem_object *obj)
mutex_unlock(&obj->dev->struct_mutex);
return ret;
 }
+EXPORT_SYMBOL_GPL(msm_gem_vaddr);

 /* setup callback for when bo is no longer busy..
  * TODO probably want to differentiate read vs write..
@@ -421,6 +435,7 @@ int msm_gem_queue_inactive_cb(struct drm_gem_object *obj,
  

[PATCH 3/8] drm: msm: split out fence and iotrace modules

2016-02-22 Thread Arnd Bergmann
This is a preparation for having edp, dsi and hdmi in separate
modules. Those three drivers depend on the iotrace code and,
and edp depends on gem, which in turn depends on the fence.

With this change, those two pieces of the main driver can be
loaded first, to resolve circular dependencies.

Signed-off-by: Arnd Bergmann 
---
 drivers/gpu/drm/msm/Kconfig   |   2 +-
 drivers/gpu/drm/msm/Makefile  |   4 +-
 drivers/gpu/drm/msm/msm_drv.c | 165 --
 drivers/gpu/drm/msm/msm_drv.h |  12 +++
 drivers/gpu/drm/msm/msm_fence.c   | 115 ++
 drivers/gpu/drm/msm/msm_iotrace.c |  65 +++
 6 files changed, 196 insertions(+), 167 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/msm_fence.c
 create mode 100644 drivers/gpu/drm/msm/msm_iotrace.c

diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig
index b8beb9bccd91..d987c584d817 100644
--- a/drivers/gpu/drm/msm/Kconfig
+++ b/drivers/gpu/drm/msm/Kconfig
@@ -21,7 +21,7 @@ config DRM_MSM_REGISTER_LOGGING
help
  Compile in support for logging register reads/writes in a format
  that can be parsed by envytools demsm tool.  If enabled, register
- logging can be switched on via msm.reglog=y module param.
+ logging can be switched on via msm_iotrace.reglog=y module param.

 source "drivers/gpu/drm/msm/dsi/Kconfig"
 source "drivers/gpu/drm/msm/hdmi/Kconfig"
diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
index 24f6fd2b9651..acc02aef1b42 100644
--- a/drivers/gpu/drm/msm/Makefile
+++ b/drivers/gpu/drm/msm/Makefile
@@ -44,4 +44,6 @@ obj-$(CONFIG_DRM_MSM_DSI) += dsi/
 obj-$(CONFIG_DRM_MSM_HDMI) += hdmi/
 obj-$(CONFIG_DRM_MSM_EDP) += edp/

-obj-$(CONFIG_DRM_MSM)  += drm-msm.o
+obj-$(CONFIG_DRM_MSM)  += drm-msm.o drm_msm_helper.o
+
+drm_msm_helper-y   += msm_iotrace.o msm_fence.o
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index d52910e2c26c..5430ea7d2375 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -46,14 +46,6 @@ int msm_register_mmu(struct drm_device *dev, struct msm_mmu 
*mmu)
return idx;
 }

-#ifdef CONFIG_DRM_MSM_REGISTER_LOGGING
-static bool reglog = false;
-MODULE_PARM_DESC(reglog, "Enable register read/write logging");
-module_param(reglog, bool, 0600);
-#else
-#define reglog 0
-#endif
-
 #ifdef CONFIG_DRM_FBDEV_EMULATION
 static bool fbdev = true;
 MODULE_PARM_DESC(fbdev, "Enable fbdev compat layer");
@@ -64,56 +56,6 @@ static char *vram = "16m";
 MODULE_PARM_DESC(vram, "Configure VRAM size (for devices without 
IOMMU/GPUMMU)");
 module_param(vram, charp, 0);

-/*
- * Util/helpers:
- */
-
-void __iomem *msm_ioremap(struct platform_device *pdev, const char *name,
-   const char *dbgname)
-{
-   struct resource *res;
-   unsigned long size;
-   void __iomem *ptr;
-
-   if (name)
-   res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name);
-   else
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
-   if (!res) {
-   dev_err(&pdev->dev, "failed to get memory resource: %s\n", 
name);
-   return ERR_PTR(-EINVAL);
-   }
-
-   size = resource_size(res);
-
-   ptr = devm_ioremap_nocache(&pdev->dev, res->start, size);
-   if (!ptr) {
-   dev_err(&pdev->dev, "failed to ioremap: %s\n", name);
-   return ERR_PTR(-ENOMEM);
-   }
-
-   if (reglog)
-   printk(KERN_DEBUG "IO:region %s %p %08lx\n", dbgname, ptr, 
size);
-
-   return ptr;
-}
-
-void msm_writel(u32 data, void __iomem *addr)
-{
-   if (reglog)
-   printk(KERN_DEBUG "IO:W %p %08x\n", addr, data);
-   writel(data, addr);
-}
-
-u32 msm_readl(const void __iomem *addr)
-{
-   u32 val = readl(addr);
-   if (reglog)
-   printk(KERN_ERR "IO:R %p %08x\n", addr, val);
-   return val;
-}
-
 struct vblank_event {
struct list_head node;
int crtc_id;
@@ -691,113 +633,6 @@ static void msm_debugfs_cleanup(struct drm_minor *minor)
 #endif

 /*
- * Fences:
- */
-
-int msm_wait_fence(struct drm_device *dev, uint32_t fence,
-   ktime_t *timeout , bool interruptible)
-{
-   struct msm_drm_private *priv = dev->dev_private;
-   int ret;
-
-   if (!priv->gpu)
-   return 0;
-
-   if (fence > priv->gpu->submitted_fence) {
-   DRM_ERROR("waiting on invalid fence: %u (of %u)\n",
-   fence, priv->gpu->submitted_fence);
-   return -EINVAL;
-   }
-
-   if (!timeout) {
-   /* no-wait: */
-   ret = fence_completed(dev, fence) ? 0 : -EBUSY;
-   } else {
-   ktime_t now = ktime_get();
-   unsigned long remaining_jiffies;
-
-   if (ktime_compare(*timeout, now) < 0) {
-   remaining_jiffies = 0;
-   } else 

[PATCH 2/8] drm: msm: rename module

2016-02-22 Thread Arnd Bergmann
msm.ko is not an appropriate name for a module that drives a specific
device on the msm platform. This changes the name to drm_msm.ko
to have something that won't conflict with any other module name.

Signed-off-by: Arnd Bergmann 
---
 drivers/gpu/drm/msm/Makefile | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
index 9386cfeb55b2..24f6fd2b9651 100644
--- a/drivers/gpu/drm/msm/Makefile
+++ b/drivers/gpu/drm/msm/Makefile
@@ -1,6 +1,6 @@
 ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/msm

-msm-y := \
+drm-msm-y := \
adreno/adreno_device.o \
adreno/adreno_gpu.o \
adreno/a3xx_gpu.o \
@@ -34,14 +34,14 @@ msm-y := \
msm_rd.o \
msm_ringbuffer.o

-msm-$(CONFIG_DRM_MSM_DSI) += mdp/mdp4/mdp4_dsi_encoder.o \
-mdp/mdp5/mdp5_cmd_encoder.o
+drm-msm-$(CONFIG_DRM_MSM_DSI) += mdp/mdp4/mdp4_dsi_encoder.o \
+mdp/mdp5/mdp5_cmd_encoder.o

-msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
-msm-$(CONFIG_COMMON_CLK) += mdp/mdp4/mdp4_lvds_pll.o
+drm-msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
+drm-msm-$(CONFIG_COMMON_CLK) += mdp/mdp4/mdp4_lvds_pll.o

 obj-$(CONFIG_DRM_MSM_DSI) += dsi/
 obj-$(CONFIG_DRM_MSM_HDMI) += hdmi/
 obj-$(CONFIG_DRM_MSM_EDP) += edp/

-obj-$(CONFIG_DRM_MSM)  += msm.o
+obj-$(CONFIG_DRM_MSM)  += drm-msm.o
-- 
2.7.0



[PATCH 1/8] drm: msm: rename hdmi symbols

2016-02-22 Thread Arnd Bergmann
Global symbols in the kernel should be prefixed by the name
of the subsystem and/or driver to avoid conflicts when all
code is built-in.

In this case, function names like 'hdmi_register' or 'hdmi_set_mode'
are way too generic for an MSM specific DRM driver, so I'm renaming
them all to msm_hdmi_* here.

I also rename a lot of the 'static' symbols along with the global
names for consistency, even though those are relatively harmless;
they might only be slightly confusing when they show up in
backtraces.

Signed-off-by: Arnd Bergmann 
---
 drivers/gpu/drm/msm/hdmi/hdmi.c   |  98 +-
 drivers/gpu/drm/msm/hdmi/hdmi.h   |  60 +--
 drivers/gpu/drm/msm/hdmi/hdmi_audio.c |  10 +-
 drivers/gpu/drm/msm/hdmi/hdmi_bridge.c|  56 +-
 drivers/gpu/drm/msm/hdmi/hdmi_connector.c |  34 +++---
 drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c  | 166 +++---
 drivers/gpu/drm/msm/hdmi/hdmi_i2c.c   |  20 ++--
 drivers/gpu/drm/msm/hdmi/hdmi_phy.c   |  56 +-
 drivers/gpu/drm/msm/hdmi/hdmi_phy_8960.c  |   2 +-
 drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c  |   4 +-
 drivers/gpu/drm/msm/hdmi/hdmi_phy_8x60.c  |   2 +-
 drivers/gpu/drm/msm/hdmi/hdmi_phy_8x74.c  |   2 +-
 drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c  |   2 +-
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c   |   2 +-
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c   |   2 +-
 drivers/gpu/drm/msm/msm_drv.c |   4 +-
 drivers/gpu/drm/msm/msm_drv.h |  12 +--
 17 files changed, 266 insertions(+), 266 deletions(-)

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 6002988951b4..3bcfb1ded8b3 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -21,7 +21,7 @@

 #include "hdmi.h"

-void hdmi_set_mode(struct hdmi *hdmi, bool power_on)
+void msm_hdmi_set_mode(struct hdmi *hdmi, bool power_on)
 {
uint32_t ctrl = 0;
unsigned long flags;
@@ -46,26 +46,26 @@ void hdmi_set_mode(struct hdmi *hdmi, bool power_on)
power_on ? "Enable" : "Disable", ctrl);
 }

-static irqreturn_t hdmi_irq(int irq, void *dev_id)
+static irqreturn_t msm_hdmi_irq(int irq, void *dev_id)
 {
struct hdmi *hdmi = dev_id;

/* Process HPD: */
-   hdmi_connector_irq(hdmi->connector);
+   msm_hdmi_connector_irq(hdmi->connector);

/* Process DDC: */
-   hdmi_i2c_irq(hdmi->i2c);
+   msm_hdmi_i2c_irq(hdmi->i2c);

/* Process HDCP: */
if (hdmi->hdcp_ctrl)
-   hdmi_hdcp_irq(hdmi->hdcp_ctrl);
+   msm_hdmi_hdcp_irq(hdmi->hdcp_ctrl);

/* TODO audio.. */

return IRQ_HANDLED;
 }

-static void hdmi_destroy(struct hdmi *hdmi)
+static void msm_hdmi_destroy(struct hdmi *hdmi)
 {
/*
 * at this point, hpd has been disabled,
@@ -75,7 +75,7 @@ static void hdmi_destroy(struct hdmi *hdmi)
flush_workqueue(hdmi->workq);
destroy_workqueue(hdmi->workq);
}
-   hdmi_hdcp_destroy(hdmi);
+   msm_hdmi_hdcp_destroy(hdmi);

if (hdmi->phy_dev) {
put_device(hdmi->phy_dev);
@@ -84,12 +84,12 @@ static void hdmi_destroy(struct hdmi *hdmi)
}

if (hdmi->i2c)
-   hdmi_i2c_destroy(hdmi->i2c);
+   msm_hdmi_i2c_destroy(hdmi->i2c);

platform_set_drvdata(hdmi->pdev, NULL);
 }

-static int hdmi_get_phy(struct hdmi *hdmi)
+static int msm_hdmi_get_phy(struct hdmi *hdmi)
 {
struct platform_device *pdev = hdmi->pdev;
struct platform_device *phy_pdev;
@@ -121,7 +121,7 @@ static int hdmi_get_phy(struct hdmi *hdmi)
  * we are to EPROBE_DEFER we want to do it here, rather than later
  * at modeset_init() time
  */
-static struct hdmi *hdmi_init(struct platform_device *pdev)
+static struct hdmi *msm_hdmi_init(struct platform_device *pdev)
 {
struct hdmi_platform_config *config = pdev->dev.platform_data;
struct hdmi *hdmi = NULL;
@@ -240,7 +240,7 @@ static struct hdmi *hdmi_init(struct platform_device *pdev)

hdmi->workq = alloc_ordered_workqueue("msm_hdmi", 0);

-   hdmi->i2c = hdmi_i2c_init(hdmi);
+   hdmi->i2c = msm_hdmi_i2c_init(hdmi);
if (IS_ERR(hdmi->i2c)) {
ret = PTR_ERR(hdmi->i2c);
dev_err(&pdev->dev, "failed to get i2c: %d\n", ret);
@@ -248,13 +248,13 @@ static struct hdmi *hdmi_init(struct platform_device 
*pdev)
goto fail;
}

-   ret = hdmi_get_phy(hdmi);
+   ret = msm_hdmi_get_phy(hdmi);
if (ret) {
dev_err(&pdev->dev, "failed to get phy\n");
goto fail;
}

-   hdmi->hdcp_ctrl = hdmi_hdcp_init(hdmi);
+   hdmi->hdcp_ctrl = msm_hdmi_hdcp_init(hdmi);
if (IS_ERR(hdmi->hdcp_ctrl)) {
dev_warn(&pdev->dev, "failed to init hdcp: disabled\n");
hdmi->hdcp_ctrl = NULL;
@@ -264,7 +264,7 @@ static struct hdmi *hdmi_init(struct platform_device *pd

[PATCH 0/8] drm: msm: module rework

2016-02-22 Thread Arnd Bergmann
I saw some regressions on today's Linux-next kernel after
the Makefiles got reworked and tried to come up with a quick
fix. This ended up taking much longer, but the new version should
be cleaner and I no longer get any build errors in this
driver.

The first two patches are just preparation to avoid the
namespace problems with global symbols and the module name.

The next five patches separate out each subdirectory that has
its own Makefile into a separate loadable module.

The final patch is just a nice addon, it should work in theory
but this needs to be tested well.

Arnd




[PULL] drm-intel-fixes

2016-02-22 Thread Jani Nikula

Hi Dave -

Here's the display power stuff that Daniel and I were a bit hesitant to
queue to v4.5 at this late stage, but since you said, "looks fairly self
contained, if it make skylake suck less I'm all for it", here goes.

Most of the commits are quite similar, ensuring the display power
doesn't vanish under us during hardware access. Also do note that it's
not just Skylake that's affected.

We've tested this against -rc4, and rebased on top of -rc5 today. We'll
keep testing, but I'm sending the pull request early as I'm not around
later this week, and it'll also give you more time to decide whether to
pull or not.

I've asked Imre to let you know by end of Thursday our time if any new
bugs show up in testing.


BR,
Jani.

The following changes since commit 81f70ba233d5f660e1ea5fe23260ee323af5d53a:

  Linux 4.5-rc5 (2016-02-20 13:39:35 -0800)

are available in the git repository at:

  git://anongit.freedesktop.org/drm-intel tags/drm-intel-fixes-2016-02-22

for you to fetch changes up to 9b18572e83bfd5378b3fcff3acf123f7bddf558a:

  drm/i915/gen9: Verify and enforce dc6 state writes (2016-02-22 18:37:43 +0200)


Imre Deak (13):
  drm/i915: Add helper to get a display power ref if it was already enabled
  drm/i915: Ensure the HW is powered during display pipe HW readout
  drm/i915/ibx: Ensure the HW is powered during PLL HW readout
  drm/i915: Ensure the HW is powered when disabling VGA
  drm/i915: Ensure the HW is powered during HW access in assert_pipe
  drm/i915/crt: Ensure the HW is powered during HW state readout
  drm/i915/ddi: Ensure the HW is powered during HW state readout
  drm/i915: Ensure the HW is powered when accessing the CRC HW block
  drm/i915/dp: Ensure the HW is powered during HW state readout
  drm/i915/dsi: Ensure the HW is powered during HW state readout
  drm/i915/hdmi: Ensure the HW is powered during HW state readout
  drm/i915/lvds: Ensure the HW is powered during HW state readout
  drm/i915/skl: Ensure HW is powered during DDB HW state readout

Mika Kuoppala (1):
  drm/i915/gen9: Verify and enforce dc6 state writes

Patrik Jakobsson (1):
  drm/i915/gen9: Check for DC state mismatch

 drivers/gpu/drm/i915/i915_debugfs.c |  28 --
 drivers/gpu/drm/i915/i915_drv.h |   1 +
 drivers/gpu/drm/i915/intel_crt.c|  13 ++-
 drivers/gpu/drm/i915/intel_csr.c|   2 +
 drivers/gpu/drm/i915/intel_ddi.c| 112 +---
 drivers/gpu/drm/i915/intel_display.c|  86 --
 drivers/gpu/drm/i915/intel_dp.c |  18 +++-
 drivers/gpu/drm/i915/intel_drv.h|   3 +
 drivers/gpu/drm/i915/intel_dsi.c|  13 ++-
 drivers/gpu/drm/i915/intel_hdmi.c   |  14 ++-
 drivers/gpu/drm/i915/intel_lvds.c   |  14 ++-
 drivers/gpu/drm/i915/intel_pm.c |   7 +-
 drivers/gpu/drm/i915/intel_runtime_pm.c | 149 +---
 13 files changed, 367 insertions(+), 93 deletions(-)

-- 
Jani Nikula, Intel Open Source Technology Center


GSoC 2016

2016-02-22 Thread Lukas Wunner
Hi Mehul,

On Mon, Feb 22, 2016 at 05:58:10PM +0530, Mehul Sawarkar wrote:
> I am Mehul Sawarkar from India .I want to be part of X.Org during GSoC
> 2016.I know C/C++.Please help me getting started with some easy task you
> might have in mind.What are some of prospective project ideas for GSoC 2016.
> I'll be happy to have your help and suggestions.

A few years ago there was a GSoC proposal to make hot GPU switching
a reality on Linux:

http://www.phoronix.com/scan.php?page=news_item&px=OTIyMQ
https://lists.x.org/archives/xorg/2011-March/052522.html

Unfortunately nothing came of it. One still has to exit X, switch,
then restart X. It would be great to see progress in this area,
perhaps divide the work into some smaller manageable chunks
that can be worked on by multiple students.

Note that today pretty much the only dual GPU laptops that still
have an actual hardware mux are MacBook Pros. All others moved to
an architecture where the discrete GPU is merely used to offload
rendering and the results are copied over PCIe into the framebuffer
of the integrated GPU. That architecture is cheaper but less
capable. It doesn't yield the same power saving gains that are
possible with a hardware mux (which allows the integrated GPU
to be suspended when not used).

GPU switching support for pre-retina MacBook Pros (<= MBP 9,1)
is now queued for 4.6, you should be able to get one on ebay
without investing too much.

If you haven't seen it, there's also been a solicitation for
GSoC projects on xorg-devel:
https://lists.xorg-foundation.org/archives/xorg-devel/2016-February/048829.html

Best regards,

Lukas


[PATCH] dma-buf/fence: fix fence_is_later v2

2016-02-22 Thread Alex Deucher
From: Christian König 

A fence is never later than itself. This caused a bunch of overhead for AMDGPU.

v2: simplify check as suggested by Michel.

Signed-off-by: Christian König 
Reviewed-by: Michel Dänzer 
Reviewed-by: Alex Deucher 
Signed-off-by: Alex Deucher 
---
 include/linux/fence.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/fence.h b/include/linux/fence.h
index bb52201..5aa95eb 100644
--- a/include/linux/fence.h
+++ b/include/linux/fence.h
@@ -292,7 +292,7 @@ static inline bool fence_is_later(struct fence *f1, struct 
fence *f2)
if (WARN_ON(f1->context != f2->context))
return false;

-   return f1->seqno - f2->seqno < INT_MAX;
+   return (int)(f1->seqno - f2->seqno) > 0;
 }

 /**
-- 
2.5.0



[PATCH] amdgpu: fix NULL pointer dereference at tonga_check_states_equal

2016-02-22 Thread Bradley Pankow
The event_data passed from pem_fini was not cleared upon initialization.
This caused NULL checks to pass and cast_const_phw_tonga_power_state to
attempt to dereference an invalid pointer. Clear the event_data in
pem_init and pem_fini before calling pem_handle_event.

Signed-off-by: Bradley Pankow 
---
 drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c 
b/drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c
index 52a3efc..46410e3 100644
--- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c
@@ -31,7 +31,7 @@
 static int pem_init(struct pp_eventmgr *eventmgr)
 {
int result = 0;
-   struct pem_event_data event_data;
+   struct pem_event_data event_data = { {0} };

/* Initialize PowerPlay feature info */
pem_init_feature_info(eventmgr);
@@ -52,7 +52,7 @@ static int pem_init(struct pp_eventmgr *eventmgr)

 static void pem_fini(struct pp_eventmgr *eventmgr)
 {
-   struct pem_event_data event_data;
+   struct pem_event_data event_data = { {0} };

pem_uninit_featureInfo(eventmgr);
pem_unregister_interrupts(eventmgr);
-- 
2.7.1



[PATCH 42/42] drm/omap: remove dispc_ovl_check()

2016-02-22 Thread Tomi Valkeinen
dispc_ovl_check() is not used anywhere, so it can be removed.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dispc.c   | 41 ---
 drivers/gpu/drm/omapdrm/dss/omapdss.h |  5 -
 2 files changed, 46 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 031451b09922..f83608b69e68 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -2561,47 +2561,6 @@ static int dispc_ovl_calc_scaling(unsigned long pclk, 
unsigned long lclk,
return 0;
 }

-int dispc_ovl_check(enum omap_plane plane, enum omap_channel channel,
-   const struct omap_overlay_info *oi,
-   const struct omap_video_timings *timings,
-   int *x_predecim, int *y_predecim)
-{
-   enum omap_overlay_caps caps = dss_feat_get_overlay_caps(plane);
-   bool five_taps = true;
-   bool fieldmode = false;
-   u16 in_height = oi->height;
-   u16 in_width = oi->width;
-   bool ilace = timings->interlace;
-   u16 out_width, out_height;
-   int pos_x = oi->pos_x;
-   unsigned long pclk = dispc_mgr_pclk_rate(channel);
-   unsigned long lclk = dispc_mgr_lclk_rate(channel);
-
-   out_width = oi->out_width == 0 ? oi->width : oi->out_width;
-   out_height = oi->out_height == 0 ? oi->height : oi->out_height;
-
-   if (ilace && oi->height == out_height)
-   fieldmode = true;
-
-   if (ilace) {
-   if (fieldmode)
-   in_height /= 2;
-   out_height /= 2;
-
-   DSSDBG("adjusting for ilace: height %d, out_height %d\n",
-   in_height, out_height);
-   }
-
-   if (!dss_feat_color_mode_supported(plane, oi->color_mode))
-   return -EINVAL;
-
-   return dispc_ovl_calc_scaling(pclk, lclk, caps, timings, in_width,
-   in_height, out_width, out_height, oi->color_mode,
-   &five_taps, x_predecim, y_predecim, pos_x,
-   oi->rotation_type, false);
-}
-EXPORT_SYMBOL(dispc_ovl_check);
-
 static int dispc_ovl_setup_common(enum omap_plane plane,
enum omap_overlay_caps caps, u32 paddr, u32 p_uv_addr,
u16 screen_width, int pos_x, int pos_y, u16 width, u16 height,
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 186d978e0120..d7e7c909bbc2 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -45,11 +45,6 @@ void dispc_mgr_set_timings(enum omap_channel channel,
 void dispc_mgr_setup(enum omap_channel channel,
const struct omap_overlay_manager_info *info);

-int dispc_ovl_check(enum omap_plane plane, enum omap_channel channel,
-   const struct omap_overlay_info *oi,
-   const struct omap_video_timings *timings,
-   int *x_predecim, int *y_predecim);
-
 int dispc_ovl_enable(enum omap_plane plane, bool enable);
 bool dispc_ovl_enabled(enum omap_plane plane);
 void dispc_ovl_set_channel_out(enum omap_plane plane,
-- 
2.5.0



[PATCH 41/42] drm/omap: remove dss compat code

2016-02-22 Thread Tomi Valkeinen
We have removed all the uses of compat code from omapdrm and the
non-compat parts of omapdss, so now we can remove all the compat code
itself.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/Makefile|3 -
 drivers/gpu/drm/omapdrm/dss/apply.c | 1711 ---
 drivers/gpu/drm/omapdrm/dss/dispc-compat.c  |  667 ---
 drivers/gpu/drm/omapdrm/dss/dispc-compat.h  |   30 -
 drivers/gpu/drm/omapdrm/dss/dispc.c |4 -
 drivers/gpu/drm/omapdrm/dss/display-sysfs.c |  356 --
 drivers/gpu/drm/omapdrm/dss/manager-sysfs.c |  531 -
 drivers/gpu/drm/omapdrm/dss/manager.c   |  263 
 drivers/gpu/drm/omapdrm/dss/overlay-sysfs.c |  456 ---
 drivers/gpu/drm/omapdrm/dss/overlay.c   |  202 
 10 files changed, 4223 deletions(-)
 delete mode 100644 drivers/gpu/drm/omapdrm/dss/apply.c
 delete mode 100644 drivers/gpu/drm/omapdrm/dss/dispc-compat.c
 delete mode 100644 drivers/gpu/drm/omapdrm/dss/dispc-compat.h
 delete mode 100644 drivers/gpu/drm/omapdrm/dss/display-sysfs.c
 delete mode 100644 drivers/gpu/drm/omapdrm/dss/manager-sysfs.c
 delete mode 100644 drivers/gpu/drm/omapdrm/dss/manager.c
 delete mode 100644 drivers/gpu/drm/omapdrm/dss/overlay-sysfs.c
 delete mode 100644 drivers/gpu/drm/omapdrm/dss/overlay.c

diff --git a/drivers/gpu/drm/omapdrm/dss/Makefile 
b/drivers/gpu/drm/omapdrm/dss/Makefile
index b5136d3d4b77..b651ec9751e6 100644
--- a/drivers/gpu/drm/omapdrm/dss/Makefile
+++ b/drivers/gpu/drm/omapdrm/dss/Makefile
@@ -3,9 +3,6 @@ obj-$(CONFIG_OMAP2_DSS) += omapdss.o
 # Core DSS files
 omapdss-y := core.o dss.o dss_features.o dispc.o dispc_coefs.o display.o \
output.o dss-of.o pll.o video-pll.o
-# DSS compat layer files
-omapdss-y += manager.o manager-sysfs.o overlay.o overlay-sysfs.o apply.o \
-   dispc-compat.o display-sysfs.o
 omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o
 omapdss-$(CONFIG_OMAP2_DSS_RFBI) += rfbi.o
 omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o
diff --git a/drivers/gpu/drm/omapdrm/dss/apply.c 
b/drivers/gpu/drm/omapdrm/dss/apply.c
deleted file mode 100644
index 1b7c718c08b2..
--- a/drivers/gpu/drm/omapdrm/dss/apply.c
+++ /dev/null
@@ -1,1711 +0,0 @@
-/*
- * Copyright (C) 2011 Texas Instruments
- * Author: Tomi Valkeinen 
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program.  If not, see .
- */
-
-#define DSS_SUBSYS_NAME "APPLY"
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-
-#include "dss.h"
-#include "dss_features.h"
-#include "dispc-compat.h"
-
-/*
- * We have 4 levels of cache for the dispc settings. First two are in SW and
- * the latter two in HW.
- *
- *   set_info()
- *  v
- * ++
- * | user_info  |
- * ++
- *  v
- *apply()
- *  v
- * ++
- * |   info |
- * ++
- *  v
- *  write_regs()
- *  v
- * ++
- * |  shadow registers  |
- * ++
- *  v
- * VFP or lcd/digit_enable
- *  v
- * ++
- * |  registers |
- * ++
- */
-
-struct ovl_priv_data {
-
-   bool user_info_dirty;
-   struct omap_overlay_info user_info;
-
-   bool info_dirty;
-   struct omap_overlay_info info;
-
-   bool shadow_info_dirty;
-
-   bool extra_info_dirty;
-   bool shadow_extra_info_dirty;
-
-   bool enabled;
-   u32 fifo_low, fifo_high;
-
-   /*
-* True if overlay is to be enabled. Used to check and calculate configs
-* for the overlay before it is enabled in the HW.
-*/
-   bool enabling;
-};
-
-struct mgr_priv_data {
-
-   bool user_info_dirty;
-   struct omap_overlay_manager_info user_info;
-
-   bool info_dirty;
-   struct omap_overlay_manager_info info;
-
-   bool shadow_info_dirty;
-
-   /* If true, GO bit is up and shadow registers cannot be written.
-* Never true for manual update displays */
-   bool busy;
-
-   /* If true, dispc output is enabled */
-   bool updating;
-
-   /* If true, a display is enabled using this manager */
-   bool enabled;
-
-   bool extra_info_dirty;
-   bool shadow_extra_info_dirty;
-
-   struct omap_video_timings timings;
-   struct dss_lcd_mgr_config lcd_config;
-
-   void (*framedone_handler)(void *);
-   void *framedone_handler_data;
-};
-
-stat

[PATCH 40/42] drm/omap: remove last uses of omap_overlay_manager

2016-02-22 Thread Tomi Valkeinen
We have now removed all uses of 'struct omap_overlay_manager', so we can
now remove the last places where it is set.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/omap_crtc.c | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c 
b/drivers/gpu/drm/omapdrm/omap_crtc.c
index f195641b510c..932196e30024 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -98,8 +98,6 @@ static struct omap_dss_device *omap_crtc_output[8];
 static int omap_crtc_dss_connect(enum omap_channel channel,
struct omap_dss_device *dst)
 {
-   struct omap_overlay_manager *mgr = 
omap_dss_get_overlay_manager(channel);
-
if (omap_crtc_output[channel])
return -EINVAL;

@@ -109,22 +107,14 @@ static int omap_crtc_dss_connect(enum omap_channel 
channel,
omap_crtc_output[channel] = dst;
dst->dispc_channel_connected = true;

-   dst->manager = mgr;
-   mgr->output = dst;
-
return 0;
 }

 static void omap_crtc_dss_disconnect(enum omap_channel channel,
struct omap_dss_device *dst)
 {
-   struct omap_overlay_manager *mgr = 
omap_dss_get_overlay_manager(channel);
-
omap_crtc_output[channel] = NULL;
dst->dispc_channel_connected = false;
-
-   mgr->output->manager = NULL;
-   mgr->output = NULL;
 }

 static void omap_crtc_dss_start_update(enum omap_channel channel)
-- 
2.5.0



[PATCH 39/42] drm/omap: DSI: remove uses of omap_overlay_manager

2016-02-22 Thread Tomi Valkeinen
We are removing the uses of 'struct omap_overlay_manager'. This patch
changes DSI driver to use 'omap_channel' instead.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dsi.c | 58 +++
 1 file changed, 28 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index d00c6a31602d..8730646a0cbb 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -214,9 +214,9 @@ struct dsi_reg { u16 module; u16 idx; };
 typedef void (*omap_dsi_isr_t) (void *arg, u32 mask);

 static int dsi_display_init_dispc(struct platform_device *dsidev,
-   struct omap_overlay_manager *mgr);
+   enum omap_channel channel);
 static void dsi_display_uninit_dispc(struct platform_device *dsidev,
-   struct omap_overlay_manager *mgr);
+   enum omap_channel channel);

 static int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel);

@@ -3826,7 +3826,7 @@ static int dsi_enable_video_output(struct omap_dss_device 
*dssdev, int channel)
 {
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
-   struct omap_overlay_manager *mgr = dsi->output.manager;
+   enum omap_channel dispc_channel = dssdev->dispc_channel;
int bpp = dsi_get_pixel_size(dsi->pix_fmt);
struct omap_dss_device *out = &dsi->output;
u8 data_type;
@@ -3838,7 +3838,7 @@ static int dsi_enable_video_output(struct omap_dss_device 
*dssdev, int channel)
return -ENODEV;
}

-   r = dsi_display_init_dispc(dsidev, mgr);
+   r = dsi_display_init_dispc(dsidev, dispc_channel);
if (r)
goto err_init_dispc;

@@ -3876,7 +3876,7 @@ static int dsi_enable_video_output(struct omap_dss_device 
*dssdev, int channel)
dsi_if_enable(dsidev, true);
}

-   r = dss_mgr_enable(mgr->id);
+   r = dss_mgr_enable(dispc_channel);
if (r)
goto err_mgr_enable;

@@ -3888,7 +3888,7 @@ err_mgr_enable:
dsi_vc_enable(dsidev, channel, false);
}
 err_pix_fmt:
-   dsi_display_uninit_dispc(dsidev, mgr);
+   dsi_display_uninit_dispc(dsidev, dispc_channel);
 err_init_dispc:
return r;
 }
@@ -3897,7 +3897,7 @@ static void dsi_disable_video_output(struct 
omap_dss_device *dssdev, int channel
 {
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
-   struct omap_overlay_manager *mgr = dsi->output.manager;
+   enum omap_channel dispc_channel = dssdev->dispc_channel;

if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) {
dsi_if_enable(dsidev, false);
@@ -3910,15 +3910,15 @@ static void dsi_disable_video_output(struct 
omap_dss_device *dssdev, int channel
dsi_if_enable(dsidev, true);
}

-   dss_mgr_disable(mgr->id);
+   dss_mgr_disable(dispc_channel);

-   dsi_display_uninit_dispc(dsidev, mgr);
+   dsi_display_uninit_dispc(dsidev, dispc_channel);
 }

 static void dsi_update_screen_dispc(struct platform_device *dsidev)
 {
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
-   struct omap_overlay_manager *mgr = dsi->output.manager;
+   enum omap_channel dispc_channel = dsi->output.dispc_channel;
unsigned bytespp;
unsigned bytespl;
unsigned bytespf;
@@ -3980,9 +3980,9 @@ static void dsi_update_screen_dispc(struct 
platform_device *dsidev)
msecs_to_jiffies(250));
BUG_ON(r == 0);

-   dss_mgr_set_timings(mgr->id, &dsi->timings);
+   dss_mgr_set_timings(dispc_channel, &dsi->timings);

-   dss_mgr_start_update(mgr->id);
+   dss_mgr_start_update(dispc_channel);

if (dsi->te_enabled) {
/* disable LP_RX_TO, so that we can receive TE.  Time to wait
@@ -4105,17 +4105,17 @@ static int dsi_configure_dispc_clocks(struct 
platform_device *dsidev)
 }

 static int dsi_display_init_dispc(struct platform_device *dsidev,
-   struct omap_overlay_manager *mgr)
+   enum omap_channel channel)
 {
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
int r;

-   dss_select_lcd_clk_source(mgr->id, dsi->module_id == 0 ?
+   dss_select_lcd_clk_source(channel, dsi->module_id == 0 ?
OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC :
OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC);

if (dsi->mode == OMAP_DSS_DSI_CMD_MODE) {
-   r = dss_mgr_register_framedone_handler(mgr->id,
+   r = dss_mgr_register_framedone_handler(channel,
dsi_framedone_irq_callback, dsidev);
if (r) {
DSSERR("can't register FRAMEDONE handler\n");
@@ -4140,7 +4140,7 @@ static int dsi_display_init_dispc(struct platform_device 
*dsidev,
dsi-

[PATCH 38/42] drm/omap: VENC: remove uses of omap_overlay_manager

2016-02-22 Thread Tomi Valkeinen
We are removing the uses of 'struct omap_overlay_manager'. This patch
changes VENC driver to use 'omap_channel' instead.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/venc.c | 24 +++-
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c 
b/drivers/gpu/drm/omapdrm/dss/venc.c
index d514c9878ae2..08a2cc778ba9 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -443,7 +443,7 @@ static const struct venc_config *venc_timings_to_config(

 static int venc_power_on(struct omap_dss_device *dssdev)
 {
-   struct omap_overlay_manager *mgr = venc.output.manager;
+   enum omap_channel channel = dssdev->dispc_channel;
u32 l;
int r;

@@ -469,13 +469,13 @@ static int venc_power_on(struct omap_dss_device *dssdev)

venc_write_reg(VENC_OUTPUT_CONTROL, l);

-   dss_mgr_set_timings(mgr->id, &venc.timings);
+   dss_mgr_set_timings(channel, &venc.timings);

r = regulator_enable(venc.vdda_dac_reg);
if (r)
goto err1;

-   r = dss_mgr_enable(mgr->id);
+   r = dss_mgr_enable(channel);
if (r)
goto err2;

@@ -494,12 +494,12 @@ err0:

 static void venc_power_off(struct omap_dss_device *dssdev)
 {
-   struct omap_overlay_manager *mgr = venc.output.manager;
+   enum omap_channel channel = dssdev->dispc_channel;

venc_write_reg(VENC_OUTPUT_CONTROL, 0);
dss_set_dac_pwrdn_bgz(0);

-   dss_mgr_disable(mgr->id);
+   dss_mgr_disable(channel);

regulator_disable(venc.vdda_dac_reg);

@@ -742,18 +742,14 @@ static int venc_get_clocks(struct platform_device *pdev)
 static int venc_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
 {
-   struct omap_overlay_manager *mgr;
+   enum omap_channel channel = dssdev->dispc_channel;
int r;

r = venc_init_regulator();
if (r)
return r;

-   mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel);
-   if (!mgr)
-   return -ENODEV;
-
-   r = dss_mgr_connect(mgr->id, dssdev);
+   r = dss_mgr_connect(channel, dssdev);
if (r)
return r;

@@ -761,7 +757,7 @@ static int venc_connect(struct omap_dss_device *dssdev,
if (r) {
DSSERR("failed to connect output to new device: %s\n",
dst->name);
-   dss_mgr_disconnect(mgr->id, dssdev);
+   dss_mgr_disconnect(channel, dssdev);
return r;
}

@@ -771,6 +767,8 @@ static int venc_connect(struct omap_dss_device *dssdev,
 static void venc_disconnect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
 {
+   enum omap_channel channel = dssdev->dispc_channel;
+
WARN_ON(dst != dssdev->dst);

if (dst != dssdev->dst)
@@ -778,7 +776,7 @@ static void venc_disconnect(struct omap_dss_device *dssdev,

omapdss_output_unset_device(dssdev);

-   dss_mgr_disconnect(dssdev->manager->id, dssdev);
+   dss_mgr_disconnect(channel, dssdev);
 }

 static const struct omapdss_atv_ops venc_ops = {
-- 
2.5.0



[PATCH 37/42] drm/omap: SDI: remove uses of omap_overlay_manager

2016-02-22 Thread Tomi Valkeinen
We are removing the uses of 'struct omap_overlay_manager'. This patch
changes SDI driver to use 'omap_channel' instead.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/sdi.c | 33 -
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c 
b/drivers/gpu/drm/omapdrm/dss/sdi.c
index dee40ba9a296..cd6d3bfb041d 100644
--- a/drivers/gpu/drm/omapdrm/dss/sdi.c
+++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
@@ -114,7 +114,7 @@ static int sdi_calc_clock_div(unsigned long pclk,

 static void sdi_config_lcd_manager(struct omap_dss_device *dssdev)
 {
-   struct omap_overlay_manager *mgr = sdi.output.manager;
+   enum omap_channel channel = dssdev->dispc_channel;

sdi.mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS;

@@ -124,12 +124,13 @@ static void sdi_config_lcd_manager(struct omap_dss_device 
*dssdev)
sdi.mgr_config.video_port_width = 24;
sdi.mgr_config.lcden_sig_polarity = 1;

-   dss_mgr_set_lcd_config(mgr->id, &sdi.mgr_config);
+   dss_mgr_set_lcd_config(channel, &sdi.mgr_config);
 }

 static int sdi_display_enable(struct omap_dss_device *dssdev)
 {
struct omap_dss_device *out = &sdi.output;
+   enum omap_channel channel = dssdev->dispc_channel;
struct omap_video_timings *t = &sdi.timings;
unsigned long fck;
struct dispc_clock_info dispc_cinfo;
@@ -169,7 +170,7 @@ static int sdi_display_enable(struct omap_dss_device 
*dssdev)
}


-   dss_mgr_set_timings(out->manager->id, t);
+   dss_mgr_set_timings(channel, t);

r = dss_set_fck_rate(fck);
if (r)
@@ -188,7 +189,7 @@ static int sdi_display_enable(struct omap_dss_device 
*dssdev)
 * need to care about the shadow register mechanism for pck-free. The
 * exact reason for this is unknown.
 */
-   dispc_mgr_set_clock_div(out->manager->id, &sdi.mgr_config.clock_info);
+   dispc_mgr_set_clock_div(channel, &sdi.mgr_config.clock_info);

dss_sdi_init(sdi.datapairs);
r = dss_sdi_enable();
@@ -196,7 +197,7 @@ static int sdi_display_enable(struct omap_dss_device 
*dssdev)
goto err_sdi_enable;
mdelay(2);

-   r = dss_mgr_enable(out->manager->id);
+   r = dss_mgr_enable(channel);
if (r)
goto err_mgr_enable;

@@ -216,9 +217,9 @@ err_reg_enable:

 static void sdi_display_disable(struct omap_dss_device *dssdev)
 {
-   struct omap_overlay_manager *mgr = sdi.output.manager;
+   enum omap_channel channel = dssdev->dispc_channel;

-   dss_mgr_disable(mgr->id);
+   dss_mgr_disable(channel);

dss_sdi_disable();

@@ -242,9 +243,9 @@ static void sdi_get_timings(struct omap_dss_device *dssdev,
 static int sdi_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
 {
-   struct omap_overlay_manager *mgr = sdi.output.manager;
+   enum omap_channel channel = dssdev->dispc_channel;

-   if (!dispc_mgr_timings_ok(mgr->id, timings))
+   if (!dispc_mgr_timings_ok(channel, timings))
return -EINVAL;

if (timings->pixelclock == 0)
@@ -280,18 +281,14 @@ static int sdi_init_regulator(void)
 static int sdi_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
 {
-   struct omap_overlay_manager *mgr;
+   enum omap_channel channel = dssdev->dispc_channel;
int r;

r = sdi_init_regulator();
if (r)
return r;

-   mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel);
-   if (!mgr)
-   return -ENODEV;
-
-   r = dss_mgr_connect(mgr->id, dssdev);
+   r = dss_mgr_connect(channel, dssdev);
if (r)
return r;

@@ -299,7 +296,7 @@ static int sdi_connect(struct omap_dss_device *dssdev,
if (r) {
DSSERR("failed to connect output to new device: %s\n",
dst->name);
-   dss_mgr_disconnect(mgr->id, dssdev);
+   dss_mgr_disconnect(channel, dssdev);
return r;
}

@@ -309,6 +306,8 @@ static int sdi_connect(struct omap_dss_device *dssdev,
 static void sdi_disconnect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
 {
+   enum omap_channel channel = dssdev->dispc_channel;
+
WARN_ON(dst != dssdev->dst);

if (dst != dssdev->dst)
@@ -316,7 +315,7 @@ static void sdi_disconnect(struct omap_dss_device *dssdev,

omapdss_output_unset_device(dssdev);

-   dss_mgr_disconnect(dssdev->manager->id, dssdev);
+   dss_mgr_disconnect(channel, dssdev);
 }

 static const struct omapdss_sdi_ops sdi_ops = {
-- 
2.5.0



[PATCH 36/42] drm/omap: HDMI4: remove uses of omap_overlay_manager

2016-02-22 Thread Tomi Valkeinen
We are removing the uses of 'struct omap_overlay_manager'. This patch
changes HDMI4 driver to use 'omap_channel' instead.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/hdmi4.c | 30 +-
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index a222fc5089a5..f892ae157ff3 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -165,7 +165,7 @@ static int hdmi_power_on_full(struct omap_dss_device 
*dssdev)
 {
int r;
struct omap_video_timings *p;
-   struct omap_overlay_manager *mgr = hdmi.output.manager;
+   enum omap_channel channel = dssdev->dispc_channel;
struct hdmi_wp_data *wp = &hdmi.wp;
struct dss_pll_clock_info hdmi_cinfo = { 0 };
unsigned pc;
@@ -217,9 +217,9 @@ static int hdmi_power_on_full(struct omap_dss_device 
*dssdev)
dispc_enable_gamma_table(0);

/* tv size */
-   dss_mgr_set_timings(mgr->id, p);
+   dss_mgr_set_timings(channel, p);

-   r = dss_mgr_enable(mgr->id);
+   r = dss_mgr_enable(channel);
if (r)
goto err_mgr_enable;

@@ -233,7 +233,7 @@ static int hdmi_power_on_full(struct omap_dss_device 
*dssdev)
return 0;

 err_vid_enable:
-   dss_mgr_disable(mgr->id);
+   dss_mgr_disable(channel);
 err_mgr_enable:
hdmi_wp_set_phy_pwr(&hdmi.wp, HDMI_PHYPWRCMD_OFF);
 err_phy_pwr:
@@ -247,13 +247,13 @@ err_pll_enable:

 static void hdmi_power_off_full(struct omap_dss_device *dssdev)
 {
-   struct omap_overlay_manager *mgr = hdmi.output.manager;
+   enum omap_channel channel = dssdev->dispc_channel;

hdmi_wp_clear_irqenable(&hdmi.wp, 0x);

hdmi_wp_video_stop(&hdmi.wp);

-   dss_mgr_disable(mgr->id);
+   dss_mgr_disable(channel);

hdmi_wp_set_phy_pwr(&hdmi.wp, HDMI_PHYPWRCMD_OFF);

@@ -265,9 +265,7 @@ static void hdmi_power_off_full(struct omap_dss_device 
*dssdev)
 static int hdmi_display_check_timing(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
 {
-   struct omap_dss_device *out = &hdmi.output;
-
-   if (!dispc_mgr_timings_ok(out->dispc_channel, timings))
+   if (!dispc_mgr_timings_ok(dssdev->dispc_channel, timings))
return -EINVAL;

return 0;
@@ -438,18 +436,14 @@ static void hdmi_core_disable(struct omap_dss_device 
*dssdev)
 static int hdmi_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
 {
-   struct omap_overlay_manager *mgr;
+   enum omap_channel channel = dssdev->dispc_channel;
int r;

r = hdmi_init_regulator();
if (r)
return r;

-   mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel);
-   if (!mgr)
-   return -ENODEV;
-
-   r = dss_mgr_connect(mgr->id, dssdev);
+   r = dss_mgr_connect(channel, dssdev);
if (r)
return r;

@@ -457,7 +451,7 @@ static int hdmi_connect(struct omap_dss_device *dssdev,
if (r) {
DSSERR("failed to connect output to new device: %s\n",
dst->name);
-   dss_mgr_disconnect(mgr->id, dssdev);
+   dss_mgr_disconnect(channel, dssdev);
return r;
}

@@ -467,6 +461,8 @@ static int hdmi_connect(struct omap_dss_device *dssdev,
 static void hdmi_disconnect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
 {
+   enum omap_channel channel = dssdev->dispc_channel;
+
WARN_ON(dst != dssdev->dst);

if (dst != dssdev->dst)
@@ -474,7 +470,7 @@ static void hdmi_disconnect(struct omap_dss_device *dssdev,

omapdss_output_unset_device(dssdev);

-   dss_mgr_disconnect(dssdev->manager->id, dssdev);
+   dss_mgr_disconnect(channel, dssdev);
 }

 static int hdmi_read_edid(struct omap_dss_device *dssdev,
-- 
2.5.0



[PATCH 35/42] drm/omap: HDMI5: remove uses of omap_overlay_manager

2016-02-22 Thread Tomi Valkeinen
We are removing the uses of 'struct omap_overlay_manager'. This patch
changes HDMI5 driver to use 'omap_channel' instead.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/hdmi5.c | 30 +-
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index 33cda9bcf952..a43f7b10e113 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -182,7 +182,7 @@ static int hdmi_power_on_full(struct omap_dss_device 
*dssdev)
 {
int r;
struct omap_video_timings *p;
-   struct omap_overlay_manager *mgr = hdmi.output.manager;
+   enum omap_channel channel = dssdev->dispc_channel;
struct dss_pll_clock_info hdmi_cinfo = { 0 };
unsigned pc;

@@ -234,9 +234,9 @@ static int hdmi_power_on_full(struct omap_dss_device 
*dssdev)
dispc_enable_gamma_table(0);

/* tv size */
-   dss_mgr_set_timings(mgr->id, p);
+   dss_mgr_set_timings(channel, p);

-   r = dss_mgr_enable(mgr->id);
+   r = dss_mgr_enable(channel);
if (r)
goto err_mgr_enable;

@@ -250,7 +250,7 @@ static int hdmi_power_on_full(struct omap_dss_device 
*dssdev)
return 0;

 err_vid_enable:
-   dss_mgr_disable(mgr->id);
+   dss_mgr_disable(channel);
 err_mgr_enable:
hdmi_wp_set_phy_pwr(&hdmi.wp, HDMI_PHYPWRCMD_OFF);
 err_phy_pwr:
@@ -264,13 +264,13 @@ err_pll_enable:

 static void hdmi_power_off_full(struct omap_dss_device *dssdev)
 {
-   struct omap_overlay_manager *mgr = hdmi.output.manager;
+   enum omap_channel channel = dssdev->dispc_channel;

hdmi_wp_clear_irqenable(&hdmi.wp, 0x);

hdmi_wp_video_stop(&hdmi.wp);

-   dss_mgr_disable(mgr->id);
+   dss_mgr_disable(channel);

hdmi_wp_set_phy_pwr(&hdmi.wp, HDMI_PHYPWRCMD_OFF);

@@ -282,9 +282,7 @@ static void hdmi_power_off_full(struct omap_dss_device 
*dssdev)
 static int hdmi_display_check_timing(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
 {
-   struct omap_dss_device *out = &hdmi.output;
-
-   if (!dispc_mgr_timings_ok(out->dispc_channel, timings))
+   if (!dispc_mgr_timings_ok(dssdev->dispc_channel, timings))
return -EINVAL;

return 0;
@@ -464,18 +462,14 @@ static void hdmi_core_disable(struct omap_dss_device 
*dssdev)
 static int hdmi_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
 {
-   struct omap_overlay_manager *mgr;
+   enum omap_channel channel = dssdev->dispc_channel;
int r;

r = hdmi_init_regulator();
if (r)
return r;

-   mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel);
-   if (!mgr)
-   return -ENODEV;
-
-   r = dss_mgr_connect(mgr->id, dssdev);
+   r = dss_mgr_connect(channel, dssdev);
if (r)
return r;

@@ -483,7 +477,7 @@ static int hdmi_connect(struct omap_dss_device *dssdev,
if (r) {
DSSERR("failed to connect output to new device: %s\n",
dst->name);
-   dss_mgr_disconnect(mgr->id, dssdev);
+   dss_mgr_disconnect(channel, dssdev);
return r;
}

@@ -493,6 +487,8 @@ static int hdmi_connect(struct omap_dss_device *dssdev,
 static void hdmi_disconnect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
 {
+   enum omap_channel channel = dssdev->dispc_channel;
+
WARN_ON(dst != dssdev->dst);

if (dst != dssdev->dst)
@@ -500,7 +496,7 @@ static void hdmi_disconnect(struct omap_dss_device *dssdev,

omapdss_output_unset_device(dssdev);

-   dss_mgr_disconnect(dssdev->manager->id, dssdev);
+   dss_mgr_disconnect(channel, dssdev);
 }

 static int hdmi_read_edid(struct omap_dss_device *dssdev,
-- 
2.5.0



[PATCH 34/42] drm/omap: DPI: remove uses of omap_overlay_manager

2016-02-22 Thread Tomi Valkeinen
We are removing the uses of 'struct omap_overlay_manager'. This patch
changes DPI driver to use 'omap_channel' instead.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dpi.c | 40 +++
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c 
b/drivers/gpu/drm/omapdrm/dss/dpi.c
index c73d3651ca10..97ea60257884 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -334,7 +334,7 @@ static int dpi_set_dispc_clk(struct dpi_data *dpi, unsigned 
long pck_req,
 static int dpi_set_mode(struct dpi_data *dpi)
 {
struct omap_dss_device *out = &dpi->output;
-   struct omap_overlay_manager *mgr = out->manager;
+   enum omap_channel channel = out->dispc_channel;
struct omap_video_timings *t = &dpi->timings;
int lck_div = 0, pck_div = 0;
unsigned long fck = 0;
@@ -342,7 +342,7 @@ static int dpi_set_mode(struct dpi_data *dpi)
int r = 0;

if (dpi->pll)
-   r = dpi_set_dsi_clk(dpi, mgr->id, t->pixelclock, &fck,
+   r = dpi_set_dsi_clk(dpi, channel, t->pixelclock, &fck,
&lck_div, &pck_div);
else
r = dpi_set_dispc_clk(dpi, t->pixelclock, &fck,
@@ -359,7 +359,7 @@ static int dpi_set_mode(struct dpi_data *dpi)
t->pixelclock = pck;
}

-   dss_mgr_set_timings(mgr->id, t);
+   dss_mgr_set_timings(channel, t);

return 0;
 }
@@ -367,7 +367,7 @@ static int dpi_set_mode(struct dpi_data *dpi)
 static void dpi_config_lcd_manager(struct dpi_data *dpi)
 {
struct omap_dss_device *out = &dpi->output;
-   struct omap_overlay_manager *mgr = out->manager;
+   enum omap_channel channel = out->dispc_channel;

dpi->mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS;

@@ -378,13 +378,14 @@ static void dpi_config_lcd_manager(struct dpi_data *dpi)

dpi->mgr_config.lcden_sig_polarity = 0;

-   dss_mgr_set_lcd_config(mgr->id, &dpi->mgr_config);
+   dss_mgr_set_lcd_config(channel, &dpi->mgr_config);
 }

 static int dpi_display_enable(struct omap_dss_device *dssdev)
 {
struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
struct omap_dss_device *out = &dpi->output;
+   enum omap_channel channel = out->dispc_channel;
int r;

mutex_lock(&dpi->lock);
@@ -411,7 +412,7 @@ static int dpi_display_enable(struct omap_dss_device 
*dssdev)
if (r)
goto err_get_dispc;

-   r = dss_dpi_select_source(out->port_num, out->manager->id);
+   r = dss_dpi_select_source(out->port_num, channel);
if (r)
goto err_src_sel;

@@ -429,7 +430,7 @@ static int dpi_display_enable(struct omap_dss_device 
*dssdev)

mdelay(2);

-   r = dss_mgr_enable(out->manager->id);
+   r = dss_mgr_enable(channel);
if (r)
goto err_mgr_enable;

@@ -457,14 +458,14 @@ err_no_reg:
 static void dpi_display_disable(struct omap_dss_device *dssdev)
 {
struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
-   struct omap_overlay_manager *mgr = dpi->output.manager;
+   enum omap_channel channel = dpi->output.dispc_channel;

mutex_lock(&dpi->lock);

-   dss_mgr_disable(mgr->id);
+   dss_mgr_disable(channel);

if (dpi->pll) {
-   dss_select_lcd_clk_source(mgr->id, OMAP_DSS_CLK_SRC_FCK);
+   dss_select_lcd_clk_source(channel, OMAP_DSS_CLK_SRC_FCK);
dss_pll_disable(dpi->pll);
}

@@ -506,7 +507,7 @@ static int dpi_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
 {
struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
-   struct omap_overlay_manager *mgr = dpi->output.manager;
+   enum omap_channel channel = dpi->output.dispc_channel;
int lck_div, pck_div;
unsigned long fck;
unsigned long pck;
@@ -516,7 +517,7 @@ static int dpi_check_timings(struct omap_dss_device *dssdev,
if (timings->x_res % 8 != 0)
return -EINVAL;

-   if (!dispc_mgr_timings_ok(mgr->id, timings))
+   if (!dispc_mgr_timings_ok(channel, timings))
return -EINVAL;

if (timings->pixelclock == 0)
@@ -663,7 +664,7 @@ static int dpi_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
 {
struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
-   struct omap_overlay_manager *mgr;
+   enum omap_channel channel = dpi->output.dispc_channel;
int r;

r = dpi_init_regulator(dpi);
@@ -672,11 +673,7 @@ static int dpi_connect(struct omap_dss_device *dssdev,

dpi_init_pll(dpi);

-   mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel);
-   if (!mgr)
-   return -ENODEV;
-
-   r = dss_mgr_connect(mgr->id, dssdev);
+   r = dss_mgr_connect(channel, dssdev

[PATCH 33/42] drm/omap: remove extra manager checks on disconnect

2016-02-22 Thread Tomi Valkeinen
The DSS output drivers check 'dssdev->manager' in disconnect()
functions. This check is not needed as the manager must always be set if
the output device was connected. Remove the check.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dpi.c   | 3 +--
 drivers/gpu/drm/omapdrm/dss/dsi.c   | 3 +--
 drivers/gpu/drm/omapdrm/dss/hdmi4.c | 3 +--
 drivers/gpu/drm/omapdrm/dss/hdmi5.c | 3 +--
 drivers/gpu/drm/omapdrm/dss/sdi.c   | 3 +--
 drivers/gpu/drm/omapdrm/dss/venc.c  | 3 +--
 6 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c 
b/drivers/gpu/drm/omapdrm/dss/dpi.c
index d4be2444b2ea..c73d3651ca10 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -701,8 +701,7 @@ static void dpi_disconnect(struct omap_dss_device *dssdev,

omapdss_output_unset_device(dssdev);

-   if (dssdev->manager)
-   dss_mgr_disconnect(dssdev->manager->id, dssdev);
+   dss_mgr_disconnect(dssdev->manager->id, dssdev);
 }

 static const struct omapdss_dpi_ops dpi_ops = {
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 10099f75364d..d00c6a31602d 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -5019,8 +5019,7 @@ static void dsi_disconnect(struct omap_dss_device *dssdev,

omapdss_output_unset_device(dssdev);

-   if (dssdev->manager)
-   dss_mgr_disconnect(dssdev->manager->id, dssdev);
+   dss_mgr_disconnect(dssdev->manager->id, dssdev);
 }

 static const struct omapdss_dsi_ops dsi_ops = {
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index f8ed407f148e..a222fc5089a5 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -474,8 +474,7 @@ static void hdmi_disconnect(struct omap_dss_device *dssdev,

omapdss_output_unset_device(dssdev);

-   if (dssdev->manager)
-   dss_mgr_disconnect(dssdev->manager->id, dssdev);
+   dss_mgr_disconnect(dssdev->manager->id, dssdev);
 }

 static int hdmi_read_edid(struct omap_dss_device *dssdev,
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index b75f15e15797..33cda9bcf952 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -500,8 +500,7 @@ static void hdmi_disconnect(struct omap_dss_device *dssdev,

omapdss_output_unset_device(dssdev);

-   if (dssdev->manager)
-   dss_mgr_disconnect(dssdev->manager->id, dssdev);
+   dss_mgr_disconnect(dssdev->manager->id, dssdev);
 }

 static int hdmi_read_edid(struct omap_dss_device *dssdev,
diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c 
b/drivers/gpu/drm/omapdrm/dss/sdi.c
index 0526f24ed8a9..dee40ba9a296 100644
--- a/drivers/gpu/drm/omapdrm/dss/sdi.c
+++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
@@ -316,8 +316,7 @@ static void sdi_disconnect(struct omap_dss_device *dssdev,

omapdss_output_unset_device(dssdev);

-   if (dssdev->manager)
-   dss_mgr_disconnect(dssdev->manager->id, dssdev);
+   dss_mgr_disconnect(dssdev->manager->id, dssdev);
 }

 static const struct omapdss_sdi_ops sdi_ops = {
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c 
b/drivers/gpu/drm/omapdrm/dss/venc.c
index 401c477242b1..d514c9878ae2 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -778,8 +778,7 @@ static void venc_disconnect(struct omap_dss_device *dssdev,

omapdss_output_unset_device(dssdev);

-   if (dssdev->manager)
-   dss_mgr_disconnect(dssdev->manager->id, dssdev);
+   dss_mgr_disconnect(dssdev->manager->id, dssdev);
 }

 static const struct omapdss_atv_ops venc_ops = {
-- 
2.5.0



[PATCH 32/42] drm/omap: remove extra check in dpi and sdi

2016-02-22 Thread Tomi Valkeinen
Both dpi and sdi check for 'mgr != NULL' in check_timings. This check is
not necessary, as mgr must always be set before check_timings. Remove
the check.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dpi.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/sdi.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c 
b/drivers/gpu/drm/omapdrm/dss/dpi.c
index cd6254bee656..d4be2444b2ea 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -516,7 +516,7 @@ static int dpi_check_timings(struct omap_dss_device *dssdev,
if (timings->x_res % 8 != 0)
return -EINVAL;

-   if (mgr && !dispc_mgr_timings_ok(mgr->id, timings))
+   if (!dispc_mgr_timings_ok(mgr->id, timings))
return -EINVAL;

if (timings->pixelclock == 0)
diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c 
b/drivers/gpu/drm/omapdrm/dss/sdi.c
index e00aaabb77b8..0526f24ed8a9 100644
--- a/drivers/gpu/drm/omapdrm/dss/sdi.c
+++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
@@ -244,7 +244,7 @@ static int sdi_check_timings(struct omap_dss_device *dssdev,
 {
struct omap_overlay_manager *mgr = sdi.output.manager;

-   if (mgr && !dispc_mgr_timings_ok(mgr->id, timings))
+   if (!dispc_mgr_timings_ok(mgr->id, timings))
return -EINVAL;

if (timings->pixelclock == 0)
-- 
2.5.0



[PATCH 31/42] drm/omap: convert dss_mgr_unregister_framedone_handler to accept omap_channel

2016-02-22 Thread Tomi Valkeinen
We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_unregister_framedone_handler() to accept 'enum
omap_channel' instead of 'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dsi.c | 4 ++--
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 +-
 drivers/gpu/drm/omapdrm/dss/output.c  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 57a9a537f43f..10099f75364d 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -4156,7 +4156,7 @@ static int dsi_display_init_dispc(struct platform_device 
*dsidev,
return 0;
 err1:
if (dsi->mode == OMAP_DSS_DSI_CMD_MODE)
-   dss_mgr_unregister_framedone_handler(mgr,
+   dss_mgr_unregister_framedone_handler(mgr->id,
dsi_framedone_irq_callback, dsidev);
 err:
dss_select_lcd_clk_source(mgr->id, OMAP_DSS_CLK_SRC_FCK);
@@ -4169,7 +4169,7 @@ static void dsi_display_uninit_dispc(struct 
platform_device *dsidev,
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);

if (dsi->mode == OMAP_DSS_DSI_CMD_MODE)
-   dss_mgr_unregister_framedone_handler(mgr,
+   dss_mgr_unregister_framedone_handler(mgr->id,
dsi_framedone_irq_callback, dsidev);

dss_select_lcd_clk_source(mgr->id, OMAP_DSS_CLK_SRC_FCK);
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index ae9cae3a269a..186d978e0120 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -95,7 +95,7 @@ void dss_mgr_disable(enum omap_channel channel);
 void dss_mgr_start_update(enum omap_channel channel);
 int dss_mgr_register_framedone_handler(enum omap_channel channel,
void (*handler)(void *), void *data);
-void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
+void dss_mgr_unregister_framedone_handler(enum omap_channel channel,
void (*handler)(void *), void *data);

 #endif /* __OMAP_DRM_DSS_H */
diff --git a/drivers/gpu/drm/omapdrm/dss/output.c 
b/drivers/gpu/drm/omapdrm/dss/output.c
index 637f8926ec3a..829232ad8c81 100644
--- a/drivers/gpu/drm/omapdrm/dss/output.c
+++ b/drivers/gpu/drm/omapdrm/dss/output.c
@@ -241,9 +241,9 @@ int dss_mgr_register_framedone_handler(enum omap_channel 
channel,
 }
 EXPORT_SYMBOL(dss_mgr_register_framedone_handler);

-void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
+void dss_mgr_unregister_framedone_handler(enum omap_channel channel,
void (*handler)(void *), void *data)
 {
-   dss_mgr_ops->unregister_framedone_handler(mgr->id, handler, data);
+   dss_mgr_ops->unregister_framedone_handler(channel, handler, data);
 }
 EXPORT_SYMBOL(dss_mgr_unregister_framedone_handler);
-- 
2.5.0



[PATCH 30/42] drm/omap: convert dss_mgr_register_framedone_handler to accept omap_channel

2016-02-22 Thread Tomi Valkeinen
We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_register_framedone_handler() to accept 'enum
omap_channel' instead of 'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dsi.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 +-
 drivers/gpu/drm/omapdrm/dss/output.c  | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 0ef01a6dd6be..57a9a537f43f 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -4115,7 +4115,7 @@ static int dsi_display_init_dispc(struct platform_device 
*dsidev,
OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC);

if (dsi->mode == OMAP_DSS_DSI_CMD_MODE) {
-   r = dss_mgr_register_framedone_handler(mgr,
+   r = dss_mgr_register_framedone_handler(mgr->id,
dsi_framedone_irq_callback, dsidev);
if (r) {
DSSERR("can't register FRAMEDONE handler\n");
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 4d72909313e4..ae9cae3a269a 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -93,7 +93,7 @@ void dss_mgr_set_lcd_config(enum omap_channel channel,
 int dss_mgr_enable(enum omap_channel channel);
 void dss_mgr_disable(enum omap_channel channel);
 void dss_mgr_start_update(enum omap_channel channel);
-int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr,
+int dss_mgr_register_framedone_handler(enum omap_channel channel,
void (*handler)(void *), void *data);
 void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
void (*handler)(void *), void *data);
diff --git a/drivers/gpu/drm/omapdrm/dss/output.c 
b/drivers/gpu/drm/omapdrm/dss/output.c
index 39a0d7f59a80..637f8926ec3a 100644
--- a/drivers/gpu/drm/omapdrm/dss/output.c
+++ b/drivers/gpu/drm/omapdrm/dss/output.c
@@ -234,10 +234,10 @@ void dss_mgr_start_update(enum omap_channel channel)
 }
 EXPORT_SYMBOL(dss_mgr_start_update);

-int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr,
+int dss_mgr_register_framedone_handler(enum omap_channel channel,
void (*handler)(void *), void *data)
 {
-   return dss_mgr_ops->register_framedone_handler(mgr->id, handler, data);
+   return dss_mgr_ops->register_framedone_handler(channel, handler, data);
 }
 EXPORT_SYMBOL(dss_mgr_register_framedone_handler);

-- 
2.5.0



[PATCH 29/42] drm/omap: convert dss_mgr_start_update to accept omap_channel

2016-02-22 Thread Tomi Valkeinen
We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_start_update() to accept 'enum omap_channel' instead of
'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dsi.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 +-
 drivers/gpu/drm/omapdrm/dss/output.c  | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 08751c9cc973..0ef01a6dd6be 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -3982,7 +3982,7 @@ static void dsi_update_screen_dispc(struct 
platform_device *dsidev)

dss_mgr_set_timings(mgr->id, &dsi->timings);

-   dss_mgr_start_update(mgr);
+   dss_mgr_start_update(mgr->id);

if (dsi->te_enabled) {
/* disable LP_RX_TO, so that we can receive TE.  Time to wait
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 25c3449111b2..4d72909313e4 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -92,7 +92,7 @@ void dss_mgr_set_lcd_config(enum omap_channel channel,
const struct dss_lcd_mgr_config *config);
 int dss_mgr_enable(enum omap_channel channel);
 void dss_mgr_disable(enum omap_channel channel);
-void dss_mgr_start_update(struct omap_overlay_manager *mgr);
+void dss_mgr_start_update(enum omap_channel channel);
 int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr,
void (*handler)(void *), void *data);
 void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
diff --git a/drivers/gpu/drm/omapdrm/dss/output.c 
b/drivers/gpu/drm/omapdrm/dss/output.c
index c6238746efe1..39a0d7f59a80 100644
--- a/drivers/gpu/drm/omapdrm/dss/output.c
+++ b/drivers/gpu/drm/omapdrm/dss/output.c
@@ -228,9 +228,9 @@ void dss_mgr_disable(enum omap_channel channel)
 }
 EXPORT_SYMBOL(dss_mgr_disable);

-void dss_mgr_start_update(struct omap_overlay_manager *mgr)
+void dss_mgr_start_update(enum omap_channel channel)
 {
-   dss_mgr_ops->start_update(mgr->id);
+   dss_mgr_ops->start_update(channel);
 }
 EXPORT_SYMBOL(dss_mgr_start_update);

-- 
2.5.0



[PATCH 28/42] drm/omap: convert dss_mgr_disable to accept omap_channel

2016-02-22 Thread Tomi Valkeinen
We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_disable() to accept 'enum omap_channel' instead of
'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dispc-compat.c | 4 ++--
 drivers/gpu/drm/omapdrm/dss/dpi.c  | 2 +-
 drivers/gpu/drm/omapdrm/dss/dsi.c  | 2 +-
 drivers/gpu/drm/omapdrm/dss/hdmi4.c| 4 ++--
 drivers/gpu/drm/omapdrm/dss/hdmi5.c| 4 ++--
 drivers/gpu/drm/omapdrm/dss/omapdss.h  | 2 +-
 drivers/gpu/drm/omapdrm/dss/output.c   | 4 ++--
 drivers/gpu/drm/omapdrm/dss/sdi.c  | 2 +-
 drivers/gpu/drm/omapdrm/dss/venc.c | 2 +-
 9 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc-compat.c 
b/drivers/gpu/drm/omapdrm/dss/dispc-compat.c
index b0cf2dd147cf..ef565b67650f 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc-compat.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc-compat.c
@@ -379,7 +379,7 @@ static void dispc_error_worker(struct work_struct *work)
"with video overlays disabled\n",
mgr->name);

-   dss_mgr_disable(mgr);
+   dss_mgr_disable(mgr->id);

for (j = 0; j < omap_dss_get_num_overlays(); ++j) {
struct omap_overlay *ovl;
@@ -400,7 +400,7 @@ static void dispc_error_worker(struct work_struct *work)
struct omap_overlay_manager *mgr;

mgr = omap_dss_get_overlay_manager(i);
-   dss_mgr_disable(mgr);
+   dss_mgr_disable(mgr->id);
}
}

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c 
b/drivers/gpu/drm/omapdrm/dss/dpi.c
index 8d64fdbc53fa..cd6254bee656 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -461,7 +461,7 @@ static void dpi_display_disable(struct omap_dss_device 
*dssdev)

mutex_lock(&dpi->lock);

-   dss_mgr_disable(mgr);
+   dss_mgr_disable(mgr->id);

if (dpi->pll) {
dss_select_lcd_clk_source(mgr->id, OMAP_DSS_CLK_SRC_FCK);
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index f3881d180d4e..08751c9cc973 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -3910,7 +3910,7 @@ static void dsi_disable_video_output(struct 
omap_dss_device *dssdev, int channel
dsi_if_enable(dsidev, true);
}

-   dss_mgr_disable(mgr);
+   dss_mgr_disable(mgr->id);

dsi_display_uninit_dispc(dsidev, mgr);
 }
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index 3f3e197ed083..f8ed407f148e 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -233,7 +233,7 @@ static int hdmi_power_on_full(struct omap_dss_device 
*dssdev)
return 0;

 err_vid_enable:
-   dss_mgr_disable(mgr);
+   dss_mgr_disable(mgr->id);
 err_mgr_enable:
hdmi_wp_set_phy_pwr(&hdmi.wp, HDMI_PHYPWRCMD_OFF);
 err_phy_pwr:
@@ -253,7 +253,7 @@ static void hdmi_power_off_full(struct omap_dss_device 
*dssdev)

hdmi_wp_video_stop(&hdmi.wp);

-   dss_mgr_disable(mgr);
+   dss_mgr_disable(mgr->id);

hdmi_wp_set_phy_pwr(&hdmi.wp, HDMI_PHYPWRCMD_OFF);

diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index 7ae447382ea5..b75f15e15797 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -250,7 +250,7 @@ static int hdmi_power_on_full(struct omap_dss_device 
*dssdev)
return 0;

 err_vid_enable:
-   dss_mgr_disable(mgr);
+   dss_mgr_disable(mgr->id);
 err_mgr_enable:
hdmi_wp_set_phy_pwr(&hdmi.wp, HDMI_PHYPWRCMD_OFF);
 err_phy_pwr:
@@ -270,7 +270,7 @@ static void hdmi_power_off_full(struct omap_dss_device 
*dssdev)

hdmi_wp_video_stop(&hdmi.wp);

-   dss_mgr_disable(mgr);
+   dss_mgr_disable(mgr->id);

hdmi_wp_set_phy_pwr(&hdmi.wp, HDMI_PHYPWRCMD_OFF);

diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index c76802df6b00..25c3449111b2 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -91,7 +91,7 @@ void dss_mgr_set_timings(enum omap_channel channel,
 void dss_mgr_set_lcd_config(enum omap_channel channel,
const struct dss_lcd_mgr_config *config);
 int dss_mgr_enable(enum omap_channel channel);
-void dss_mgr_disable(struct omap_overlay_manager *mgr);
+void dss_mgr_disable(enum omap_channel channel);
 void dss_mgr_start_update(struct omap_overlay_manager *mgr);
 int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr,
void (*handler)(void *), void *data);
diff --git a/drivers/gpu/drm/omapdrm/dss/output.c 
b/drivers/gpu/drm/omapdrm/dss/output.c
index 

[PATCH 27/42] drm/omap: convert dss_mgr_enable to accept omap_channel

2016-02-22 Thread Tomi Valkeinen
We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_enable() to accept 'enum omap_channel' instead of
'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dispc-compat.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/dpi.c  | 2 +-
 drivers/gpu/drm/omapdrm/dss/dsi.c  | 2 +-
 drivers/gpu/drm/omapdrm/dss/hdmi4.c| 2 +-
 drivers/gpu/drm/omapdrm/dss/hdmi5.c| 2 +-
 drivers/gpu/drm/omapdrm/dss/omapdss.h  | 2 +-
 drivers/gpu/drm/omapdrm/dss/output.c   | 4 ++--
 drivers/gpu/drm/omapdrm/dss/sdi.c  | 2 +-
 drivers/gpu/drm/omapdrm/dss/venc.c | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc-compat.c 
b/drivers/gpu/drm/omapdrm/dss/dispc-compat.c
index 0918b3bfe82a..b0cf2dd147cf 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc-compat.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc-compat.c
@@ -390,7 +390,7 @@ static void dispc_error_worker(struct work_struct *work)
ovl->disable(ovl);
}

-   dss_mgr_enable(mgr);
+   dss_mgr_enable(mgr->id);
}
}

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c 
b/drivers/gpu/drm/omapdrm/dss/dpi.c
index 17d1a3ff6bab..8d64fdbc53fa 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -429,7 +429,7 @@ static int dpi_display_enable(struct omap_dss_device 
*dssdev)

mdelay(2);

-   r = dss_mgr_enable(out->manager);
+   r = dss_mgr_enable(out->manager->id);
if (r)
goto err_mgr_enable;

diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 5709695c7e60..f3881d180d4e 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -3876,7 +3876,7 @@ static int dsi_enable_video_output(struct omap_dss_device 
*dssdev, int channel)
dsi_if_enable(dsidev, true);
}

-   r = dss_mgr_enable(mgr);
+   r = dss_mgr_enable(mgr->id);
if (r)
goto err_mgr_enable;

diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index 8d44103ebf96..3f3e197ed083 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -219,7 +219,7 @@ static int hdmi_power_on_full(struct omap_dss_device 
*dssdev)
/* tv size */
dss_mgr_set_timings(mgr->id, p);

-   r = dss_mgr_enable(mgr);
+   r = dss_mgr_enable(mgr->id);
if (r)
goto err_mgr_enable;

diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index 7a299eb5a87a..7ae447382ea5 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -236,7 +236,7 @@ static int hdmi_power_on_full(struct omap_dss_device 
*dssdev)
/* tv size */
dss_mgr_set_timings(mgr->id, p);

-   r = dss_mgr_enable(mgr);
+   r = dss_mgr_enable(mgr->id);
if (r)
goto err_mgr_enable;

diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 951fc18cb5ba..c76802df6b00 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -90,7 +90,7 @@ void dss_mgr_set_timings(enum omap_channel channel,
const struct omap_video_timings *timings);
 void dss_mgr_set_lcd_config(enum omap_channel channel,
const struct dss_lcd_mgr_config *config);
-int dss_mgr_enable(struct omap_overlay_manager *mgr);
+int dss_mgr_enable(enum omap_channel channel);
 void dss_mgr_disable(struct omap_overlay_manager *mgr);
 void dss_mgr_start_update(struct omap_overlay_manager *mgr);
 int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr,
diff --git a/drivers/gpu/drm/omapdrm/dss/output.c 
b/drivers/gpu/drm/omapdrm/dss/output.c
index f926ed7a5499..cb90a9c9d84d 100644
--- a/drivers/gpu/drm/omapdrm/dss/output.c
+++ b/drivers/gpu/drm/omapdrm/dss/output.c
@@ -216,9 +216,9 @@ void dss_mgr_set_lcd_config(enum omap_channel channel,
 }
 EXPORT_SYMBOL(dss_mgr_set_lcd_config);

-int dss_mgr_enable(struct omap_overlay_manager *mgr)
+int dss_mgr_enable(enum omap_channel channel)
 {
-   return dss_mgr_ops->enable(mgr->id);
+   return dss_mgr_ops->enable(channel);
 }
 EXPORT_SYMBOL(dss_mgr_enable);

diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c 
b/drivers/gpu/drm/omapdrm/dss/sdi.c
index a42c405c04e9..22dfda5fea90 100644
--- a/drivers/gpu/drm/omapdrm/dss/sdi.c
+++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
@@ -196,7 +196,7 @@ static int sdi_display_enable(struct omap_dss_device 
*dssdev)
goto err_sdi_enable;
mdelay(2);

-   r = dss_mgr_enable(out->manager);
+   r = dss_mgr_enable(out->manager->id);
if (r)
goto err_mgr_enable;

diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c 
b/d

[PATCH 26/42] drm/omap: convert dss_mgr_set_lcd_config to accept omap_channel

2016-02-22 Thread Tomi Valkeinen
We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_set_lcd_config() to accept 'enum omap_channel' instead
of 'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dpi.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/dsi.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 +-
 drivers/gpu/drm/omapdrm/dss/output.c  | 4 ++--
 drivers/gpu/drm/omapdrm/dss/sdi.c | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c 
b/drivers/gpu/drm/omapdrm/dss/dpi.c
index 91d0f5ab0bf7..17d1a3ff6bab 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -378,7 +378,7 @@ static void dpi_config_lcd_manager(struct dpi_data *dpi)

dpi->mgr_config.lcden_sig_polarity = 0;

-   dss_mgr_set_lcd_config(mgr, &dpi->mgr_config);
+   dss_mgr_set_lcd_config(mgr->id, &dpi->mgr_config);
 }

 static int dpi_display_enable(struct omap_dss_device *dssdev)
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index a06c7b83a7b6..5709695c7e60 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -4151,7 +4151,7 @@ static int dsi_display_init_dispc(struct platform_device 
*dsidev,
dsi_get_pixel_size(dsi->pix_fmt);
dsi->mgr_config.lcden_sig_polarity = 0;

-   dss_mgr_set_lcd_config(mgr, &dsi->mgr_config);
+   dss_mgr_set_lcd_config(mgr->id, &dsi->mgr_config);

return 0;
 err1:
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index e66d4bb468bb..951fc18cb5ba 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -88,7 +88,7 @@ void dss_mgr_disconnect(enum omap_channel channel,
struct omap_dss_device *dst);
 void dss_mgr_set_timings(enum omap_channel channel,
const struct omap_video_timings *timings);
-void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
+void dss_mgr_set_lcd_config(enum omap_channel channel,
const struct dss_lcd_mgr_config *config);
 int dss_mgr_enable(struct omap_overlay_manager *mgr);
 void dss_mgr_disable(struct omap_overlay_manager *mgr);
diff --git a/drivers/gpu/drm/omapdrm/dss/output.c 
b/drivers/gpu/drm/omapdrm/dss/output.c
index 20255cae6084..f926ed7a5499 100644
--- a/drivers/gpu/drm/omapdrm/dss/output.c
+++ b/drivers/gpu/drm/omapdrm/dss/output.c
@@ -209,10 +209,10 @@ void dss_mgr_set_timings(enum omap_channel channel,
 }
 EXPORT_SYMBOL(dss_mgr_set_timings);

-void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
+void dss_mgr_set_lcd_config(enum omap_channel channel,
const struct dss_lcd_mgr_config *config)
 {
-   dss_mgr_ops->set_lcd_config(mgr->id, config);
+   dss_mgr_ops->set_lcd_config(channel, config);
 }
 EXPORT_SYMBOL(dss_mgr_set_lcd_config);

diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c 
b/drivers/gpu/drm/omapdrm/dss/sdi.c
index 3b16a5b64a67..a42c405c04e9 100644
--- a/drivers/gpu/drm/omapdrm/dss/sdi.c
+++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
@@ -124,7 +124,7 @@ static void sdi_config_lcd_manager(struct omap_dss_device 
*dssdev)
sdi.mgr_config.video_port_width = 24;
sdi.mgr_config.lcden_sig_polarity = 1;

-   dss_mgr_set_lcd_config(mgr, &sdi.mgr_config);
+   dss_mgr_set_lcd_config(mgr->id, &sdi.mgr_config);
 }

 static int sdi_display_enable(struct omap_dss_device *dssdev)
-- 
2.5.0



[PATCH 25/42] drm/omap: convert dss_mgr_set_timings to accept omap_channel

2016-02-22 Thread Tomi Valkeinen
We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_set_timings() to accept 'enum omap_channel' instead of
'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dpi.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/dsi.c | 4 ++--
 drivers/gpu/drm/omapdrm/dss/hdmi4.c   | 2 +-
 drivers/gpu/drm/omapdrm/dss/hdmi5.c   | 2 +-
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 +-
 drivers/gpu/drm/omapdrm/dss/output.c  | 4 ++--
 drivers/gpu/drm/omapdrm/dss/sdi.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/venc.c| 2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c 
b/drivers/gpu/drm/omapdrm/dss/dpi.c
index a877cfebd2d5..91d0f5ab0bf7 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -359,7 +359,7 @@ static int dpi_set_mode(struct dpi_data *dpi)
t->pixelclock = pck;
}

-   dss_mgr_set_timings(mgr, t);
+   dss_mgr_set_timings(mgr->id, t);

return 0;
 }
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index a2c83691506f..a06c7b83a7b6 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -3980,7 +3980,7 @@ static void dsi_update_screen_dispc(struct 
platform_device *dsidev)
msecs_to_jiffies(250));
BUG_ON(r == 0);

-   dss_mgr_set_timings(mgr, &dsi->timings);
+   dss_mgr_set_timings(mgr->id, &dsi->timings);

dss_mgr_start_update(mgr);

@@ -4140,7 +4140,7 @@ static int dsi_display_init_dispc(struct platform_device 
*dsidev,
dsi->timings.de_level = OMAPDSS_SIG_ACTIVE_HIGH;
dsi->timings.sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE;

-   dss_mgr_set_timings(mgr, &dsi->timings);
+   dss_mgr_set_timings(mgr->id, &dsi->timings);

r = dsi_configure_dispc_clocks(dsidev);
if (r)
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index 6fd7d06d32ff..8d44103ebf96 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -217,7 +217,7 @@ static int hdmi_power_on_full(struct omap_dss_device 
*dssdev)
dispc_enable_gamma_table(0);

/* tv size */
-   dss_mgr_set_timings(mgr, p);
+   dss_mgr_set_timings(mgr->id, p);

r = dss_mgr_enable(mgr);
if (r)
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index 9501de473916..7a299eb5a87a 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -234,7 +234,7 @@ static int hdmi_power_on_full(struct omap_dss_device 
*dssdev)
dispc_enable_gamma_table(0);

/* tv size */
-   dss_mgr_set_timings(mgr, p);
+   dss_mgr_set_timings(mgr->id, p);

r = dss_mgr_enable(mgr);
if (r)
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 38da4be6ff15..e66d4bb468bb 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -86,7 +86,7 @@ int dss_mgr_connect(enum omap_channel channel,
struct omap_dss_device *dst);
 void dss_mgr_disconnect(enum omap_channel channel,
struct omap_dss_device *dst);
-void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
+void dss_mgr_set_timings(enum omap_channel channel,
const struct omap_video_timings *timings);
 void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
const struct dss_lcd_mgr_config *config);
diff --git a/drivers/gpu/drm/omapdrm/dss/output.c 
b/drivers/gpu/drm/omapdrm/dss/output.c
index 0ca46f37681f..20255cae6084 100644
--- a/drivers/gpu/drm/omapdrm/dss/output.c
+++ b/drivers/gpu/drm/omapdrm/dss/output.c
@@ -202,10 +202,10 @@ void dss_mgr_disconnect(enum omap_channel channel,
 }
 EXPORT_SYMBOL(dss_mgr_disconnect);

-void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
+void dss_mgr_set_timings(enum omap_channel channel,
const struct omap_video_timings *timings)
 {
-   dss_mgr_ops->set_timings(mgr->id, timings);
+   dss_mgr_ops->set_timings(channel, timings);
 }
 EXPORT_SYMBOL(dss_mgr_set_timings);

diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c 
b/drivers/gpu/drm/omapdrm/dss/sdi.c
index 0d9f40646a34..3b16a5b64a67 100644
--- a/drivers/gpu/drm/omapdrm/dss/sdi.c
+++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
@@ -169,7 +169,7 @@ static int sdi_display_enable(struct omap_dss_device 
*dssdev)
}


-   dss_mgr_set_timings(out->manager, t);
+   dss_mgr_set_timings(out->manager->id, t);

r = dss_set_fck_rate(fck);
if (r)
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c 
b/drivers/gpu/drm/omapdrm/dss/venc.c
index 2a4bd2537040..af760ec7f5dd 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -469,7 +469,7 @@ static int venc_power_on(struct omap_dss_device *dssdev)


[PATCH 24/42] drm/omap: convert dss_mgr_disconnect to accept omap_channel

2016-02-22 Thread Tomi Valkeinen
We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_disconnect() to accept 'enum omap_channel' instead of
'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dpi.c | 4 ++--
 drivers/gpu/drm/omapdrm/dss/dsi.c | 4 ++--
 drivers/gpu/drm/omapdrm/dss/hdmi4.c   | 4 ++--
 drivers/gpu/drm/omapdrm/dss/hdmi5.c   | 4 ++--
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 +-
 drivers/gpu/drm/omapdrm/dss/output.c  | 4 ++--
 drivers/gpu/drm/omapdrm/dss/sdi.c | 4 ++--
 drivers/gpu/drm/omapdrm/dss/venc.c| 4 ++--
 8 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c 
b/drivers/gpu/drm/omapdrm/dss/dpi.c
index 064401bdb8a4..a877cfebd2d5 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -684,7 +684,7 @@ static int dpi_connect(struct omap_dss_device *dssdev,
if (r) {
DSSERR("failed to connect output to new device: %s\n",
dst->name);
-   dss_mgr_disconnect(mgr, dssdev);
+   dss_mgr_disconnect(mgr->id, dssdev);
return r;
}

@@ -702,7 +702,7 @@ static void dpi_disconnect(struct omap_dss_device *dssdev,
omapdss_output_unset_device(dssdev);

if (dssdev->manager)
-   dss_mgr_disconnect(dssdev->manager, dssdev);
+   dss_mgr_disconnect(dssdev->manager->id, dssdev);
 }

 static const struct omapdss_dpi_ops dpi_ops = {
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 3c5542afd9c9..a2c83691506f 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -5002,7 +5002,7 @@ static int dsi_connect(struct omap_dss_device *dssdev,
if (r) {
DSSERR("failed to connect output to new device: %s\n",
dssdev->name);
-   dss_mgr_disconnect(mgr, dssdev);
+   dss_mgr_disconnect(mgr->id, dssdev);
return r;
}

@@ -5020,7 +5020,7 @@ static void dsi_disconnect(struct omap_dss_device *dssdev,
omapdss_output_unset_device(dssdev);

if (dssdev->manager)
-   dss_mgr_disconnect(dssdev->manager, dssdev);
+   dss_mgr_disconnect(dssdev->manager->id, dssdev);
 }

 static const struct omapdss_dsi_ops dsi_ops = {
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index bbceea8b218a..6fd7d06d32ff 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -457,7 +457,7 @@ static int hdmi_connect(struct omap_dss_device *dssdev,
if (r) {
DSSERR("failed to connect output to new device: %s\n",
dst->name);
-   dss_mgr_disconnect(mgr, dssdev);
+   dss_mgr_disconnect(mgr->id, dssdev);
return r;
}

@@ -475,7 +475,7 @@ static void hdmi_disconnect(struct omap_dss_device *dssdev,
omapdss_output_unset_device(dssdev);

if (dssdev->manager)
-   dss_mgr_disconnect(dssdev->manager, dssdev);
+   dss_mgr_disconnect(dssdev->manager->id, dssdev);
 }

 static int hdmi_read_edid(struct omap_dss_device *dssdev,
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index 0b4105e89350..9501de473916 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -483,7 +483,7 @@ static int hdmi_connect(struct omap_dss_device *dssdev,
if (r) {
DSSERR("failed to connect output to new device: %s\n",
dst->name);
-   dss_mgr_disconnect(mgr, dssdev);
+   dss_mgr_disconnect(mgr->id, dssdev);
return r;
}

@@ -501,7 +501,7 @@ static void hdmi_disconnect(struct omap_dss_device *dssdev,
omapdss_output_unset_device(dssdev);

if (dssdev->manager)
-   dss_mgr_disconnect(dssdev->manager, dssdev);
+   dss_mgr_disconnect(dssdev->manager->id, dssdev);
 }

 static int hdmi_read_edid(struct omap_dss_device *dssdev,
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 44086ce82647..38da4be6ff15 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -84,7 +84,7 @@ void dss_uninstall_mgr_ops(void);

 int dss_mgr_connect(enum omap_channel channel,
struct omap_dss_device *dst);
-void dss_mgr_disconnect(struct omap_overlay_manager *mgr,
+void dss_mgr_disconnect(enum omap_channel channel,
struct omap_dss_device *dst);
 void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
const struct omap_video_timings *timings);
diff --git a/drivers/gpu/drm/omapdrm/dss/output.c 
b/drivers/gpu/drm/omapdrm/dss/output.c
index 24de7cdff0fa..0ca46f37681f 100644
--- a/dri

[PATCH 23/42] drm/omap: convert dss_mgr_connect to accept omap_channel

2016-02-22 Thread Tomi Valkeinen
We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_connect() to accept 'enum omap_channel' instead of
'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dpi.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/dsi.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/hdmi4.c   | 2 +-
 drivers/gpu/drm/omapdrm/dss/hdmi5.c   | 2 +-
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 +-
 drivers/gpu/drm/omapdrm/dss/output.c  | 4 ++--
 drivers/gpu/drm/omapdrm/dss/sdi.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/venc.c| 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c 
b/drivers/gpu/drm/omapdrm/dss/dpi.c
index c4ebc7524a09..064401bdb8a4 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -676,7 +676,7 @@ static int dpi_connect(struct omap_dss_device *dssdev,
if (!mgr)
return -ENODEV;

-   r = dss_mgr_connect(mgr, dssdev);
+   r = dss_mgr_connect(mgr->id, dssdev);
if (r)
return r;

diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 5afbaac8f25a..3c5542afd9c9 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -4994,7 +4994,7 @@ static int dsi_connect(struct omap_dss_device *dssdev,
if (!mgr)
return -ENODEV;

-   r = dss_mgr_connect(mgr, dssdev);
+   r = dss_mgr_connect(mgr->id, dssdev);
if (r)
return r;

diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index 5d8a5ed2d3bb..bbceea8b218a 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -449,7 +449,7 @@ static int hdmi_connect(struct omap_dss_device *dssdev,
if (!mgr)
return -ENODEV;

-   r = dss_mgr_connect(mgr, dssdev);
+   r = dss_mgr_connect(mgr->id, dssdev);
if (r)
return r;

diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index 24a14029112d..0b4105e89350 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -475,7 +475,7 @@ static int hdmi_connect(struct omap_dss_device *dssdev,
if (!mgr)
return -ENODEV;

-   r = dss_mgr_connect(mgr, dssdev);
+   r = dss_mgr_connect(mgr->id, dssdev);
if (r)
return r;

diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 640ba08735c5..44086ce82647 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -82,7 +82,7 @@ struct dss_mgr_ops {
 int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops);
 void dss_uninstall_mgr_ops(void);

-int dss_mgr_connect(struct omap_overlay_manager *mgr,
+int dss_mgr_connect(enum omap_channel channel,
struct omap_dss_device *dst);
 void dss_mgr_disconnect(struct omap_overlay_manager *mgr,
struct omap_dss_device *dst);
diff --git a/drivers/gpu/drm/omapdrm/dss/output.c 
b/drivers/gpu/drm/omapdrm/dss/output.c
index 69e081392ee5..24de7cdff0fa 100644
--- a/drivers/gpu/drm/omapdrm/dss/output.c
+++ b/drivers/gpu/drm/omapdrm/dss/output.c
@@ -188,10 +188,10 @@ void dss_uninstall_mgr_ops(void)
 }
 EXPORT_SYMBOL(dss_uninstall_mgr_ops);

-int dss_mgr_connect(struct omap_overlay_manager *mgr,
+int dss_mgr_connect(enum omap_channel channel,
struct omap_dss_device *dst)
 {
-   return dss_mgr_ops->connect(mgr->id, dst);
+   return dss_mgr_ops->connect(channel, dst);
 }
 EXPORT_SYMBOL(dss_mgr_connect);

diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c 
b/drivers/gpu/drm/omapdrm/dss/sdi.c
index 33d36ab4bcf7..93077f7bc500 100644
--- a/drivers/gpu/drm/omapdrm/dss/sdi.c
+++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
@@ -291,7 +291,7 @@ static int sdi_connect(struct omap_dss_device *dssdev,
if (!mgr)
return -ENODEV;

-   r = dss_mgr_connect(mgr, dssdev);
+   r = dss_mgr_connect(mgr->id, dssdev);
if (r)
return r;

diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c 
b/drivers/gpu/drm/omapdrm/dss/venc.c
index 037c5b4e2ed6..afc97891d476 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -753,7 +753,7 @@ static int venc_connect(struct omap_dss_device *dssdev,
if (!mgr)
return -ENODEV;

-   r = dss_mgr_connect(mgr, dssdev);
+   r = dss_mgr_connect(mgr->id, dssdev);
if (r)
return r;

-- 
2.5.0



[PATCH 22/42] drm/omap: use dispc_channel_connected in output drivers

2016-02-22 Thread Tomi Valkeinen
Use 'out->dispc_channel_connected' to check if the device is connected
to an overlay manager or not, instead of using 'out->manager'.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dpi.c   | 2 +-
 drivers/gpu/drm/omapdrm/dss/dsi.c   | 2 +-
 drivers/gpu/drm/omapdrm/dss/hdmi4.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/hdmi5.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/rfbi.c  | 2 +-
 drivers/gpu/drm/omapdrm/dss/sdi.c   | 2 +-
 drivers/gpu/drm/omapdrm/dss/venc.c  | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c 
b/drivers/gpu/drm/omapdrm/dss/dpi.c
index 557cf3bdcc4e..c4ebc7524a09 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -395,7 +395,7 @@ static int dpi_display_enable(struct omap_dss_device 
*dssdev)
goto err_no_reg;
}

-   if (out->manager == NULL) {
+   if (!out->dispc_channel_connected) {
DSSERR("failed to enable display: no output/manager\n");
r = -ENODEV;
goto err_no_out_mgr;
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 43be4b2a7b05..5afbaac8f25a 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -3833,7 +3833,7 @@ static int dsi_enable_video_output(struct omap_dss_device 
*dssdev, int channel)
u16 word_count;
int r;

-   if (out->manager == NULL) {
+   if (!out->dispc_channel_connected) {
DSSERR("failed to enable display: no output/manager\n");
return -ENODEV;
}
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index ddd6a331df39..5d8a5ed2d3bb 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -348,7 +348,7 @@ static int hdmi_display_enable(struct omap_dss_device 
*dssdev)

mutex_lock(&hdmi.lock);

-   if (out->manager == NULL) {
+   if (!out->dispc_channel_connected) {
DSSERR("failed to enable display: no output/manager\n");
r = -ENODEV;
goto err0;
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index b2dd4c9f20d5..24a14029112d 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -374,7 +374,7 @@ static int hdmi_display_enable(struct omap_dss_device 
*dssdev)

mutex_lock(&hdmi.lock);

-   if (out->manager == NULL) {
+   if (!out->dispc_channel_connected) {
DSSERR("failed to enable display: no output/manager\n");
r = -ENODEV;
goto err0;
diff --git a/drivers/gpu/drm/omapdrm/dss/rfbi.c 
b/drivers/gpu/drm/omapdrm/dss/rfbi.c
index aea6a1d0fb20..3796576dfadf 100644
--- a/drivers/gpu/drm/omapdrm/dss/rfbi.c
+++ b/drivers/gpu/drm/omapdrm/dss/rfbi.c
@@ -880,7 +880,7 @@ static int rfbi_display_enable(struct omap_dss_device 
*dssdev)
struct omap_dss_device *out = &rfbi.output;
int r;

-   if (out->manager == NULL) {
+   if (!out->dispc_channel_connected) {
DSSERR("failed to enable display: no output/manager\n");
return -ENODEV;
}
diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c 
b/drivers/gpu/drm/omapdrm/dss/sdi.c
index d747cc6b59e1..33d36ab4bcf7 100644
--- a/drivers/gpu/drm/omapdrm/dss/sdi.c
+++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
@@ -136,7 +136,7 @@ static int sdi_display_enable(struct omap_dss_device 
*dssdev)
unsigned long pck;
int r;

-   if (out->manager == NULL) {
+   if (!out->dispc_channel_connected) {
DSSERR("failed to enable display: no output/manager\n");
return -ENODEV;
}
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c 
b/drivers/gpu/drm/omapdrm/dss/venc.c
index 08f9def76e27..037c5b4e2ed6 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -515,7 +515,7 @@ static int venc_display_enable(struct omap_dss_device 
*dssdev)

mutex_lock(&venc.venc_lock);

-   if (out->manager == NULL) {
+   if (!out->dispc_channel_connected) {
DSSERR("Failed to enable display: no output/manager\n");
r = -ENODEV;
goto err0;
-- 
2.5.0



[PATCH 21/42] drm/omap: add dispc_channel_connected field to omap_dss_device

2016-02-22 Thread Tomi Valkeinen
We want to remove the 'struct omap_overlay_manager' from
omap_dss_device. At the moment that field is used, among some other
uses, to see if the omap_dss_device is connected to an overlay manager.

To make it possible to remove the 'struct omap_overlay_manager' field,
this patch adds 'bool dispc_channel_connected' field to track the
connected-or-not status.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/omap_crtc.c | 2 ++
 include/video/omapdss.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c 
b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 9cc1c4ef79a5..f195641b510c 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -107,6 +107,7 @@ static int omap_crtc_dss_connect(enum omap_channel channel,
return -EINVAL;

omap_crtc_output[channel] = dst;
+   dst->dispc_channel_connected = true;

dst->manager = mgr;
mgr->output = dst;
@@ -120,6 +121,7 @@ static void omap_crtc_dss_disconnect(enum omap_channel 
channel,
struct omap_overlay_manager *mgr = 
omap_dss_get_overlay_manager(channel);

omap_crtc_output[channel] = NULL;
+   dst->dispc_channel_connected = false;

mgr->output->manager = NULL;
mgr->output = NULL;
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index b50ebcd2f460..8e14ad7327c9 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -770,6 +770,7 @@ struct omap_dss_device {

/* DISPC channel for this output */
enum omap_channel dispc_channel;
+   bool dispc_channel_connected;

/* output instance */
enum omap_dss_output_id id;
-- 
2.5.0



[PATCH 20/42] drm/omap: convert dss_mgr_ops to use omap_channel

2016-02-22 Thread Tomi Valkeinen
We are removing the use of 'struct omap_overlay_manager' from omapdrm.
This patch changes the function pointers in 'dss_mgr_ops' to get 'enum
omap_channel' parameter instead of 'struct omap_overlay_manager'.

The change is very straightforward, as we still use 'struct
omap_overlay_manager' inside the function implementations where needed.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/apply.c   | 27 -
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 18 -
 drivers/gpu/drm/omapdrm/dss/output.c  | 18 -
 drivers/gpu/drm/omapdrm/omap_crtc.c   | 38 +++
 4 files changed, 57 insertions(+), 44 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/apply.c 
b/drivers/gpu/drm/omapdrm/dss/apply.c
index 663ccc3bf4e5..1b7c718c08b2 100644
--- a/drivers/gpu/drm/omapdrm/dss/apply.c
+++ b/drivers/gpu/drm/omapdrm/dss/apply.c
@@ -805,20 +805,23 @@ static void mgr_clear_shadow_dirty(struct 
omap_overlay_manager *mgr)
}
 }

-static int dss_mgr_connect_compat(struct omap_overlay_manager *mgr,
+static int dss_mgr_connect_compat(enum omap_channel channel,
struct omap_dss_device *dst)
 {
+   struct omap_overlay_manager *mgr = 
omap_dss_get_overlay_manager(channel);
return mgr->set_output(mgr, dst);
 }

-static void dss_mgr_disconnect_compat(struct omap_overlay_manager *mgr,
+static void dss_mgr_disconnect_compat(enum omap_channel channel,
struct omap_dss_device *dst)
 {
+   struct omap_overlay_manager *mgr = 
omap_dss_get_overlay_manager(channel);
mgr->unset_output(mgr);
 }

-static void dss_mgr_start_update_compat(struct omap_overlay_manager *mgr)
+static void dss_mgr_start_update_compat(enum omap_channel channel)
 {
+   struct omap_overlay_manager *mgr = 
omap_dss_get_overlay_manager(channel);
struct mgr_priv_data *mp = get_mgr_priv(mgr);
unsigned long flags;
int r;
@@ -1072,8 +1075,9 @@ static void dss_setup_fifos(void)
}
 }

-static int dss_mgr_enable_compat(struct omap_overlay_manager *mgr)
+static int dss_mgr_enable_compat(enum omap_channel channel)
 {
+   struct omap_overlay_manager *mgr = 
omap_dss_get_overlay_manager(channel);
struct mgr_priv_data *mp = get_mgr_priv(mgr);
unsigned long flags;
int r;
@@ -1122,8 +1126,9 @@ err:
return r;
 }

-static void dss_mgr_disable_compat(struct omap_overlay_manager *mgr)
+static void dss_mgr_disable_compat(enum omap_channel channel)
 {
+   struct omap_overlay_manager *mgr = 
omap_dss_get_overlay_manager(channel);
struct mgr_priv_data *mp = get_mgr_priv(mgr);
unsigned long flags;

@@ -1261,9 +1266,10 @@ static void dss_apply_mgr_timings(struct 
omap_overlay_manager *mgr,
mp->extra_info_dirty = true;
 }

-static void dss_mgr_set_timings_compat(struct omap_overlay_manager *mgr,
+static void dss_mgr_set_timings_compat(enum omap_channel channel,
const struct omap_video_timings *timings)
 {
+   struct omap_overlay_manager *mgr = 
omap_dss_get_overlay_manager(channel);
unsigned long flags;
struct mgr_priv_data *mp = get_mgr_priv(mgr);

@@ -1289,9 +1295,10 @@ static void dss_apply_mgr_lcd_config(struct 
omap_overlay_manager *mgr,
mp->extra_info_dirty = true;
 }

-static void dss_mgr_set_lcd_config_compat(struct omap_overlay_manager *mgr,
+static void dss_mgr_set_lcd_config_compat(enum omap_channel channel,
const struct dss_lcd_mgr_config *config)
 {
+   struct omap_overlay_manager *mgr = 
omap_dss_get_overlay_manager(channel);
unsigned long flags;
struct mgr_priv_data *mp = get_mgr_priv(mgr);

@@ -1554,9 +1561,10 @@ err:
return r;
 }

-static int dss_mgr_register_framedone_handler_compat(struct 
omap_overlay_manager *mgr,
+static int dss_mgr_register_framedone_handler_compat(enum omap_channel channel,
void (*handler)(void *), void *data)
 {
+   struct omap_overlay_manager *mgr = 
omap_dss_get_overlay_manager(channel);
struct mgr_priv_data *mp = get_mgr_priv(mgr);

if (mp->framedone_handler)
@@ -1568,9 +1576,10 @@ static int 
dss_mgr_register_framedone_handler_compat(struct omap_overlay_manager
return 0;
 }

-static void dss_mgr_unregister_framedone_handler_compat(struct 
omap_overlay_manager *mgr,
+static void dss_mgr_unregister_framedone_handler_compat(enum omap_channel 
channel,
void (*handler)(void *), void *data)
 {
+   struct omap_overlay_manager *mgr = 
omap_dss_get_overlay_manager(channel);
struct mgr_priv_data *mp = get_mgr_priv(mgr);

WARN_ON(mp->framedone_handler != handler ||
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 0a213489f133..640ba08735c5 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -61,21 +61,21 @@ int dispc_ovl_setup(enum omap_plane plane, const s

[PATCH 19/42] drm/omap: remove use of omapdss_find_mgr_from_display()

2016-02-22 Thread Tomi Valkeinen
In order to remove uses of 'struct omap_overlay_manager' we need to get
rid of using omapdss_find_mgr_from_display() when initializing omapdrm.

Instead of using omapdss_find_mgr_from_display() and mgr->id to find the
dispc channel used for the given display, we can instead use
omapdss_find_output_from_display(), and get the output->dispc_channel
from there.

We can also remove omapdss_find_mgr_from_display() as it's no longer
used.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/output.c | 18 --
 drivers/gpu/drm/omapdrm/omap_drv.c   |  8 +---
 2 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/output.c 
b/drivers/gpu/drm/omapdrm/dss/output.c
index 16072159bd24..c1c099dfd621 100644
--- a/drivers/gpu/drm/omapdrm/dss/output.c
+++ b/drivers/gpu/drm/omapdrm/dss/output.c
@@ -169,24 +169,6 @@ struct omap_dss_device 
*omapdss_find_output_from_display(struct omap_dss_device
 }
 EXPORT_SYMBOL(omapdss_find_output_from_display);

-struct omap_overlay_manager *omapdss_find_mgr_from_display(struct 
omap_dss_device *dssdev)
-{
-   struct omap_dss_device *out;
-   struct omap_overlay_manager *mgr;
-
-   out = omapdss_find_output_from_display(dssdev);
-
-   if (out == NULL)
-   return NULL;
-
-   mgr = out->manager;
-
-   omap_dss_put_device(out);
-
-   return mgr;
-}
-EXPORT_SYMBOL(omapdss_find_mgr_from_display);
-
 static const struct dss_mgr_ops *dss_mgr_ops;

 int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops)
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c 
b/drivers/gpu/drm/omapdrm/omap_drv.c
index e21433c3fda4..c69a519f5d87 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -352,7 +352,7 @@ static int omap_modeset_init(struct drm_device *dev)
struct drm_connector *connector;
struct drm_encoder *encoder;
enum omap_channel channel;
-   struct omap_overlay_manager *mgr;
+   struct omap_dss_device *out;

if (!omapdss_device_is_connected(dssdev))
continue;
@@ -399,8 +399,10 @@ static int omap_modeset_init(struct drm_device *dev)
 * not considered.
 */

-   mgr = omapdss_find_mgr_from_display(dssdev);
-   channel = mgr->id;
+   out = omapdss_find_output_from_display(dssdev);
+   channel = out->dispc_channel;
+   omap_dss_put_device(out);
+
/*
 * if this channel hasn't already been taken by a previously
 * allocated crtc, we create a new crtc for it
-- 
2.5.0



[PATCH 18/42] drm/omap: remove crtc->mgr field

2016-02-22 Thread Tomi Valkeinen
In order to remove uses of 'struct omap_overlay_manager' from omapdrm,
this patch removes the crtc->mgr field.

To accomplish that, a new static array is added along the current
'omap_crtcs' static array, which is used to store the output device
connected to a crtc.

Optimally we'd use the struct omap_crtc to store this information, but
at the time when omap_crtc_dss_connect() is called, we don't yet have
the omap_crtc instances. This might possibly be fixed later, but for now
the static array does the job.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/omap_crtc.c | 20 +++-
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c 
b/drivers/gpu/drm/omapdrm/omap_crtc.c
index b1ed18bf1b1b..104e70a91fd8 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -34,14 +34,6 @@ struct omap_crtc {
const char *name;
enum omap_channel channel;

-   /*
-* Temporary: eventually this will go away, but it is needed
-* for now to keep the output's happy.  (They only need
-* mgr->id.)  Eventually this will be replaced w/ something
-* more common-panel-framework-y
-*/
-   struct omap_overlay_manager *mgr;
-
struct omap_video_timings timings;

struct omap_drm_irq vblank_irq;
@@ -100,17 +92,20 @@ int omap_crtc_wait_pending(struct drm_crtc *crtc)

 /* ovl-mgr-id -> crtc */
 static struct omap_crtc *omap_crtcs[8];
+static struct omap_dss_device *omap_crtc_output[8];

 /* we can probably ignore these until we support command-mode panels: */
 static int omap_crtc_dss_connect(struct omap_overlay_manager *mgr,
struct omap_dss_device *dst)
 {
-   if (mgr->output)
+   if (omap_crtc_output[mgr->id])
return -EINVAL;

if ((dispc_mgr_get_supported_outputs(mgr->id) & dst->id) == 0)
return -EINVAL;

+   omap_crtc_output[mgr->id] = dst;
+
dst->manager = mgr;
mgr->output = dst;

@@ -120,6 +115,8 @@ static int omap_crtc_dss_connect(struct 
omap_overlay_manager *mgr,
 static void omap_crtc_dss_disconnect(struct omap_overlay_manager *mgr,
struct omap_dss_device *dst)
 {
+   omap_crtc_output[mgr->id] = NULL;
+
mgr->output->manager = NULL;
mgr->output = NULL;
 }
@@ -138,7 +135,7 @@ static void omap_crtc_set_enabled(struct drm_crtc *crtc, 
bool enable)
u32 framedone_irq, vsync_irq;
int ret;

-   if (omap_crtc->mgr->output->output_type == OMAP_DISPLAY_TYPE_HDMI) {
+   if (omap_crtc_output[channel]->output_type == OMAP_DISPLAY_TYPE_HDMI) {
dispc_mgr_enable(channel, enable);
return;
}
@@ -547,9 +544,6 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
omap_crtc->error_irq.irq = omap_crtc_error_irq;
omap_irq_register(dev, &omap_crtc->error_irq);

-   /* temporary: */
-   omap_crtc->mgr = omap_dss_get_overlay_manager(channel);
-
ret = drm_crtc_init_with_planes(dev, crtc, plane, NULL,
&omap_crtc_funcs, NULL);
if (ret < 0) {
-- 
2.5.0



[PATCH 17/42] drm/omap: Add dispc_mgr_get_supported_outputs()

2016-02-22 Thread Tomi Valkeinen
We are removing the use of the 'struct omap_overlay_manager' from
omapdrm, and one part of that is removing the use of
mgr->supported_outputs field.

This patch adds dispc_mgr_get_supported_outputs() function which can be
used instead of mgr->supported_outputs. omap_crtc.c is changed to use
the new function.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dispc.c   | 6 ++
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 ++
 drivers/gpu/drm/omapdrm/omap_crtc.c   | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
b/drivers/gpu/drm/omapdrm/dss/dispc.c
index a4274dca384a..a5940892a788 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -2910,6 +2910,12 @@ bool dispc_ovl_enabled(enum omap_plane plane)
 }
 EXPORT_SYMBOL(dispc_ovl_enabled);

+enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel 
channel)
+{
+   return dss_feat_get_supported_outputs(channel);
+}
+EXPORT_SYMBOL(dispc_mgr_get_supported_outputs);
+
 void dispc_mgr_enable(enum omap_channel channel, bool enable)
 {
mgr_fld_write(channel, DISPC_MGR_FLD_ENABLE, enable);
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 7712ffef2836..0a213489f133 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -58,6 +58,8 @@ int dispc_ovl_setup(enum omap_plane plane, const struct 
omap_overlay_info *oi,
bool replication, const struct omap_video_timings *mgr_timings,
bool mem_to_mem);

+enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel 
channel);
+
 struct dss_mgr_ops {
int (*connect)(struct omap_overlay_manager *mgr,
struct omap_dss_device *dst);
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c 
b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 280d80781635..b1ed18bf1b1b 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -108,7 +108,7 @@ static int omap_crtc_dss_connect(struct 
omap_overlay_manager *mgr,
if (mgr->output)
return -EINVAL;

-   if ((mgr->supported_outputs & dst->id) == 0)
+   if ((dispc_mgr_get_supported_outputs(mgr->id) & dst->id) == 0)
return -EINVAL;

dst->manager = mgr;
-- 
2.5.0



[PATCH 16/42] drm/omap: move dss_mgr_* declarations to omapdrm/omapfb

2016-02-22 Thread Tomi Valkeinen
This patch continues the work to create private versions of the
omapdss.h header for omapdrm and omapfb. This one moves the dss_mgr_*
function declarations.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/omapdss.h  | 16 
 drivers/video/fbdev/omap2/omapfb/dss/dss.h | 16 
 include/video/omapdss.h| 16 
 3 files changed, 32 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index e0ca9ee9d28a..7712ffef2836 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -80,4 +80,20 @@ struct dss_mgr_ops {
 int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops);
 void dss_uninstall_mgr_ops(void);

+int dss_mgr_connect(struct omap_overlay_manager *mgr,
+   struct omap_dss_device *dst);
+void dss_mgr_disconnect(struct omap_overlay_manager *mgr,
+   struct omap_dss_device *dst);
+void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
+   const struct omap_video_timings *timings);
+void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
+   const struct dss_lcd_mgr_config *config);
+int dss_mgr_enable(struct omap_overlay_manager *mgr);
+void dss_mgr_disable(struct omap_overlay_manager *mgr);
+void dss_mgr_start_update(struct omap_overlay_manager *mgr);
+int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr,
+   void (*handler)(void *), void *data);
+void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
+   void (*handler)(void *), void *data);
+
 #endif /* __OMAP_DRM_DSS_H */
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.h 
b/drivers/video/fbdev/omap2/omapfb/dss/dss.h
index bfceaeedc6c5..0184a8461df1 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss.h
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.h
@@ -527,4 +527,20 @@ struct dss_mgr_ops {
 int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops);
 void dss_uninstall_mgr_ops(void);

+int dss_mgr_connect(struct omap_overlay_manager *mgr,
+   struct omap_dss_device *dst);
+void dss_mgr_disconnect(struct omap_overlay_manager *mgr,
+   struct omap_dss_device *dst);
+void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
+   const struct omap_video_timings *timings);
+void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
+   const struct dss_lcd_mgr_config *config);
+int dss_mgr_enable(struct omap_overlay_manager *mgr);
+void dss_mgr_disable(struct omap_overlay_manager *mgr);
+void dss_mgr_start_update(struct omap_overlay_manager *mgr);
+int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr,
+   void (*handler)(void *), void *data);
+void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
+   void (*handler)(void *), void *data);
+
 #endif
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 88231883cae5..b50ebcd2f460 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -894,22 +894,6 @@ int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void 
*arg, u32 mask);
 int omapdss_compat_init(void);
 void omapdss_compat_uninit(void);

-int dss_mgr_connect(struct omap_overlay_manager *mgr,
-   struct omap_dss_device *dst);
-void dss_mgr_disconnect(struct omap_overlay_manager *mgr,
-   struct omap_dss_device *dst);
-void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
-   const struct omap_video_timings *timings);
-void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
-   const struct dss_lcd_mgr_config *config);
-int dss_mgr_enable(struct omap_overlay_manager *mgr);
-void dss_mgr_disable(struct omap_overlay_manager *mgr);
-void dss_mgr_start_update(struct omap_overlay_manager *mgr);
-int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr,
-   void (*handler)(void *), void *data);
-void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
-   void (*handler)(void *), void *data);
-
 static inline bool omapdss_device_is_connected(struct omap_dss_device *dssdev)
 {
return dssdev->src;
-- 
2.5.0



[PATCH 15/42] drm/omap: move struct dss_mgr_ops to omapdrm/omapfb

2016-02-22 Thread Tomi Valkeinen
This patch continues the work to create private versions of the
omapdss.h header for omapdrm and omapfb. This one moves 'struct dss_mgr_ops'.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/omapdss.h  | 22 ++
 drivers/video/fbdev/omap2/omapfb/dss/dss.h | 24 
 include/video/omapdss.h| 22 --
 3 files changed, 46 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index d33a8e4f07d1..e0ca9ee9d28a 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -58,4 +58,26 @@ int dispc_ovl_setup(enum omap_plane plane, const struct 
omap_overlay_info *oi,
bool replication, const struct omap_video_timings *mgr_timings,
bool mem_to_mem);

+struct dss_mgr_ops {
+   int (*connect)(struct omap_overlay_manager *mgr,
+   struct omap_dss_device *dst);
+   void (*disconnect)(struct omap_overlay_manager *mgr,
+   struct omap_dss_device *dst);
+
+   void (*start_update)(struct omap_overlay_manager *mgr);
+   int (*enable)(struct omap_overlay_manager *mgr);
+   void (*disable)(struct omap_overlay_manager *mgr);
+   void (*set_timings)(struct omap_overlay_manager *mgr,
+   const struct omap_video_timings *timings);
+   void (*set_lcd_config)(struct omap_overlay_manager *mgr,
+   const struct dss_lcd_mgr_config *config);
+   int (*register_framedone_handler)(struct omap_overlay_manager *mgr,
+   void (*handler)(void *), void *data);
+   void (*unregister_framedone_handler)(struct omap_overlay_manager *mgr,
+   void (*handler)(void *), void *data);
+};
+
+int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops);
+void dss_uninstall_mgr_ops(void);
+
 #endif /* __OMAP_DRM_DSS_H */
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.h 
b/drivers/video/fbdev/omap2/omapfb/dss/dss.h
index 86ed67ba4d58..bfceaeedc6c5 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss.h
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.h
@@ -503,4 +503,28 @@ int dss_pll_write_config_type_b(struct dss_pll *pll,
const struct dss_pll_clock_info *cinfo);
 int dss_pll_wait_reset_done(struct dss_pll *pll);

+/* compat */
+
+struct dss_mgr_ops {
+   int (*connect)(struct omap_overlay_manager *mgr,
+   struct omap_dss_device *dst);
+   void (*disconnect)(struct omap_overlay_manager *mgr,
+   struct omap_dss_device *dst);
+
+   void (*start_update)(struct omap_overlay_manager *mgr);
+   int (*enable)(struct omap_overlay_manager *mgr);
+   void (*disable)(struct omap_overlay_manager *mgr);
+   void (*set_timings)(struct omap_overlay_manager *mgr,
+   const struct omap_video_timings *timings);
+   void (*set_lcd_config)(struct omap_overlay_manager *mgr,
+   const struct dss_lcd_mgr_config *config);
+   int (*register_framedone_handler)(struct omap_overlay_manager *mgr,
+   void (*handler)(void *), void *data);
+   void (*unregister_framedone_handler)(struct omap_overlay_manager *mgr,
+   void (*handler)(void *), void *data);
+};
+
+int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops);
+void dss_uninstall_mgr_ops(void);
+
 #endif
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 0464dd69a87d..88231883cae5 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -894,28 +894,6 @@ int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void 
*arg, u32 mask);
 int omapdss_compat_init(void);
 void omapdss_compat_uninit(void);

-struct dss_mgr_ops {
-   int (*connect)(struct omap_overlay_manager *mgr,
-   struct omap_dss_device *dst);
-   void (*disconnect)(struct omap_overlay_manager *mgr,
-   struct omap_dss_device *dst);
-
-   void (*start_update)(struct omap_overlay_manager *mgr);
-   int (*enable)(struct omap_overlay_manager *mgr);
-   void (*disable)(struct omap_overlay_manager *mgr);
-   void (*set_timings)(struct omap_overlay_manager *mgr,
-   const struct omap_video_timings *timings);
-   void (*set_lcd_config)(struct omap_overlay_manager *mgr,
-   const struct dss_lcd_mgr_config *config);
-   int (*register_framedone_handler)(struct omap_overlay_manager *mgr,
-   void (*handler)(void *), void *data);
-   void (*unregister_framedone_handler)(struct omap_overlay_manager *mgr,
-   void (*handler)(void *), void *data);
-};
-
-int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops);
-void dss_uninstall_mgr_ops(void);
-
 int dss_mgr_connect(struct omap_overlay_manager *mgr,
struct omap_dss_device *dst);
 void dss_mgr_disconnect(struct omap_ov

[PATCH 14/42] drm/omap, omapfb: move exported dispc function declarations to omapdrm/omapfb

2016-02-22 Thread Tomi Valkeinen
omapdrm and omapfb still share the same include/video/omapdss.h. We need
to change that so that we can proceed with omapdrm work.

However, it's not trivial to make separate omapfb and omapdrm versions
of omapdss.h, as that file is also included in other places like arch
code, audio code and omap_vout code. So we'll do it piece by piece.

This patch makes private versions of all the dispc function declarations
that are in omapdss.h. For omapdrm we create a new file,
drivers/gpu/drm/omapdrm/dss/omapdss.h, which will contain headers meant
to be visible outside omapdss.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/dss.h|  2 +
 drivers/gpu/drm/omapdrm/dss/omapdss.h| 61 
 drivers/gpu/drm/omapdrm/omap_drv.h   |  2 +
 drivers/video/fbdev/omap2/omapfb/dss/dispc.h |  1 +
 drivers/video/fbdev/omap2/omapfb/dss/dss.h   | 38 +
 include/video/omapdss.h  | 38 -
 6 files changed, 104 insertions(+), 38 deletions(-)
 create mode 100644 drivers/gpu/drm/omapdrm/dss/omapdss.h

diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h 
b/drivers/gpu/drm/omapdrm/dss/dss.h
index 56ce89d4be27..e00b2679964f 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss.h
@@ -25,6 +25,8 @@

 #include 

+#include "omapdss.h"
+
 #ifdef pr_fmt
 #undef pr_fmt
 #endif
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
new file mode 100644
index ..d33a8e4f07d1
--- /dev/null
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2016 Texas Instruments
+ * Author: Tomi Valkeinen 
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see .
+ */
+
+#ifndef __OMAP_DRM_DSS_H
+#define __OMAP_DRM_DSS_H
+
+#include 
+
+u32 dispc_read_irqstatus(void);
+void dispc_clear_irqstatus(u32 mask);
+u32 dispc_read_irqenable(void);
+void dispc_write_irqenable(u32 mask);
+
+int dispc_request_irq(irq_handler_t handler, void *dev_id);
+void dispc_free_irq(void *dev_id);
+
+int dispc_runtime_get(void);
+void dispc_runtime_put(void);
+
+void dispc_mgr_enable(enum omap_channel channel, bool enable);
+bool dispc_mgr_is_enabled(enum omap_channel channel);
+u32 dispc_mgr_get_vsync_irq(enum omap_channel channel);
+u32 dispc_mgr_get_framedone_irq(enum omap_channel channel);
+u32 dispc_mgr_get_sync_lost_irq(enum omap_channel channel);
+bool dispc_mgr_go_busy(enum omap_channel channel);
+void dispc_mgr_go(enum omap_channel channel);
+void dispc_mgr_set_lcd_config(enum omap_channel channel,
+   const struct dss_lcd_mgr_config *config);
+void dispc_mgr_set_timings(enum omap_channel channel,
+   const struct omap_video_timings *timings);
+void dispc_mgr_setup(enum omap_channel channel,
+   const struct omap_overlay_manager_info *info);
+
+int dispc_ovl_check(enum omap_plane plane, enum omap_channel channel,
+   const struct omap_overlay_info *oi,
+   const struct omap_video_timings *timings,
+   int *x_predecim, int *y_predecim);
+
+int dispc_ovl_enable(enum omap_plane plane, bool enable);
+bool dispc_ovl_enabled(enum omap_plane plane);
+void dispc_ovl_set_channel_out(enum omap_plane plane,
+   enum omap_channel channel);
+int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
+   bool replication, const struct omap_video_timings *mgr_timings,
+   bool mem_to_mem);
+
+#endif /* __OMAP_DRM_DSS_H */
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h 
b/drivers/gpu/drm/omapdrm/omap_drv.h
index 16c3eeeae668..defe74d28b04 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -31,6 +31,8 @@
 #include 
 #include 

+#include "dss/omapdss.h"
+
 #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)
 #define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.h 
b/drivers/video/fbdev/omap2/omapfb/dss/dispc.h
index 483744223dd1..e014d0419c58 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.h
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.h
@@ -915,4 +915,5 @@ static inline u16 DISPC_MFLAG_THRESHOLD_OFFSET(enum 
omap_plane plane)
return 0;
}
 }
+
 #endif
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.h 
b/drivers/video/fbdev/omap2/omapfb/dss/dss.h
index b9066afee30

[PATCH 13/42] drm/omap: panel-tpo-td043mtea1: remove pdata support

2016-02-22 Thread Tomi Valkeinen
We no longer have any boards that require the platform data support from
the panel, so we can remove the related code.

Signed-off-by: Tomi Valkeinen 
---
 .../drm/omapdrm/displays/panel-tpo-td043mtea1.c| 43 +++---
 1 file changed, 5 insertions(+), 38 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c 
b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c
index 68e3b68a2920..03e2beb7b4f0 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c
@@ -20,7 +20,6 @@
 #include 

 #include 
-#include 

 #define TPO_R02_MODE(x)((x) & 7)
 #define TPO_R02_MODE_800x480   7
@@ -464,33 +463,6 @@ static struct omap_dss_driver tpo_td043_ops = {
.get_resolution = omapdss_default_get_resolution,
 };

-
-static int tpo_td043_probe_pdata(struct spi_device *spi)
-{
-   const struct panel_tpo_td043mtea1_platform_data *pdata;
-   struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev);
-   struct omap_dss_device *dssdev, *in;
-
-   pdata = dev_get_platdata(&spi->dev);
-
-   ddata->nreset_gpio = pdata->nreset_gpio;
-
-   in = omap_dss_find_output(pdata->source);
-   if (in == NULL) {
-   dev_err(&spi->dev, "failed to find video source '%s'\n",
-   pdata->source);
-   return -EPROBE_DEFER;
-   }
-   ddata->in = in;
-
-   ddata->data_lines = pdata->data_lines;
-
-   dssdev = &ddata->dssdev;
-   dssdev->name = pdata->name;
-
-   return 0;
-}
-
 static int tpo_td043_probe_of(struct spi_device *spi)
 {
struct device_node *node = spi->dev.of_node;
@@ -541,17 +513,12 @@ static int tpo_td043_probe(struct spi_device *spi)

ddata->spi = spi;

-   if (dev_get_platdata(&spi->dev)) {
-   r = tpo_td043_probe_pdata(spi);
-   if (r)
-   return r;
-   } else if (spi->dev.of_node) {
-   r = tpo_td043_probe_of(spi);
-   if (r)
-   return r;
-   } else {
+   if (!spi->dev.of_node)
return -ENODEV;
-   }
+
+   r = tpo_td043_probe_of(spi);
+   if (r)
+   return r;

ddata->mode = TPO_R02_MODE_800x480;
memcpy(ddata->gamma, tpo_td043_def_gamma, sizeof(ddata->gamma));
-- 
2.5.0



[PATCH 12/42] drm/omap: panel-tpo-td028ttec1: remove pdata support

2016-02-22 Thread Tomi Valkeinen
We no longer have any boards that require the platform data support from
the panel, so we can remove the related code.

Signed-off-by: Tomi Valkeinen 
---
 .../drm/omapdrm/displays/panel-tpo-td028ttec1.c| 41 +++---
 1 file changed, 5 insertions(+), 36 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c 
b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
index 4d657f3ab679..bd8d85041926 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
@@ -29,7 +29,6 @@
 #include 
 #include 
 #include 
-#include 

 struct panel_drv_data {
struct omap_dss_device dssdev;
@@ -365,31 +364,6 @@ static struct omap_dss_driver td028ttec1_ops = {
.check_timings  = td028ttec1_panel_check_timings,
 };

-static int td028ttec1_panel_probe_pdata(struct spi_device *spi)
-{
-   const struct panel_tpo_td028ttec1_platform_data *pdata;
-   struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev);
-   struct omap_dss_device *dssdev, *in;
-
-   pdata = dev_get_platdata(&spi->dev);
-
-   in = omap_dss_find_output(pdata->source);
-   if (in == NULL) {
-   dev_err(&spi->dev, "failed to find video source '%s'\n",
-   pdata->source);
-   return -EPROBE_DEFER;
-   }
-
-   ddata->in = in;
-
-   ddata->data_lines = pdata->data_lines;
-
-   dssdev = &ddata->dssdev;
-   dssdev->name = pdata->name;
-
-   return 0;
-}
-
 static int td028ttec1_probe_of(struct spi_device *spi)
 {
struct device_node *node = spi->dev.of_node;
@@ -432,17 +406,12 @@ static int td028ttec1_panel_probe(struct spi_device *spi)

ddata->spi_dev = spi;

-   if (dev_get_platdata(&spi->dev)) {
-   r = td028ttec1_panel_probe_pdata(spi);
-   if (r)
-   return r;
-   } else if (spi->dev.of_node) {
-   r = td028ttec1_probe_of(spi);
-   if (r)
-   return r;
-   } else {
+   if (!spi->dev.of_node)
return -ENODEV;
-   }
+
+   r = td028ttec1_probe_of(spi);
+   if (r)
+   return r;

ddata->videomode = td028ttec1_panel_timings;

-- 
2.5.0



[PATCH 11/42] drm/omap: panel-nec-nl8048hl11: remove pdata support

2016-02-22 Thread Tomi Valkeinen
We no longer have any boards that require the platform data support from
the panel, so we can remove the related code.

Signed-off-by: Tomi Valkeinen 
---
 .../drm/omapdrm/displays/panel-nec-nl8048hl11.c| 44 +++---
 1 file changed, 5 insertions(+), 39 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c 
b/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c
index 8a928c9a2fc9..780cb263a318 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c
@@ -19,7 +19,6 @@
 #include 

 #include 
-#include 

 struct panel_drv_data {
struct omap_dss_device  dssdev;
@@ -232,34 +231,6 @@ static struct omap_dss_driver nec_8048_ops = {
.get_resolution = omapdss_default_get_resolution,
 };

-
-static int nec_8048_probe_pdata(struct spi_device *spi)
-{
-   const struct panel_nec_nl8048hl11_platform_data *pdata;
-   struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev);
-   struct omap_dss_device *dssdev, *in;
-
-   pdata = dev_get_platdata(&spi->dev);
-
-   ddata->qvga_gpio = pdata->qvga_gpio;
-   ddata->res_gpio = pdata->res_gpio;
-
-   in = omap_dss_find_output(pdata->source);
-   if (in == NULL) {
-   dev_err(&spi->dev, "failed to find video source '%s'\n",
-   pdata->source);
-   return -EPROBE_DEFER;
-   }
-   ddata->in = in;
-
-   ddata->data_lines = pdata->data_lines;
-
-   dssdev = &ddata->dssdev;
-   dssdev->name = pdata->name;
-
-   return 0;
-}
-
 static int nec_8048_probe_of(struct spi_device *spi)
 {
struct device_node *node = spi->dev.of_node;
@@ -315,17 +286,12 @@ static int nec_8048_probe(struct spi_device *spi)

ddata->spi = spi;

-   if (dev_get_platdata(&spi->dev)) {
-   r = nec_8048_probe_pdata(spi);
-   if (r)
-   return r;
-   } else if (spi->dev.of_node) {
-   r = nec_8048_probe_of(spi);
-   if (r)
-   return r;
-   } else {
+   if (!spi->dev.of_node)
return -ENODEV;
-   }
+
+   r = nec_8048_probe_of(spi);
+   if (r)
+   return r;

if (gpio_is_valid(ddata->qvga_gpio)) {
r = devm_gpio_request_one(&spi->dev, ddata->qvga_gpio,
-- 
2.5.0



[PATCH 10/42] drm/omap: panel-sharp-ls037v7dw01: remove pdata support

2016-02-22 Thread Tomi Valkeinen
We no longer have any boards that require the platform data support from
the panel, so we can remove the related code.

Signed-off-by: Tomi Valkeinen 
---
 .../drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 83 ++
 1 file changed, 5 insertions(+), 78 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c 
b/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
index abfd1f6e3327..529a017602e4 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
@@ -18,7 +18,6 @@
 #include 
 #include 
 #include 
-#include 

 struct panel_drv_data {
struct omap_dss_device dssdev;
@@ -197,73 +196,6 @@ static struct omap_dss_driver sharp_ls_ops = {
.get_resolution = omapdss_default_get_resolution,
 };

-static int sharp_ls_get_gpio(struct device *dev, int gpio, unsigned long flags,
- char *desc, struct gpio_desc **gpiod)
-{
-   struct gpio_desc *gd;
-   int r;
-
-   *gpiod = NULL;
-
-   r = devm_gpio_request_one(dev, gpio, flags, desc);
-   if (r)
-   return r == -ENOENT ? 0 : r;
-
-   gd = gpio_to_desc(gpio);
-   if (IS_ERR(gd))
-   return PTR_ERR(gd) == -ENOENT ? 0 : PTR_ERR(gd);
-
-   *gpiod = gd;
-   return 0;
-}
-
-static int sharp_ls_probe_pdata(struct platform_device *pdev)
-{
-   const struct panel_sharp_ls037v7dw01_platform_data *pdata;
-   struct panel_drv_data *ddata = platform_get_drvdata(pdev);
-   struct omap_dss_device *dssdev, *in;
-   int r;
-
-   pdata = dev_get_platdata(&pdev->dev);
-
-   in = omap_dss_find_output(pdata->source);
-   if (in == NULL) {
-   dev_err(&pdev->dev, "failed to find video source '%s'\n",
-   pdata->source);
-   return -EPROBE_DEFER;
-   }
-
-   ddata->in = in;
-
-   ddata->data_lines = pdata->data_lines;
-
-   dssdev = &ddata->dssdev;
-   dssdev->name = pdata->name;
-
-   r = sharp_ls_get_gpio(&pdev->dev, pdata->mo_gpio, GPIOF_OUT_INIT_LOW,
-   "lcd MO", &ddata->mo_gpio);
-   if (r)
-   return r;
-   r = sharp_ls_get_gpio(&pdev->dev, pdata->lr_gpio, GPIOF_OUT_INIT_HIGH,
-   "lcd LR", &ddata->lr_gpio);
-   if (r)
-   return r;
-   r = sharp_ls_get_gpio(&pdev->dev, pdata->ud_gpio, GPIOF_OUT_INIT_HIGH,
-   "lcd UD", &ddata->ud_gpio);
-   if (r)
-   return r;
-   r = sharp_ls_get_gpio(&pdev->dev, pdata->resb_gpio, GPIOF_OUT_INIT_LOW,
-   "lcd RESB", &ddata->resb_gpio);
-   if (r)
-   return r;
-   r = sharp_ls_get_gpio(&pdev->dev, pdata->ini_gpio, GPIOF_OUT_INIT_LOW,
-   "lcd INI", &ddata->ini_gpio);
-   if (r)
-   return r;
-
-   return 0;
-}
-
 static  int sharp_ls_get_gpio_of(struct device *dev, int index, int val,
const char *desc, struct gpio_desc **gpiod)
 {
@@ -340,17 +272,12 @@ static int sharp_ls_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, ddata);

-   if (dev_get_platdata(&pdev->dev)) {
-   r = sharp_ls_probe_pdata(pdev);
-   if (r)
-   return r;
-   } else if (pdev->dev.of_node) {
-   r = sharp_ls_probe_of(pdev);
-   if (r)
-   return r;
-   } else {
+   if (!pdev->dev.of_node)
return -ENODEV;
-   }
+
+   r = sharp_ls_probe_of(pdev);
+   if (r)
+   return r;

ddata->videomode = sharp_ls_timings;

-- 
2.5.0



[PATCH 09/42] drm/omap: panel-lgphilips-lb035q02: remove pdata support

2016-02-22 Thread Tomi Valkeinen
We no longer have any boards that require the platform data support from
the panel, so we can remove the related code.

Signed-off-by: Tomi Valkeinen 
---
 .../omapdrm/displays/panel-lgphilips-lb035q02.c| 53 ++
 1 file changed, 5 insertions(+), 48 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c 
b/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c
index 18eb60e9c9ec..458f77bc473d 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c
@@ -240,44 +240,6 @@ static struct omap_dss_driver lb035q02_ops = {
.get_resolution = omapdss_default_get_resolution,
 };

-static int lb035q02_probe_pdata(struct spi_device *spi)
-{
-   const struct panel_lb035q02_platform_data *pdata;
-   struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev);
-   struct omap_dss_device *dssdev, *in;
-   int r;
-
-   pdata = dev_get_platdata(&spi->dev);
-
-   in = omap_dss_find_output(pdata->source);
-   if (in == NULL) {
-   dev_err(&spi->dev, "failed to find video source '%s'\n",
-   pdata->source);
-   return -EPROBE_DEFER;
-   }
-
-   ddata->in = in;
-
-   ddata->data_lines = pdata->data_lines;
-
-   dssdev = &ddata->dssdev;
-   dssdev->name = pdata->name;
-
-   r = devm_gpio_request_one(&spi->dev, pdata->enable_gpio,
-   GPIOF_OUT_INIT_LOW, "panel enable");
-   if (r)
-   goto err_gpio;
-
-   ddata->enable_gpio = gpio_to_desc(pdata->enable_gpio);
-
-   ddata->backlight_gpio = pdata->backlight_gpio;
-
-   return 0;
-err_gpio:
-   omap_dss_put_device(ddata->in);
-   return r;
-}
-
 static int lb035q02_probe_of(struct spi_device *spi)
 {
struct device_node *node = spi->dev.of_node;
@@ -320,17 +282,12 @@ static int lb035q02_panel_spi_probe(struct spi_device 
*spi)

ddata->spi = spi;

-   if (dev_get_platdata(&spi->dev)) {
-   r = lb035q02_probe_pdata(spi);
-   if (r)
-   return r;
-   } else if (spi->dev.of_node) {
-   r = lb035q02_probe_of(spi);
-   if (r)
-   return r;
-   } else {
+   if (!spi->dev.of_node)
return -ENODEV;
-   }
+
+   r = lb035q02_probe_of(spi);
+   if (r)
+   return r;

if (gpio_is_valid(ddata->backlight_gpio)) {
r = devm_gpio_request_one(&spi->dev, ddata->backlight_gpio,
-- 
2.5.0



[PATCH 08/42] drm/omap: connector-hdmi: remove pdata support

2016-02-22 Thread Tomi Valkeinen
We no longer have any boards that require the platform data support from
the connector, so we can remove the related code.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 39 +++
 1 file changed, 5 insertions(+), 34 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c 
b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
index 6ee4129bc0c0..225fd8d6ab31 100644
--- a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
+++ b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
@@ -206,30 +206,6 @@ static struct omap_dss_driver hdmic_driver = {
.set_hdmi_infoframe = hdmic_set_infoframe,
 };

-static int hdmic_probe_pdata(struct platform_device *pdev)
-{
-   struct panel_drv_data *ddata = platform_get_drvdata(pdev);
-   struct connector_hdmi_platform_data *pdata;
-   struct omap_dss_device *in, *dssdev;
-
-   pdata = dev_get_platdata(&pdev->dev);
-
-   ddata->hpd_gpio = -ENODEV;
-
-   in = omap_dss_find_output(pdata->source);
-   if (in == NULL) {
-   dev_err(&pdev->dev, "Failed to find video source\n");
-   return -EPROBE_DEFER;
-   }
-
-   ddata->in = in;
-
-   dssdev = &ddata->dssdev;
-   dssdev->name = pdata->name;
-
-   return 0;
-}
-
 static int hdmic_probe_of(struct platform_device *pdev)
 {
struct panel_drv_data *ddata = platform_get_drvdata(pdev);
@@ -268,17 +244,12 @@ static int hdmic_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ddata);
ddata->dev = &pdev->dev;

-   if (dev_get_platdata(&pdev->dev)) {
-   r = hdmic_probe_pdata(pdev);
-   if (r)
-   return r;
-   } else if (pdev->dev.of_node) {
-   r = hdmic_probe_of(pdev);
-   if (r)
-   return r;
-   } else {
+   if (!pdev->dev.of_node)
return -ENODEV;
-   }
+
+   r = hdmic_probe_of(pdev);
+   if (r)
+   return r;

if (gpio_is_valid(ddata->hpd_gpio)) {
r = devm_gpio_request_one(&pdev->dev, ddata->hpd_gpio,
-- 
2.5.0



[PATCH 07/42] drm/omap: connector-dvi: remove pdata support

2016-02-22 Thread Tomi Valkeinen
We no longer have any boards that require the platform data support from
the connector, so we can remove the related code.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 55 +++-
 1 file changed, 5 insertions(+), 50 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/displays/connector-dvi.c 
b/drivers/gpu/drm/omapdrm/displays/connector-dvi.c
index d811e6dcaef7..3fd5a0b4d4cf 100644
--- a/drivers/gpu/drm/omapdrm/displays/connector-dvi.c
+++ b/drivers/gpu/drm/omapdrm/displays/connector-dvi.c
@@ -236,46 +236,6 @@ static struct omap_dss_driver dvic_driver = {
.detect = dvic_detect,
 };

-static int dvic_probe_pdata(struct platform_device *pdev)
-{
-   struct panel_drv_data *ddata = platform_get_drvdata(pdev);
-   struct connector_dvi_platform_data *pdata;
-   struct omap_dss_device *in, *dssdev;
-   int i2c_bus_num;
-
-   pdata = dev_get_platdata(&pdev->dev);
-   i2c_bus_num = pdata->i2c_bus_num;
-
-   if (i2c_bus_num != -1) {
-   struct i2c_adapter *adapter;
-
-   adapter = i2c_get_adapter(i2c_bus_num);
-   if (!adapter) {
-   dev_err(&pdev->dev,
-   "Failed to get I2C adapter, bus %d\n",
-   i2c_bus_num);
-   return -EPROBE_DEFER;
-   }
-
-   ddata->i2c_adapter = adapter;
-   }
-
-   in = omap_dss_find_output(pdata->source);
-   if (in == NULL) {
-   i2c_put_adapter(ddata->i2c_adapter);
-
-   dev_err(&pdev->dev, "Failed to find video source\n");
-   return -EPROBE_DEFER;
-   }
-
-   ddata->in = in;
-
-   dssdev = &ddata->dssdev;
-   dssdev->name = pdata->name;
-
-   return 0;
-}
-
 static int dvic_probe_of(struct platform_device *pdev)
 {
struct panel_drv_data *ddata = platform_get_drvdata(pdev);
@@ -319,17 +279,12 @@ static int dvic_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, ddata);

-   if (dev_get_platdata(&pdev->dev)) {
-   r = dvic_probe_pdata(pdev);
-   if (r)
-   return r;
-   } else if (pdev->dev.of_node) {
-   r = dvic_probe_of(pdev);
-   if (r)
-   return r;
-   } else {
+   if (pdev->dev.of_node)
return -ENODEV;
-   }
+
+   r = dvic_probe_of(pdev);
+   if (r)
+   return r;

ddata->timings = dvic_default_timings;

-- 
2.5.0



[PATCH 06/42] drm/omap: encoder-tfp410: remove pdata support

2016-02-22 Thread Tomi Valkeinen
We no longer have any boards that require the platform data support from
the encoder, so we can remove the related code.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 41 +++
 1 file changed, 5 insertions(+), 36 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c 
b/drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c
index d9048b3df495..2fd5602880a7 100644
--- a/drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c
+++ b/drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c
@@ -166,32 +166,6 @@ static const struct omapdss_dvi_ops tfp410_dvi_ops = {
.get_timings= tfp410_get_timings,
 };

-static int tfp410_probe_pdata(struct platform_device *pdev)
-{
-   struct panel_drv_data *ddata = platform_get_drvdata(pdev);
-   struct encoder_tfp410_platform_data *pdata;
-   struct omap_dss_device *dssdev, *in;
-
-   pdata = dev_get_platdata(&pdev->dev);
-
-   ddata->pd_gpio = pdata->power_down_gpio;
-
-   ddata->data_lines = pdata->data_lines;
-
-   in = omap_dss_find_output(pdata->source);
-   if (in == NULL) {
-   dev_err(&pdev->dev, "Failed to find video source\n");
-   return -ENODEV;
-   }
-
-   ddata->in = in;
-
-   dssdev = &ddata->dssdev;
-   dssdev->name = pdata->name;
-
-   return 0;
-}
-
 static int tfp410_probe_of(struct platform_device *pdev)
 {
struct panel_drv_data *ddata = platform_get_drvdata(pdev);
@@ -231,17 +205,12 @@ static int tfp410_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, ddata);

-   if (dev_get_platdata(&pdev->dev)) {
-   r = tfp410_probe_pdata(pdev);
-   if (r)
-   return r;
-   } else if (pdev->dev.of_node) {
-   r = tfp410_probe_of(pdev);
-   if (r)
-   return r;
-   } else {
+   if (!pdev->dev.of_node)
return -ENODEV;
-   }
+
+   r = tfp410_probe_of(pdev);
+   if (r)
+   return r;

if (gpio_is_valid(ddata->pd_gpio)) {
r = devm_gpio_request_one(&pdev->dev, ddata->pd_gpio,
-- 
2.5.0



[PATCH 05/42] drm/omap: panel-dsi-cm: remove pdata support

2016-02-22 Thread Tomi Valkeinen
We no longer have any boards that require the platform data support from
the panel, so we can remove the related code.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 49 +++--
 1 file changed, 5 insertions(+), 44 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c 
b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
index 3414c2609320..ae7dd625e19f 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
@@ -1127,40 +1127,6 @@ static struct omap_dss_driver dsicm_ops = {
.memory_read= dsicm_memory_read,
 };

-static int dsicm_probe_pdata(struct platform_device *pdev)
-{
-   const struct panel_dsicm_platform_data *pdata;
-   struct panel_drv_data *ddata = platform_get_drvdata(pdev);
-   struct omap_dss_device *dssdev, *in;
-
-   pdata = dev_get_platdata(&pdev->dev);
-
-   in = omap_dss_find_output(pdata->source);
-   if (in == NULL) {
-   dev_err(&pdev->dev, "failed to find video source\n");
-   return -EPROBE_DEFER;
-   }
-   ddata->in = in;
-
-   ddata->reset_gpio = pdata->reset_gpio;
-
-   if (pdata->use_ext_te)
-   ddata->ext_te_gpio = pdata->ext_te_gpio;
-   else
-   ddata->ext_te_gpio = -1;
-
-   ddata->ulps_timeout = pdata->ulps_timeout;
-
-   ddata->use_dsi_backlight = pdata->use_dsi_backlight;
-
-   ddata->pin_config = pdata->pin_config;
-
-   dssdev = &ddata->dssdev;
-   dssdev->name = pdata->name;
-
-   return 0;
-}
-
 static int dsicm_probe_of(struct platform_device *pdev)
 {
struct device_node *node = pdev->dev.of_node;
@@ -1214,17 +1180,12 @@ static int dsicm_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ddata);
ddata->pdev = pdev;

-   if (dev_get_platdata(dev)) {
-   r = dsicm_probe_pdata(pdev);
-   if (r)
-   return r;
-   } else if (pdev->dev.of_node) {
-   r = dsicm_probe_of(pdev);
-   if (r)
-   return r;
-   } else {
+   if (pdev->dev.of_node)
return -ENODEV;
-   }
+
+   r = dsicm_probe_of(pdev);
+   if (r)
+   return r;

ddata->timings.x_res = 864;
ddata->timings.y_res = 480;
-- 
2.5.0



[PATCH 04/42] drm/omap: omapdss.h: remove omap_hdmi_init

2016-02-22 Thread Tomi Valkeinen
omap_hdmi_init() function does not exist anymore, so we can remove the
declaration.

Signed-off-by: Tomi Valkeinen 
---
 include/video/omapdss.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 07c7d993c021..7a2724e1622f 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -332,8 +332,6 @@ struct omap_dss_board_info {

 /* Init with the board info */
 extern int omap_display_init(struct omap_dss_board_info *board_data);
-/* HDMI mux init*/
-extern int omap_hdmi_init(enum omap_hdmi_flags flags);

 struct omap_video_timings {
/* Unit: pixels */
-- 
2.5.0



[PATCH 03/42] drm/omap: omapdss.h: remove unused struct omap_dss_hdmi_data

2016-02-22 Thread Tomi Valkeinen
'struct omap_dss_hdmi_data' is not used anywhere, so we can remove it.

Signed-off-by: Tomi Valkeinen 
---
 include/video/omapdss.h | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 6c1a3e1b4d55..07c7d993c021 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -785,13 +785,6 @@ struct omap_dss_device {
struct omap_dss_device *dst;
 };

-struct omap_dss_hdmi_data
-{
-   int ct_cp_hpd_gpio;
-   int ls_oe_gpio;
-   int hpd_gpio;
-};
-
 struct omap_dss_driver {
int (*probe)(struct omap_dss_device *);
void (*remove)(struct omap_dss_device *);
-- 
2.5.0



[PATCH 02/42] drm/omap: move dss_suspend/resume_all to core.c

2016-02-22 Thread Tomi Valkeinen
core.c is the only caller of dss_disable_all_devices(). We can thus move
the function from display.c to core.c and make it static.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/core.c| 13 +
 drivers/gpu/drm/omapdrm/dss/display.c | 13 -
 drivers/gpu/drm/omapdrm/dss/dss.h |  2 --
 3 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/core.c 
b/drivers/gpu/drm/omapdrm/dss/core.c
index 1f55d0aae03d..7e4e5bebabbe 100644
--- a/drivers/gpu/drm/omapdrm/dss/core.c
+++ b/drivers/gpu/drm/omapdrm/dss/core.c
@@ -166,6 +166,19 @@ int dss_debugfs_create_file(const char *name, void 
(*write)(struct seq_file *))

 /* PLATFORM DEVICE */

+static void dss_disable_all_devices(void)
+{
+   struct omap_dss_device *dssdev = NULL;
+
+   for_each_dss_dev(dssdev) {
+   if (!dssdev->driver)
+   continue;
+
+   if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
+   dssdev->driver->disable(dssdev);
+   }
+}
+
 static int __init omap_dss_probe(struct platform_device *pdev)
 {
struct omap_dss_board_info *pdata = pdev->dev.platform_data;
diff --git a/drivers/gpu/drm/omapdrm/dss/display.c 
b/drivers/gpu/drm/omapdrm/dss/display.c
index 24c2bffa0036..9f3dd09b0a6c 100644
--- a/drivers/gpu/drm/omapdrm/dss/display.c
+++ b/drivers/gpu/drm/omapdrm/dss/display.c
@@ -78,19 +78,6 @@ void omapdss_default_get_timings(struct omap_dss_device 
*dssdev,
 }
 EXPORT_SYMBOL(omapdss_default_get_timings);

-void dss_disable_all_devices(void)
-{
-   struct omap_dss_device *dssdev = NULL;
-
-   for_each_dss_dev(dssdev) {
-   if (!dssdev->driver)
-   continue;
-
-   if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-   dssdev->driver->disable(dssdev);
-   }
-}
-
 static LIST_HEAD(panel_list);
 static DEFINE_MUTEX(panel_list_mutex);
 static int disp_num_counter;
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h 
b/drivers/gpu/drm/omapdrm/dss/dss.h
index a974d46672db..56ce89d4be27 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss.h
@@ -206,8 +206,6 @@ int dss_set_min_bus_tput(struct device *dev, unsigned long 
tput);
 int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file 
*));

 /* display */
-void dss_disable_all_devices(void);
-
 int display_init_sysfs(struct platform_device *pdev);
 void display_uninit_sysfs(struct platform_device *pdev);

-- 
2.5.0



[PATCH 01/42] drm/omap: fix suspend/resume handling

2016-02-22 Thread Tomi Valkeinen
For legacy reasons omapdss handles system suspend/resume via PM notifier
callback, where the driver disables/resumes all the outputs.

This doesn't work well with omapdrm. What happens on suspend is that the
omapdss disables the displays while omapdrm is still happily continuing
its work, possibly waiting for an vsync irq, which will never come if
the display output is disabled, leading to timeouts and errors sent to
userspace.

This patch moves the suspend/resume handling to omapdrm, and the
suspend/resume is now done safely inside modeset lock.

Signed-off-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/core.c| 29 ---
 drivers/gpu/drm/omapdrm/dss/display.c | 36 
 drivers/gpu/drm/omapdrm/dss/dss.h |  2 --
 drivers/gpu/drm/omapdrm/omap_drv.c| 44 +++
 4 files changed, 44 insertions(+), 67 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/core.c 
b/drivers/gpu/drm/omapdrm/dss/core.c
index 54eeb507f9b3..1f55d0aae03d 100644
--- a/drivers/gpu/drm/omapdrm/dss/core.c
+++ b/drivers/gpu/drm/omapdrm/dss/core.c
@@ -165,31 +165,6 @@ int dss_debugfs_create_file(const char *name, void 
(*write)(struct seq_file *))
 #endif /* CONFIG_OMAP2_DSS_DEBUGFS */

 /* PLATFORM DEVICE */
-static int omap_dss_pm_notif(struct notifier_block *b, unsigned long v, void 
*d)
-{
-   DSSDBG("pm notif %lu\n", v);
-
-   switch (v) {
-   case PM_SUSPEND_PREPARE:
-   case PM_HIBERNATION_PREPARE:
-   case PM_RESTORE_PREPARE:
-   DSSDBG("suspending displays\n");
-   return dss_suspend_all_devices();
-
-   case PM_POST_SUSPEND:
-   case PM_POST_HIBERNATION:
-   case PM_POST_RESTORE:
-   DSSDBG("resuming displays\n");
-   return dss_resume_all_devices();
-
-   default:
-   return 0;
-   }
-}
-
-static struct notifier_block omap_dss_pm_notif_block = {
-   .notifier_call = omap_dss_pm_notif,
-};

 static int __init omap_dss_probe(struct platform_device *pdev)
 {
@@ -211,8 +186,6 @@ static int __init omap_dss_probe(struct platform_device 
*pdev)
else if (pdata->default_device)
core.default_display_name = pdata->default_device->name;

-   register_pm_notifier(&omap_dss_pm_notif_block);
-
return 0;

 err_debugfs:
@@ -222,8 +195,6 @@ err_debugfs:

 static int omap_dss_remove(struct platform_device *pdev)
 {
-   unregister_pm_notifier(&omap_dss_pm_notif_block);
-
dss_uninitialize_debugfs();

return 0;
diff --git a/drivers/gpu/drm/omapdrm/dss/display.c 
b/drivers/gpu/drm/omapdrm/dss/display.c
index ef5b9027985d..24c2bffa0036 100644
--- a/drivers/gpu/drm/omapdrm/dss/display.c
+++ b/drivers/gpu/drm/omapdrm/dss/display.c
@@ -78,42 +78,6 @@ void omapdss_default_get_timings(struct omap_dss_device 
*dssdev,
 }
 EXPORT_SYMBOL(omapdss_default_get_timings);

-int dss_suspend_all_devices(void)
-{
-   struct omap_dss_device *dssdev = NULL;
-
-   for_each_dss_dev(dssdev) {
-   if (!dssdev->driver)
-   continue;
-
-   if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
-   dssdev->driver->disable(dssdev);
-   dssdev->activate_after_resume = true;
-   } else {
-   dssdev->activate_after_resume = false;
-   }
-   }
-
-   return 0;
-}
-
-int dss_resume_all_devices(void)
-{
-   struct omap_dss_device *dssdev = NULL;
-
-   for_each_dss_dev(dssdev) {
-   if (!dssdev->driver)
-   continue;
-
-   if (dssdev->activate_after_resume) {
-   dssdev->driver->enable(dssdev);
-   dssdev->activate_after_resume = false;
-   }
-   }
-
-   return 0;
-}
-
 void dss_disable_all_devices(void)
 {
struct omap_dss_device *dssdev = NULL;
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h 
b/drivers/gpu/drm/omapdrm/dss/dss.h
index 9a6453235585..a974d46672db 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss.h
@@ -206,8 +206,6 @@ int dss_set_min_bus_tput(struct device *dev, unsigned long 
tput);
 int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file 
*));

 /* display */
-int dss_suspend_all_devices(void);
-int dss_resume_all_devices(void);
 void dss_disable_all_devices(void);

 int display_init_sysfs(struct platform_device *pdev);
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c 
b/drivers/gpu/drm/omapdrm/omap_drv.c
index dfafdb602ad2..e21433c3fda4 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -900,12 +900,52 @@ static int pdev_remove(struct platform_device *device)
 }

 #ifdef CONFIG_PM_SLEEP
+static int omap_drm_suspend_all_displays(void)
+{
+   struct omap_dss_device *dssdev = NULL;
+
+   for_each_dss_dev(dssdev) {
+   if (!dssdev->driver)
+   co

[PATCH 00/42] drm/omap: patches for v4.6 part 2

2016-02-22 Thread Tomi Valkeinen
Hi,

Here's a second omapdrm patch series, based on top of the earlier series
"[PATCH 00/33] drm/omap: patches for v4.6".

The main theme in this series is cleanup. Now that we no longer share the
omapdss driver between omapdrm and omapfb, we can do some bigger cleanups.
However, we still share the include/video/omapdss.h file, which causes some
complications. And, unfortunately, it's not easy to fix that yet, so in this
series I make only parts of omapdss.h private to omapdrm and omapfb.

There are two main parts in the series: 

1) Remove platform data support from a bunch of panels, which are no longer
   used by any board files.

2) Remove omapdss compat code. "Compat" code in omapdss was used by omapfb, but
   there were some links to omapdrm too, as even if omapdrm didn't actually use
   the compat code, omapdrm still used some common functionalities which 
required
   the use of the compat code.

 Tomi

Tomi Valkeinen (42):
  drm/omap: fix suspend/resume handling
  drm/omap: move dss_suspend/resume_all to core.c
  drm/omap: omapdss.h: remove unused struct omap_dss_hdmi_data
  drm/omap: omapdss.h: remove omap_hdmi_init
  drm/omap: panel-dsi-cm: remove pdata support
  drm/omap: encoder-tfp410: remove pdata support
  drm/omap: connector-dvi: remove pdata support
  drm/omap: connector-hdmi: remove pdata support
  drm/omap: panel-lgphilips-lb035q02: remove pdata support
  drm/omap: panel-sharp-ls037v7dw01: remove pdata support
  drm/omap: panel-nec-nl8048hl11: remove pdata support
  drm/omap: panel-tpo-td028ttec1: remove pdata support
  drm/omap: panel-tpo-td043mtea1: remove pdata support
  drm/omap, omapfb: move exported dispc function declarations to
omapdrm/omapfb
  drm/omap: move struct dss_mgr_ops to omapdrm/omapfb
  drm/omap: move dss_mgr_* declarations to omapdrm/omapfb
  drm/omap: Add dispc_mgr_get_supported_outputs()
  drm/omap: remove crtc->mgr field
  drm/omap: remove use of omapdss_find_mgr_from_display()
  drm/omap: convert dss_mgr_ops to use omap_channel
  drm/omap: add dispc_channel_connected field to omap_dss_device
  drm/omap: use dispc_channel_connected in output drivers
  drm/omap: convert dss_mgr_connect to accept omap_channel
  drm/omap: convert dss_mgr_disconnect to accept omap_channel
  drm/omap: convert dss_mgr_set_timings to accept omap_channel
  drm/omap: convert dss_mgr_set_lcd_config to accept omap_channel
  drm/omap: convert dss_mgr_enable to accept omap_channel
  drm/omap: convert dss_mgr_disable to accept omap_channel
  drm/omap: convert dss_mgr_start_update to accept omap_channel
  drm/omap: convert dss_mgr_register_framedone_handler to accept
omap_channel
  drm/omap: convert dss_mgr_unregister_framedone_handler to accept
omap_channel
  drm/omap: remove extra check in dpi and sdi
  drm/omap: remove extra manager checks on disconnect
  drm/omap: DPI: remove uses of omap_overlay_manager
  drm/omap: HDMI5: remove uses of omap_overlay_manager
  drm/omap: HDMI4: remove uses of omap_overlay_manager
  drm/omap: SDI: remove uses of omap_overlay_manager
  drm/omap: VENC: remove uses of omap_overlay_manager
  drm/omap: DSI: remove uses of omap_overlay_manager
  drm/omap: remove last uses of omap_overlay_manager
  drm/omap: remove dss compat code
  drm/omap: remove dispc_ovl_check()

 drivers/gpu/drm/omapdrm/displays/connector-dvi.c   |   55 +-
 drivers/gpu/drm/omapdrm/displays/connector-hdmi.c  |   39 +-
 drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c  |   41 +-
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c|   49 +-
 .../omapdrm/displays/panel-lgphilips-lb035q02.c|   53 +-
 .../drm/omapdrm/displays/panel-nec-nl8048hl11.c|   44 +-
 .../drm/omapdrm/displays/panel-sharp-ls037v7dw01.c |   83 +-
 .../drm/omapdrm/displays/panel-tpo-td028ttec1.c|   41 +-
 .../drm/omapdrm/displays/panel-tpo-td043mtea1.c|   43 +-
 drivers/gpu/drm/omapdrm/dss/Makefile   |3 -
 drivers/gpu/drm/omapdrm/dss/apply.c| 1702 
 drivers/gpu/drm/omapdrm/dss/core.c |   36 +-
 drivers/gpu/drm/omapdrm/dss/dispc-compat.c |  667 
 drivers/gpu/drm/omapdrm/dss/dispc-compat.h |   30 -
 drivers/gpu/drm/omapdrm/dss/dispc.c|   51 +-
 drivers/gpu/drm/omapdrm/dss/display-sysfs.c|  356 
 drivers/gpu/drm/omapdrm/dss/display.c  |   49 -
 drivers/gpu/drm/omapdrm/dss/dpi.c  |   43 +-
 drivers/gpu/drm/omapdrm/dss/dsi.c  |   61 +-
 drivers/gpu/drm/omapdrm/dss/dss.h  |6 +-
 drivers/gpu/drm/omapdrm/dss/hdmi4.c|   33 +-
 drivers/gpu/drm/omapdrm/dss/hdmi5.c|   33 +-
 drivers/gpu/drm/omapdrm/dss/manager-sysfs.c|  531 --
 drivers/gpu/drm/omapdrm/dss/manager.c  |  263 ---
 drivers/gpu/drm/omapdrm/dss/omapdss.h  |   96 ++
 drivers/gpu/drm/omapdrm/dss/output.c   |   54 +-
 drivers/gpu/drm/omapdrm/dss/overlay-sysfs.c|  456 --
 drivers/gpu/dr

[PATCH v2 2/2] drm/panel: Support for LG lp120up1 panel with eDP input

2016-02-22 Thread Jitao Shi
The LG lp120up1 TFT LCD panel with eDP interface is a 12.0" 1920x1280
panel, which can be supported by the simple panel driver

Signed-off-by: Jitao Shi 
---
Changes since v1:
 - Add eDP panel type in comment msg
 - Fixed comment msg with 72 characters width
---
 drivers/gpu/drm/panel/panel-simple.c |   26 ++
 1 file changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index f88a631..2030c37 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -982,6 +982,29 @@ static const struct panel_desc lg_lb070wv8 = {
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
 };

+static const struct drm_display_mode lg_lp120up1_mode = {
+   .clock = 162300,
+   .hdisplay = 1920,
+   .hsync_start = 1920 + 40,
+   .hsync_end = 1920 + 40 + 40,
+   .htotal = 1920 + 40 + 40+ 80,
+   .vdisplay = 1280,
+   .vsync_start = 1280 + 4,
+   .vsync_end = 1280 + 4 + 4,
+   .vtotal = 1280 + 4 + 4 + 12,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc lg_lp120up1 = {
+   .modes = &lg_lp120up1_mode,
+   .num_modes = 1,
+   .bpc = 8,
+   .size = {
+   .width = 267,
+   .height = 183,
+   },
+};
+
 static const struct drm_display_mode lg_lp129qe_mode = {
.clock = 285250,
.hdisplay = 2560,
@@ -1256,6 +1279,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "lg,lb070wv8",
.data = &lg_lb070wv8,
}, {
+   .compatible = "lg,lp120up1",
+   .data = &lg_lp120up1,
+   }, {
.compatible = "lg,lp129qe",
.data = &lg_lp129qe,
}, {
-- 
1.7.9.5



[PATCH v2 1/2] dt-bindings: Add LG lp120up1 panel bindings

2016-02-22 Thread Jitao Shi
Add documentation for lp120up1 panel

Signed-off-by: Jitao Shi 
Acked-by: Rob Herring 
---
Changes since v1:
 - add Acked-by: Rob Herring 
---
 .../bindings/display/panel/lg,lp120up1.txt |7 +++
 1 file changed, 7 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/lg,lp120up1.txt

diff --git a/Documentation/devicetree/bindings/display/panel/lg,lp120up1.txt 
b/Documentation/devicetree/bindings/display/panel/lg,lp120up1.txt
new file mode 100644
index 000..8c5de69
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/lg,lp120up1.txt
@@ -0,0 +1,7 @@
+LG 12.0" (1920x1280 pixels) TFT LCD panel
+
+Required properties:
+- compatible: should be "lg,lp120up1"
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
-- 
1.7.9.5



[Bug 93784] Hybrid graphics: GPU lockup when running glxgears

2016-02-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=93784

--- Comment #6 from bartos.petr at gmail.com ---
I'm on Mesa 11.1.0 (git-525f3c2). Happens with kernel 4.3.x and 4.4.x on Fedora
23

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/7c76dcf0/attachment.html>


[Bug 93784] Hybrid graphics: GPU lockup when running glxgears

2016-02-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=93784

--- Comment #5 from bartos.petr at gmail.com ---
(In reply to Nicolas Koch from comment #4)
> Forgot to mention, of course I ran glxinfo with DRI_PRIME=1

Same problem here with ThinkPad L450

05:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Jet XT
[Radeon R5 M240] (rev ff)

I found than setting both integrated and discrete gpu to DRI3 allows to run
glxgears, however it hard-freezes once any gpu intensive application is run for
more than few minutes. Using additional vblank_mode=0 causes this hard-freeze
to appear faster. Before hard-freeze there is massive fps drop during which it
is possible to kill the application and avoid freeze.

Also using

echo "DDIS" > /sys/kernel/debug/vgaswitcheroo/switch

and restarting X causes black screen (with backlight turned of) but that might
be another bug

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/22593699/attachment.html>


GSoC 2016

2016-02-22 Thread Mehul Sawarkar
Hello,

I am Mehul Sawarkar from India .I want to be part of X.Org during GSoC
2016.I know C/C++.Please help me getting started with some easy task you
might have in mind.What are some of prospective project ideas for GSoC 2016.
I'll be happy to have your help and suggestions.

Thanks
Mehul Sawarkar
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/5bc4e499/attachment.html>


[PATCH 0/8] drm: msm: module rework

2016-02-22 Thread Rob Clark
On Mon, Feb 22, 2016 at 4:08 PM, Arnd Bergmann  wrote:
> I saw some regressions on today's Linux-next kernel after
> the Makefiles got reworked and tried to come up with a quick
> fix. This ended up taking much longer, but the new version should
> be cleaner and I no longer get any build errors in this
> driver.

fyi, for the time being, I've already kicked out the kconfig/makefile
splitup patches..

I'll go ahead and pull in the hdmi symbol rename patch, since that is
a sane thing to do.  I'm less sure about splitting things up into
separate .ko's.  And I think having the .ko name not match the drm
driver name (ie. what is passed in to drmOpen() in userspace) would
cause issues since libdrm could try to modprobe $drivername.ko.  (I
*think* that only matters in the non-udev case?  Which is at least not
a common case, but breaking userspace is breaking userspace...)

BR,
-R

> The first two patches are just preparation to avoid the
> namespace problems with global symbols and the module name.
>
> The next five patches separate out each subdirectory that has
> its own Makefile into a separate loadable module.
>
> The final patch is just a nice addon, it should work in theory
> but this needs to be tested well.


[Bug 94231] Problems compiling libdrm since glibc 2.23

2016-02-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=94231

Emil Velikov  changed:

   What|Removed |Added

   See Also||https://bugs.freedesktop.or
   ||g/show_bug.cgi?id=94232

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/833c8b7a/attachment.html>


Disabling graph endpoints in device trees

2016-02-22 Thread John Keeping
Hi Phillipp,

On Mon, 22 Feb 2016 17:12:27 +0100, Philipp Zabel wrote:
> Am Montag, den 22.02.2016, 14:14 + schrieb John Keeping:
> > Is there a reason why endpoints in a device tree graph can't be
> > disabled?  
> 
> You can always remove them using /delete-node/, which also has the
> advantage of reminding you not to leave a single dangling endpoint.

Thanks, I wasn't aware of /delete-node/.  It does indeed do what I want.

> > I would like to be able to force the use of a particular CRTC for
> > certain outputs even though the hardware is capable of connecting any
> > CRTC to any output.  In this case I need to be able to support a wide
> > range of frequencies for external HDMI monitors so I will configure one
> > of the CRTCs to be able to generate these while the other will be tied
> > into a limited set of clock rates as a result of the overall system
> > clock setup.
> > 
> > Currently this can only be achieved by removing the endpoints from the
> > base SoC .dtsi file but it feels like it should be possible to add
> > 'status = "disabled"' to the nodes in the board-specific .dts in order
> > to disable undesirable configurations.
> >
> > I tested the change below and it behaves exactly as I want, but I don't
> > claim to understand all of the users of these functions to know if it
> > will break something else (hence this isn't a formal patch).  
> 
> I don't know that any driver depends on being able to parse disabled
> endpoints, but given the above I'm not sure that keeping disabled
> endpoints in the device tree is a useful feature.
> Disabling ports makes more sense to me. It should be documented in
> Documentation/devicetree/bindings/graph.txt though.

That isn't relevent for my scenario because this case has a port with
multiple endpoints and we only want one of the endpoints to be
available:

vopb_out: port {
#address-cells = <1>;
#size-cells = <0>;

vopb_out_hdmi: endpoint at 0 {
reg = <0>;
remote-endpoint = <&hdmi_in_vopb>;
};
vopb_out_mipi: endpoint at 1 {
reg = <1>;
remote-endpoint = <&mipi_in_vopb>;
};
};

But I'm happy that /delete-node/ works and seems to be the right thing
to do.


Thanks,
John


[Bug 93217] [tonga] [powerplay] Radon M395X isn't initialised with the powerplay branch

2016-02-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=93217

--- Comment #30 from Alex Deucher  ---
(In reply to Mike Lothian from comment #29)
> Would you like me to try re-enabling pcie dpm and use the new kernel
> parameters in drm-next-4.6-wip?

Yes, can you see what combinations of pcie_gen_cap and pcie_lane_cap help?  See
amd_pcie.h.

pcie_gen_cap:
bits 31:16 define the gen speeds supported by the platform (e.g., the
motherboard).  Setting it to CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3 (0x0004)
would indicate that the motherboard only supports gen3 (not gen 2 or 1).
bits 15:0 define the pcie speeds supported by the GPU itself.  Setting this to
CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN3 (0x0004) means the asic only
supports gen 3.

pcie_lane_cap:
bits 31:16 define the link width supported by the platform.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/8626ba26/attachment.html>


Disabling graph endpoints in device trees

2016-02-22 Thread Philipp Zabel
Hi John,

Am Montag, den 22.02.2016, 14:14 + schrieb John Keeping:
> Hi,
> 
> Is there a reason why endpoints in a device tree graph can't be
> disabled?

You can always remove them using /delete-node/, which also has the
advantage of reminding you not to leave a single dangling endpoint.

> I would like to be able to force the use of a particular CRTC for
> certain outputs even though the hardware is capable of connecting any
> CRTC to any output.  In this case I need to be able to support a wide
> range of frequencies for external HDMI monitors so I will configure one
> of the CRTCs to be able to generate these while the other will be tied
> into a limited set of clock rates as a result of the overall system
> clock setup.
> 
> Currently this can only be achieved by removing the endpoints from the
> base SoC .dtsi file but it feels like it should be possible to add
> 'status = "disabled"' to the nodes in the board-specific .dts in order
> to disable undesirable configurations.
>
> I tested the change below and it behaves exactly as I want, but I don't
> claim to understand all of the users of these functions to know if it
> will break something else (hence this isn't a formal patch).

I don't know that any driver depends on being able to parse disabled
endpoints, but given the above I'm not sure that keeping disabled
endpoints in the device tree is a useful feature.
Disabling ports makes more sense to me. It should be documented in
Documentation/devicetree/bindings/graph.txt though.

> -- >8 --
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 017dd94..1e56b91 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -2143,7 +2143,7 @@ struct device_node *of_graph_get_port_by_id(struct 
> device_node *parent, u32 id)
>   if (node)
>   parent = node;
>  
> - for_each_child_of_node(parent, port) {
> + for_each_available_child_of_node(parent, port) {
>   u32 port_id = 0;
>  
>   if (of_node_cmp(port->name, "port") != 0)
> @@ -2209,7 +2209,7 @@ struct device_node *of_graph_get_next_endpoint(const 
> struct device_node *parent,
>* getting the next child. If the previous endpoint is NULL this
>* will return the first child.
>*/
> - endpoint = of_get_next_child(port, prev);
> + endpoint = of_get_next_available_child(port, prev);
>   if (endpoint) {
>   of_node_put(port);
>   return endpoint;
> @@ -2219,7 +2219,7 @@ struct device_node *of_graph_get_next_endpoint(const 
> struct device_node *parent,
>   prev = NULL;
>  
>   do {
> - port = of_get_next_child(parent, port);
> + port = of_get_next_available_child(parent, port);
>   if (!port)
>   return NULL;
>   } while (of_node_cmp(port->name, "port"));
> -- 8< --
> 
> 
> Thanks,
> John

best regards
Philipp



[PATCH 4/5] drm/i915: Implement color management on bdw/skl/bxt/kbl

2016-02-22 Thread Matt Roper
On Mon, Feb 22, 2016 at 02:18:10PM +, Lionel Landwerlin wrote:
> Patch based on a previous series by Shashank Sharma.
> 
> v2: Do not read GAMMA_MODE register to figure what mode we're in
> 
> v3: Program PREC_PAL_GC_MAX to clamp pixel values > 1.0
> 
> Add documentation on how the Broadcast RGB property is affected by CTM
> 
> v4: Update contributors
> 
> v5: Refactor degamma/gamma LUTs load into a single function
> 
> v6: Fix missing intel_crtc variable (bisect issue)

Not sure if you saw me feedback on v4 or not:
   https://lists.freedesktop.org/archives/intel-gfx/2016-February/088043.html

It looks like most of those comments still apply here.  If you disagree
with my comments, that's fine too, I just wanted to make sure it didn't
get overlooked.  :-)


Matt

> 
> Signed-off-by: Shashank Sharma 
> Signed-off-by: Lionel Landwerlin 
> Signed-off-by: Kumar, Kiran S 
> Signed-off-by: Kausal Malladi 
> ---
>  Documentation/DocBook/gpu.tmpl   |   6 +-
>  drivers/gpu/drm/i915/i915_drv.c  |  24 ++-
>  drivers/gpu/drm/i915/i915_drv.h  |   6 +
>  drivers/gpu/drm/i915/i915_reg.h  |  22 +++
>  drivers/gpu/drm/i915/intel_color.c   | 356 
> ++-
>  drivers/gpu/drm/i915/intel_display.c |  22 ++-
>  drivers/gpu/drm/i915/intel_drv.h |   3 +-
>  drivers/gpu/drm/i915/intel_fbdev.c   |   8 +
>  8 files changed, 383 insertions(+), 64 deletions(-)
> 
> diff --git a/Documentation/DocBook/gpu.tmpl b/Documentation/DocBook/gpu.tmpl
> index 1692c4d..430e99b 100644
> --- a/Documentation/DocBook/gpu.tmpl
> +++ b/Documentation/DocBook/gpu.tmpl
> @@ -2153,7 +2153,11 @@ void intel_crt_init(struct drm_device *dev)
>   ENUM
>   { "Automatic", "Full", "Limited 16:235" }
>   Connector
> - TBD
> + When this property is set to Limited 16:235
> + and CTM is set, the hardware will be programmed with the
> + result of the multiplication of CTM by the limited range
> + matrix to ensure the pixels normaly in the range 0..1.0 are
> + remapped to the range 16/255..235/255.
>   
>   
>   “audio”
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 20e8200..3807b73 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -66,6 +66,9 @@ static struct drm_driver driver;
>  #define IVB_CURSOR_OFFSETS \
>   .cursor_offsets = { CURSOR_A_OFFSET, IVB_CURSOR_B_OFFSET, 
> IVB_CURSOR_C_OFFSET }
>  
> +#define BDW_COLORS \
> + .color = { .degamma_lut_size = 512, .gamma_lut_size = 512 }
> +
>  static const struct intel_device_info intel_i830_info = {
>   .gen = 2, .is_mobile = 1, .cursor_needs_physical = 1, .num_pipes = 2,
>   .has_overlay = 1, .overlay_needs_physical = 1,
> @@ -288,24 +291,28 @@ static const struct intel_device_info 
> intel_haswell_m_info = {
>   .is_mobile = 1,
>  };
>  
> +#define BDW_FEATURES \
> + HSW_FEATURES, \
> + BDW_COLORS
> +
>  static const struct intel_device_info intel_broadwell_d_info = {
> - HSW_FEATURES,
> + BDW_FEATURES,
>   .gen = 8,
>  };
>  
>  static const struct intel_device_info intel_broadwell_m_info = {
> - HSW_FEATURES,
> + BDW_FEATURES,
>   .gen = 8, .is_mobile = 1,
>  };
>  
>  static const struct intel_device_info intel_broadwell_gt3d_info = {
> - HSW_FEATURES,
> + BDW_FEATURES,
>   .gen = 8,
>   .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
>  };
>  
>  static const struct intel_device_info intel_broadwell_gt3m_info = {
> - HSW_FEATURES,
> + BDW_FEATURES,
>   .gen = 8, .is_mobile = 1,
>   .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
>  };
> @@ -321,13 +328,13 @@ static const struct intel_device_info 
> intel_cherryview_info = {
>  };
>  
>  static const struct intel_device_info intel_skylake_info = {
> - HSW_FEATURES,
> + BDW_FEATURES,
>   .is_skylake = 1,
>   .gen = 9,
>  };
>  
>  static const struct intel_device_info intel_skylake_gt3_info = {
> - HSW_FEATURES,
> + BDW_FEATURES,
>   .is_skylake = 1,
>   .gen = 9,
>   .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
> @@ -345,17 +352,18 @@ static const struct intel_device_info 
> intel_broxton_info = {
>   .has_fbc = 1,
>   GEN_DEFAULT_PIPEOFFSETS,
>   IVB_CURSOR_OFFSETS,
> + BDW_COLORS,
>  };
>  
>  static const struct intel_device_info intel_kabylake_info = {
> - HSW_FEATURES,
> + BDW_FEATURES,
>   .is_preliminary = 1,
>   .is_kabylake = 1,
>   .gen = 9,
>  };
>  
>  static const struct intel_device_info intel_kabylake_gt3_info = {
> - HSW_FEATURES,
> + BDW_FEATURES,
>   .is_preliminary = 1,
>   .is_kabylake = 1,
>   .gen = 9,
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 6634c09..7627a4e 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/d

[PATCH v2 2/2] drm/panel: Support for LG lp120up1 panel with eDP input

2016-02-22 Thread sanjeev sharma
Hello Jitao,

Can't we add this panel information in device tree file instead inside the
device driver ?

Regards
Sanjeev Sharma

On Mon, Feb 22, 2016 at 4:31 PM, Jitao Shi  wrote:

> The LG lp120up1 TFT LCD panel with eDP interface is a 12.0" 1920x1280
> panel, which can be supported by the simple panel driver
>
> Signed-off-by: Jitao Shi 
> ---
> Changes since v1:
>  - Add eDP panel type in comment msg
>  - Fixed comment msg with 72 characters width
> ---
>  drivers/gpu/drm/panel/panel-simple.c |   26 ++
>  1 file changed, 26 insertions(+)
>
> diff --git a/drivers/gpu/drm/panel/panel-simple.c
> b/drivers/gpu/drm/panel/panel-simple.c
> index f88a631..2030c37 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -982,6 +982,29 @@ static const struct panel_desc lg_lb070wv8 = {
> .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
>  };
>
> +static const struct drm_display_mode lg_lp120up1_mode = {
> +   .clock = 162300,
> +   .hdisplay = 1920,
> +   .hsync_start = 1920 + 40,
> +   .hsync_end = 1920 + 40 + 40,
> +   .htotal = 1920 + 40 + 40+ 80,
> +   .vdisplay = 1280,
> +   .vsync_start = 1280 + 4,
> +   .vsync_end = 1280 + 4 + 4,
> +   .vtotal = 1280 + 4 + 4 + 12,
> +   .vrefresh = 60,
> +};
> +
> +static const struct panel_desc lg_lp120up1 = {
> +   .modes = &lg_lp120up1_mode,
> +   .num_modes = 1,
> +   .bpc = 8,
> +   .size = {
> +   .width = 267,
> +   .height = 183,
> +   },
> +};
> +
>  static const struct drm_display_mode lg_lp129qe_mode = {
> .clock = 285250,
> .hdisplay = 2560,
> @@ -1256,6 +1279,9 @@ static const struct of_device_id platform_of_match[]
> = {
> .compatible = "lg,lb070wv8",
> .data = &lg_lb070wv8,
> }, {
> +   .compatible = "lg,lp120up1",
> +   .data = &lg_lp120up1,
> +   }, {
> .compatible = "lg,lp129qe",
> .data = &lg_lp129qe,
> }, {
> --
> 1.7.9.5
>
>
> ___
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/1808403d/attachment-0001.html>


[Intel-gfx] [PATCH 2/5] drm/i915: Do not read GAMMA_MODE register

2016-02-22 Thread Matt Roper
On Mon, Feb 22, 2016 at 02:18:08PM +, Lionel Landwerlin wrote:
> Implement Daniel Stone's recommendation to not read registers to infer
> the hardware's state.
> 
> Signed-off-by: Lionel Landwerlin 

Do we need to ensure that software and hardware state are synchronized
at startup?  A boot firmware might have set it to something different
before our driver starts up; if we use 'fastboot' then we might not do
any modesets and might wind up with 0 (8BIT) in our state variable, but
something else actually programmed into the hardware.


Matt

> ---
>  drivers/gpu/drm/i915/intel_color.c | 7 +--
>  drivers/gpu/drm/i915/intel_drv.h   | 3 +++
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_color.c 
> b/drivers/gpu/drm/i915/intel_color.c
> index cce0155..ba27ce2 100644
> --- a/drivers/gpu/drm/i915/intel_color.c
> +++ b/drivers/gpu/drm/i915/intel_color.c
> @@ -126,6 +126,8 @@ static void haswell_load_luts(struct drm_crtc *crtc)
>   struct drm_device *dev = crtc->dev;
>   struct drm_i915_private *dev_priv = dev->dev_private;
>   struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> + struct intel_crtc_state *intel_crtc_state =
> + to_intel_crtc_state(crtc->state);
>   bool reenable_ips = false;
>  
>   /*
> @@ -133,11 +135,12 @@ static void haswell_load_luts(struct drm_crtc *crtc)
>* GAMMA_MODE is configured for split gamma and IPS_CTL has IPS enabled.
>*/
>   if (IS_HASWELL(dev) && intel_crtc->config->ips_enabled &&
> - ((I915_READ(GAMMA_MODE(intel_crtc->pipe)) & GAMMA_MODE_MODE_MASK) ==
> -  GAMMA_MODE_MODE_SPLIT)) {
> + (intel_crtc_state->gamma_mode == GAMMA_MODE_MODE_SPLIT)) {
>   hsw_disable_ips(intel_crtc);
>   reenable_ips = true;
>   }
> +
> + intel_crtc_state->gamma_mode = GAMMA_MODE_MODE_8BIT;
>   I915_WRITE(GAMMA_MODE(intel_crtc->pipe), GAMMA_MODE_MODE_8BIT);
>  
>   i9xx_load_luts(crtc);
> diff --git a/drivers/gpu/drm/i915/intel_drv.h 
> b/drivers/gpu/drm/i915/intel_drv.h
> index 40fc486..9742d5b 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -517,6 +517,9 @@ struct intel_crtc_state {
>   struct skl_pipe_wm skl;
>   } optimal;
>   } wm;
> +
> + /* Gamma mode programmed on the pipe */
> + uint32_t gamma_mode;
>  };
>  
>  struct vlv_wm_state {
> -- 
> 2.7.0
> 
> ___
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795


[PATCH v2 13/13] dt-bindings: msm/hdmi: Add HDMI PHY bindings

2016-02-22 Thread Archit Taneja


On 02/22/2016 08:24 AM, Rob Herring wrote:
> On Mon, Feb 15, 2016 at 12:23:26PM +0530, Archit Taneja wrote:
>> Add HDMI PHY bindings. Update the example to use HDMI PHY.
>>
>> Add a missing power-domains property in the HDMI core bindings.
>>
>> Cc: devicetree at vger.kernel.org
>> Cc: Rob Herring 
>>
>> Signed-off-by: Archit Taneja 
>> ---
>>   .../devicetree/bindings/display/msm/hdmi.txt   | 39 
>> +-
>>   1 file changed, 38 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/display/msm/hdmi.txt 
>> b/Documentation/devicetree/bindings/display/msm/hdmi.txt
>> index 379ee2e..4d71910 100644
>> --- a/Documentation/devicetree/bindings/display/msm/hdmi.txt
>> +++ b/Documentation/devicetree/bindings/display/msm/hdmi.txt
>> @@ -11,6 +11,7 @@ Required properties:
>>   - reg: Physical base address and length of the controller's registers
>>   - reg-names: "core_physical"
>>   - interrupts: The interrupt signal from the hdmi block.
>> +- power-domains: Should be <&mmcc MDSS_GDSC>.
>>   - clocks: device clocks
>> See ../clocks/clock-bindings.txt for details.
>>   - qcom,hdmi-tx-ddc-clk-gpio: ddc clk pin
>> @@ -18,6 +19,7 @@ Required properties:
>>   - qcom,hdmi-tx-hpd-gpio: hpd pin
>>   - core-vdda-supply: phandle to supply regulator
>>   - hdmi-mux-supply: phandle to mux regulator
>> +- qcom,hdmi-phy: phandle to HDMI PHY device node
>
> Why not use the generic phy binding?

You'd asked about this in the first version of this patch. You
probably missed reading my reply. Partially my fault since I
missed out putting the "In-Reply-to" when posting this set. I've
mentioned the reason again here:

The PHY in the HDMI and DSI blocks can't be implemented using the
common phy framework. The PHY blocks have a PLL sub-block within
them which acts as a pixel clock source for the display processor
block.

This dependency causes the need to split the phy power on sequence
into 2 parts (one to enable resources to enable the PLL, and the
other to enable the phy itself), which the phy framework can't
do. That's the main reason not to use it. There are some more
complex use cases for DSI PHY (drive two PHYs with the same
DSI PLL) which the phy framework can't support.

>
>>
>>   Optional properties:
>>   - qcom,hdmi-tx-mux-en-gpio: hdmi mux enable pin
>> @@ -27,6 +29,27 @@ Optional properties:
>>   - pinctrl-0: the default pinctrl state (active)
>>   - pinctrl-1: the "sleep" pinctrl state
>>
>> +HDMI PHY:
>> +Required properties:
>> +- compatible: Could be the following
>> +  * "qcom,hdmi-phy-8x60"
>> +  * "qcom,hdmi-phy-8960"
>> +  * "qcom,hdmi-phy-8x74"
>
> No wildcards please. Where's 8994?

I'll remove the wildcards. 8994 PHY isn't supported by the driver at
the moment. I could keep the 8994 compatible string, the driver will
bail out with an error. But that's something we already do for 8x74
since it doesn't have full PHY support either.

>
>> +  * "qcom,hdmi-phy-8996"
>> +- reg: Physical base address and length of the registers of the PHY sub 
>> blocks.
>> +- reg-names: The names of register regions. The following regions are 
>> required:
>> +  * "hdmi_pll"
>> +  * "hdmi_phy"
>> +  For HDMI PHY on msm8996, these additional register regions are required:
>> +* "hdmi_tx_l0"
>> +* "hdmi_tx_l1"
>> +* "hdmi_tx_l3"
>> +* "hdmi_tx_l4"
>> +- power-domains: Should be <&mmcc MDSS_GDSC>.
>> +- clocks: device clocks
>> +  See Documentation/devicetree/bindings/clocks/clock-bindings.txt for 
>> details.
>> +- core-vdda-supply: phandle to vdda regulator device node
>> +
>>   Example:
>>
>>   / {
>> @@ -35,7 +58,7 @@ Example:
>>  hdmi: qcom,hdmi-tx-8960 at 4a0 {
>
> Node names should be generic, so just "hdmi".
>
>>  compatible = "qcom,hdmi-tx-8960";
>>  reg-names = "core_physical";
>> -reg = <0x04a0 0x1000>;
>> +reg = <0x04a0 0x2f0>;
>>  interrupts = ;
>>  power-domains = <&mmcc MDSS_GDSC>;
>>  clock-names =
>> @@ -54,5 +77,19 @@ Example:
>>  pinctrl-names = "default", "sleep";
>>  pinctrl-0 = <&hpd_active  &ddc_active  &cec_active>;
>>  pinctrl-1 = <&hpd_suspend &ddc_suspend &cec_suspend>;
>> +
>> +qcom,hdmi-phy = <&hdmi_phy>;
>> +};
>> +
>> +hdmi_phy: qcom,hdmi-phy-8960 at 4a00400 {
>
> ditto. phy at ...

I'll fix these.

Thanks,
Archit

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum, hosted by The Linux Foundation


[Bug 94249] Topaz GPU not working correctly

2016-02-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=94249

Alex Deucher  changed:

   What|Removed |Added

Summary|Linux incorrectly detects a |Topaz GPU not working
   |Radeon GPU  |correctly

--- Comment #1 from Alex Deucher  ---
The driver is correct.  It is a topaz GPU.  Try disabling runpm (append
amdgpu.runpm=0 on the kernel command line in grub).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/1874b160/attachment.html>


[PATCH 1/5] drm/i915: Extract out gamma table and CSC to their own file

2016-02-22 Thread Matt Roper
On Mon, Feb 22, 2016 at 02:18:07PM +, Lionel Landwerlin wrote:
> The moves a couple of functions programming the gamma LUT and CSC
> units into their own file.
> 
> On generations prior to Haswell there is only a gamma LUT. From
> haswell on there is also a new enhanced color correction unit that
> isn't used yet. This is why we need to set the GAMMA_MODE register,
> either we're using the legacy 8bits LUT or enhanced LUTs (of 10 or
> 12bits).
> 
> The CSC unit is only available from Haswell on.
> 
> We also need to make a special case for CherryView which is recognized
> as a gen 8 but doesn't have the same enhanced color correction unit
> from Haswell on.
> 
> v2: Fix access to GAMMA_MODE register on older generations than
> Haswell (from Matt Roper's comments)
> 
> Signed-off-by: Lionel Landwerlin 

Reviewed-by: Matt Roper 

> ---
>  drivers/gpu/drm/i915/Makefile|   1 +
>  drivers/gpu/drm/i915/i915_drv.h  |   2 +
>  drivers/gpu/drm/i915/intel_color.c   | 195 
> +++
>  drivers/gpu/drm/i915/intel_display.c | 163 +++--
>  drivers/gpu/drm/i915/intel_drv.h |  10 ++
>  5 files changed, 220 insertions(+), 151 deletions(-)
>  create mode 100644 drivers/gpu/drm/i915/intel_color.c
> 
> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> index 0851de07..0516300 100644
> --- a/drivers/gpu/drm/i915/Makefile
> +++ b/drivers/gpu/drm/i915/Makefile
> @@ -55,6 +55,7 @@ i915-y += intel_audio.o \
> intel_atomic.o \
> intel_atomic_plane.o \
> intel_bios.o \
> +   intel_color.o \
> intel_display.o \
> intel_fbc.o \
> intel_fifo_underrun.o \
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 6644c2e..6634c09 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -659,6 +659,8 @@ struct drm_i915_display_funcs {
>   /* render clock increase/decrease */
>   /* display clock increase/decrease */
>   /* pll clock increase/decrease */
> +
> + void (*load_luts)(struct drm_crtc *crtc);
>  };
>  
>  enum forcewake_domain_id {
> diff --git a/drivers/gpu/drm/i915/intel_color.c 
> b/drivers/gpu/drm/i915/intel_color.c
> new file mode 100644
> index 000..cce0155
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/intel_color.c
> @@ -0,0 +1,195 @@
> +/*
> + * Copyright © 2016 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> + * DEALINGS IN THE SOFTWARE.
> + *
> + */
> +
> +#include "intel_drv.h"
> +
> +/*
> + * Set up the pipe CSC unit.
> + *
> + * Currently only full range RGB to limited range RGB conversion
> + * is supported, but eventually this should handle various
> + * RGB<->YCbCr scenarios as well.
> + */
> +static void i9xx_load_csc_matrix(struct drm_crtc *crtc)
> +{
> + struct drm_device *dev = crtc->dev;
> + struct drm_i915_private *dev_priv = dev->dev_private;
> + struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> + int pipe = intel_crtc->pipe;
> + uint16_t coeff = 0x7800; /* 1.0 */
> +
> + /*
> +  * TODO: Check what kind of values actually come out of the pipe
> +  * with these coeff/postoff values and adjust to get the best
> +  * accuracy. Perhaps we even need to take the bpc value into
> +  * consideration.
> +  */
> +
> + if (intel_crtc->config->limited_color_range)
> + coeff = ((235 - 16) * (1 << 12) / 255) & 0xff8; /* 0.xxx... */
> +
> + /*
> +  * GY/GU and RY/RU should be the other way around according
> +  * to BSpec, but reality doesn't agree. Just set them up in
> +  * a way that results in the correct picture.
> +  */
> + I915_WRITE(PIPE_CSC_COEFF_RY_GY(pipe), coeff << 16);
> + I915_WRITE(PIPE_CSC_COEFF_BY(pipe), 0);
> +
> + I915_WRITE(PIPE_CSC_COEFF_RU_GU(pipe), coeff);
> + I915_WRITE(PIPE_CS

[Bug 94249] Linux incorrectly detects a Radeon GPU

2016-02-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=94249

Bug ID: 94249
   Summary: Linux incorrectly detects a Radeon GPU
   Product: DRI
   Version: unspecified
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: DRM/AMDgpu
  Assignee: dri-devel at lists.freedesktop.org
  Reporter: krejzi at email.com

I've recently got a HP Probook 470 G3 laptop, which has an onboard Intel
Skylake Graphics and an AMD Radeon R7 M340 GPU.

However, the Linux seems to detect the GPU as following:

01:00.0 Display controller [0380]: Advanced Micro Devices, Inc. [AMD/ATI] Topaz
XT [Radeon R7 M260/M265] [1002:6900] (rev 83)   

Which makes it a GCN 1.2 GPU which tries to use AMDGPU. That of course doesn't
work. The driver loads, but as soon as it does, it corrupts all the available
data from lspci -v output. I also can't use it with DRI_PRIME, since X server
crashes while loading amdgpu (probably due to it not being an amdgpu supported
GPU).

Wikipedia identifies the mentioned card as GCN 1.0 OLAND GPU. Windows catalyst
also claims it's R7 M340 and not R7 M360.

It's probably a BIOS issue, but can it be worked around somehow?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/5d183f9b/attachment.html>


[PATCH v2 1/2] drm: Improve drm_of_component_probe() to correctly handle ports and remote ports.

2016-02-22 Thread Liviu Dudau
On Mon, Feb 22, 2016 at 03:51:29PM +, Russell King - ARM Linux wrote:
> On Mon, Feb 22, 2016 at 11:51:47AM +, Liviu Dudau wrote:
> > On Fri, Nov 20, 2015 at 02:22:04PM +, Liviu Dudau wrote:
> > > Rockchip DRM driver cannot use the same compare_of() function to
> > > match ports and remote ports (aka encoders) as their OF sub-trees
> > > look different. Add a second compare function to be used when encoders
> > > are added to the component framework and patch the existing users of
> > > the function accordingly.
> > > 
> > > Signed-off-by: Liviu Dudau 
> > 
> > Russell,
> > 
> > Resurecting this old patch from around Christmas time (bad time for patch
> > review).
> > 
> > Are you happy enough with this version to re-issue the Ack or do you think
> > I still need to work on it?
> 
> What I'd like to see is the patch reworked, because:
> 
> > > + component_match_add(dev, &match, compare_port, port);
> > > + /*
> > > +  * component_match_add keeps a reference to the port
> > > +  * variable, so we need to keep the reference count
> > > +  * increment from of_parse_phandle()
> > > +  */
> ...
> > > + component_match_add(dev, &match, compare_encoder, 
> > > remote);
> > > + /*
> > > +  * component_match_add keeps a reference to the port
> > > +  * variable, so we need to keep the reference count
> > > +  * increment from of_graph_get_remote_port_parent()
> > > +  */
> 
> This problem no longer exists.

Fair enough, I will send a v3 version.

Thanks,
Liviu

> 
> -- 
> RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
> FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
> according to speedtest.net.
> 

-- 

| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---
¯\_(ツ)_/¯


[PATCH v2 1/2] drm: Improve drm_of_component_probe() to correctly handle ports and remote ports.

2016-02-22 Thread Russell King - ARM Linux
On Mon, Feb 22, 2016 at 11:51:47AM +, Liviu Dudau wrote:
> On Fri, Nov 20, 2015 at 02:22:04PM +, Liviu Dudau wrote:
> > Rockchip DRM driver cannot use the same compare_of() function to
> > match ports and remote ports (aka encoders) as their OF sub-trees
> > look different. Add a second compare function to be used when encoders
> > are added to the component framework and patch the existing users of
> > the function accordingly.
> > 
> > Signed-off-by: Liviu Dudau 
> 
> Russell,
> 
> Resurecting this old patch from around Christmas time (bad time for patch
> review).
> 
> Are you happy enough with this version to re-issue the Ack or do you think
> I still need to work on it?

What I'd like to see is the patch reworked, because:

> > +   component_match_add(dev, &match, compare_port, port);
> > +   /*
> > +* component_match_add keeps a reference to the port
> > +* variable, so we need to keep the reference count
> > +* increment from of_parse_phandle()
> > +*/
...
> > +   component_match_add(dev, &match, compare_encoder, 
> > remote);
> > +   /*
> > +* component_match_add keeps a reference to the port
> > +* variable, so we need to keep the reference count
> > +* increment from of_graph_get_remote_port_parent()
> > +*/

This problem no longer exists.

-- 
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.


[PATCH 2/4] Add adreno430 power control

2016-02-22 Thread Emil Velikov
On 22 February 2016 at 14:51, Rob Clark  wrote:
> On Mon, Feb 22, 2016 at 8:46 AM, Emil Velikov  
> wrote:
>> On 19 February 2016 at 00:50, C Stout  wrote:
>>> Change-Id: Ife53627e9985e1204cc319da0221338e5272eb81
>>> ---
>>>  drivers/gpu/drm/msm/adreno/a4xx_gpu.c | 39 
>>> +--
>>>  1 file changed, 37 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/msm/adreno/a4xx_gpu.c 
>>> b/drivers/gpu/drm/msm/adreno/a4xx_gpu.c
>>> index 9a1ffec..9aab904 100644
>>> --- a/drivers/gpu/drm/msm/adreno/a4xx_gpu.c
>>> +++ b/drivers/gpu/drm/msm/adreno/a4xx_gpu.c
>>> @@ -552,12 +552,47 @@ static void a4xx_dump(struct msm_gpu *gpu)
>>> adreno_dump(gpu);
>>>  }
>>>
>>> +static int a4xx_pm_resume(struct msm_gpu *gpu) {
>>> +   struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
>>> +   int ret;
>>> +
>>> +   ret = msm_gpu_pm_resume(gpu);
>>> +   if (ret)
>>> +   return ret;
>>> +
>>> +   if (adreno_is_a430(adreno_gpu)) {
>>> +   unsigned int reg;
>>> +   /* Set the default register values; set SW_COLLAPSE to 0 */
>>> +   gpu_write(gpu, REG_A4XX_RBBM_POWER_CNTL_IP, 0x778000);
>>> +   do {
>>> +   udelay(5);
>>> +   reg = gpu_read(gpu, REG_A4XX_RBBM_POWER_STATUS);
>>> +   } while (!(reg & SP_TP_PWR_ON));
>>> +   }
>> Imho wrapping things the opposite way -> include the 430 specifics in
>> msm_gpu_pm_resume/suspend. If needed.
>
> fyi, the reason for the three level "class" hierarchy
> (msm_gpu/adreno/aXYZ) was originally so that we could perhaps some day
> add support for the 2d cores present on some older snapdragons (back
> in the a2xx days).  Not sure if we'll ever do this (upstream kernel
> support on those older gen's isn't so much there).  But at least right
> now putting that in msm_gpu_pm_resume() isn't really the right thing.
>
Nice one.

>> Hmm is it me or the above register definitions are missing in
>> linux/master and linux/next ? What did you use as a base for the
>> series ?
>
> They are in msm-next:
>
> https://cgit.freedesktop.org/~robclark/linux/log/?h=msm-next
>
> (basically for register definitions, they just need to end up in the
> envytools register database, and then I just regenerate the headers to
> pull in the latest..  that is easier than dealing with merge conflicts
> if everyone just adds the needed regs as part of their patch)
>
For some strange reason git grep did not list them even though
msm-next is part of linux/next.

Thanks for setting me straight Rob, apologies for the noise.

Regards,
Emil


[PATCH RFC v5 2/8] ASoC: hdmi-codec: Add hdmi-codec for external HDMI-encoders

2016-02-22 Thread Arnaud Pouliquen
Hello Jyri,

Integrated and tested on sti platform with success.

I will re-submit patch-set associated to sti platform, when (if) patches
accepted.

Regards
Arnaud

On 02/17/2016 03:49 PM, Jyri Sarha wrote:
> The hdmi-codec is a platform device driver to be registered from
> drivers of external HDMI encoders with I2S and/or spdif interface. The
> driver in turn registers an ASoC codec for the HDMI encoder's audio
> functionality.
> 
> The structures and definitions in the API header are mostly redundant
> copies of similar structures in ASoC headers. This is on purpose to
> avoid direct dependencies to ASoC structures in video side driver.
> 
> Signed-off-by: Jyri Sarha 
> ---
>  include/sound/hdmi-codec.h| 100 +++
>  sound/soc/codecs/Kconfig  |   6 +
>  sound/soc/codecs/Makefile |   2 +
>  sound/soc/codecs/hdmi-codec.c | 393 
> ++
>  4 files changed, 501 insertions(+)
>  create mode 100644 include/sound/hdmi-codec.h
>  create mode 100644 sound/soc/codecs/hdmi-codec.c
> 
> diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h
> new file mode 100644
> index 000..fc3a481
> --- /dev/null
> +++ b/include/sound/hdmi-codec.h
> @@ -0,0 +1,100 @@
> +/*
> + * hdmi-codec.h - HDMI Codec driver API
> + *
> + * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com
> + *
> + * Author: Jyri Sarha 
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * version 2 as published by the Free Software Foundation.
> + *
> + * 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.
> + */
> +
> +#ifndef __HDMI_CODEC_H__
> +#define __HDMI_CODEC_H__
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/*
> + * Protocol between ASoC cpu-dai and HDMI-encoder
> + */
> +struct hdmi_codec_daifmt {
> + enum {
> + HDMI_I2S,
> + HDMI_RIGHT_J,
> + HDMI_LEFT_J,
> + HDMI_DSP_A,
> + HDMI_DSP_B,
> + HDMI_AC97,
> + HDMI_SPDIF,
> + } fmt;
> + int bit_clk_inv:1;
> + int frame_clk_inv:1;
> + int bit_clk_master:1;
> + int frame_clk_master:1;
> +};
> +
> +/*
> + * HDMI audio parameters
> + */
> +struct hdmi_codec_params {
> + struct hdmi_audio_infoframe cea;
> + struct snd_aes_iec958 iec;
> + int sample_rate;
> + int sample_width;
> + int channels;
> +};
> +
> +struct hdmi_codec_ops {
> + /*
> +  * Called when ASoC starts an audio stream setup.
> +  * Optional
> +  */
> + int (*audio_startup)(struct device *dev);
> +
> + /*
> +  * Configures HDMI-encoder for audio stream.
> +  * Mandatory
> +  */
> + int (*hw_params)(struct device *dev,
> +  struct hdmi_codec_daifmt *fmt,
> +  struct hdmi_codec_params *hparms);
> +
> + /*
> +  * Shuts down the audio stream.
> +  * Mandatory
> +  */
> + void (*audio_shutdown)(struct device *dev);
> +
> + /*
> +  * Mute/unmute HDMI audio stream.
> +  * Optional
> +  */
> + int (*digital_mute)(struct device *dev, bool enable);
> +
> + /*
> +  * Provides EDID-Like-Data from connected HDMI device.
> +  * Optional
> +  */
> + int (*get_eld)(struct device *dev, uint8_t *buf, size_t len);
> +};
> +
> +/* HDMI codec initalization data */
> +struct hdmi_codec_pdata {
> + const struct hdmi_codec_ops *ops;
> + uint i2s:1;
> + uint spdif:1;
> + int max_i2s_channels;
> +};
> +
> +#define HDMI_CODEC_DRV_NAME "hdmi-audio-codec"
> +
> +#endif /* __HDMI_CODEC_H__ */
> diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
> index cfdafc4..4d5915e 100644
> --- a/sound/soc/codecs/Kconfig
> +++ b/sound/soc/codecs/Kconfig
> @@ -82,6 +82,7 @@ config SND_SOC_ALL_CODECS
>   select SND_SOC_MC13783 if MFD_MC13XXX
>   select SND_SOC_ML26124 if I2C
>   select SND_SOC_NAU8825 if I2C
> + select SND_SOC_HDMI_CODEC
>   select SND_SOC_PCM1681 if I2C
>   select SND_SOC_PCM1792A if SPI_MASTER
>   select SND_SOC_PCM3008
> @@ -454,6 +455,11 @@ config SND_SOC_BT_SCO
>  config SND_SOC_DMIC
>   tristate
>  
> +config SND_SOC_HDMI_CODEC
> +   tristate
> +   select SND_PCM_ELD
> +   select SND_PCM_IEC958
> +
>  config SND_SOC_ES8328
>   tristate "Everest Semi ES8328 CODEC"
>  
> diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
> index f632fc4..49c1824 100644
> --- a/sound/soc/codecs/Makefile
> +++ b/sound/soc/codecs/Makefile
> @@ -75,6 +75,7 @@ snd-soc-max9850-objs := max9850.o
>  snd-soc-mc13783-objs := mc13783.o
>  snd-soc-ml26124-objs := ml26124.o
>  snd-soc-nau8825-objs := nau8825.o
> +snd-soc-hdmi-codec-objs := hdmi

[PATCH v2 00/21] drm/ticdc: Accumulated fixes over the past couple of years

2016-02-22 Thread Tomi Valkeinen

On 16/02/16 16:18, Jyri Sarha wrote:
> Changes since the first version of the series:
> - Dropped: "drm/tilcdc: disable console switching during pm operations"
> - Changed: "drm/tilcdc: Allocate register storage based on the actual 
> number.."
>   - Reversed kcalloc() nmemb and size parameters to correct order
> - Addeed: "drm/tilcdc: Initialize crtc->port"
> 
> We have not been too active in pushing the tilcdc fixes to
> mainline. This series tries to bring the mainline tilcdc upto same
> level with TI ti-linux tree.
> 
> Some patches that touch the same place over and over again have been
> squashed into one, leaving author of the last rewrite on top.

Aside the few minor comments I had, looks good to me.

Acked-by: Tomi Valkeinen 

 Tomi

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/2746f057/attachment.sig>


[PATCH v2 09/21] drm/tilcdc: Allocate register storage based on the actual number registers

2016-02-22 Thread Tomi Valkeinen


On 16/02/16 16:18, Jyri Sarha wrote:
> Allocate suspend/resume register storage based on the actual number
> registers the driver is aware of. The static allocation for register
> storage had falen behind badly.

"fallen"

> 
> Reported-by: Michael Bode 
> Signed-off-by: Jyri Sarha 
> ---
>  drivers/gpu/drm/tilcdc/tilcdc_drv.c | 21 -
>  drivers/gpu/drm/tilcdc/tilcdc_drv.h |  2 +-
>  2 files changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
> b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> index 893ef18..ab1789b 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> @@ -141,11 +141,14 @@ static int tilcdc_unload(struct drm_device *dev)
>  
>   pm_runtime_disable(dev->dev);
>  
> + kfree(priv->saved_register);
>   kfree(priv);
>  
>   return 0;
>  }
>  
> +static size_t tilcdc_num_regs(void);
> +
>  static int tilcdc_load(struct drm_device *dev, unsigned long flags)
>  {
>   struct platform_device *pdev = dev->platformdev;
> @@ -157,7 +160,12 @@ static int tilcdc_load(struct drm_device *dev, unsigned 
> long flags)
>   int ret;
>  
>   priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> - if (!priv) {
> + if (priv)
> + priv->saved_register = kcalloc(tilcdc_num_regs(),
> +sizeof(*priv->saved_register),
> +GFP_KERNEL);

devm_kzalloc() would clean this up a bit. For both 'priv' and
'saved_registers'.

 Tomi

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/03bc1f59/attachment-0001.sig>


[PATCH v2 21/21] drm/tilcdc: Initialize crtc->port

2016-02-22 Thread Tomi Valkeinen


On 16/02/16 16:18, Jyri Sarha wrote:
> Initialize port device node pointer in the tilcdc crtc. Fixes "Falling
> back to first CRTC" warning from tda998x driver.

The description is rather short, and doesn't really explain what was
wrong and why this fixes it.

> Signed-off-by: Jyri Sarha 
> ---
>  drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 11 +++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c 
> b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> index e886277..cfd3fd1 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> @@ -124,6 +124,7 @@ static void tilcdc_crtc_destroy(struct drm_crtc *crtc)
>  
>   tilcdc_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
>  
> + of_node_put(crtc->port);
>   drm_crtc_cleanup(crtc);
>   drm_flip_work_cleanup(&tilcdc_crtc->unref_work);
>  
> @@ -768,6 +769,7 @@ void tilcdc_crtc_cancel_page_flip(struct drm_crtc *crtc, 
> struct drm_file *file)
>  
>  struct drm_crtc *tilcdc_crtc_create(struct drm_device *dev)
>  {
> + struct tilcdc_drm_private *priv = dev->dev_private;
>   struct tilcdc_crtc *tilcdc_crtc;
>   struct drm_crtc *crtc;
>   int ret;
> @@ -794,6 +796,15 @@ struct drm_crtc *tilcdc_crtc_create(struct drm_device 
> *dev)
>  
>   drm_crtc_helper_add(crtc, &tilcdc_crtc_helper_funcs);
>  
> + if (priv->is_componentized) {
> + crtc->port =
> + of_get_child_by_name(dev->dev->of_node, "port");
> + if (!crtc->port) {
> + dev_warn(dev->dev, "no port node found in %s\n",
> +  dev->dev->of_node->full_name);

Isn't this an error? Can the driver proceed if there's no port node?

 Tomi

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/051d0fe4/attachment.sig>


[Bug 94231] Problems compiling libdrm since glibc 2.23

2016-02-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=94231

--- Comment #11 from Emil Velikov  ---
Thanks for the links Mike.

Not sure about others, but I'm not a happy bunny.

So there's a issue/bug in stdlib.h (or was it g++), that leads to the inclusion
of sys/types.h. To 'fix' this lets break the documented behaviour (for those of
us that read the manpages). Hmm ... wait what ?

Sorry but this sounds backwards. If we cannot squash the issue, it should be
documented properly with list of workarounds (as pointed in the redhat
bugzilla).
Yes it sucks, big time. Yet we shouldn't break one thing, in order to
workaround another issue, should we ?

If this workaround is needed/applicable with other libc providers like musl (on
Linux at least), then there should be a documentation update alongside the
deprecation. Followed by a lengthy period _before_ removing things ?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/858f87cb/attachment.html>


[PATCH] dma-buf/fence: fix fence_is_later v2

2016-02-22 Thread Alex Deucher
From: Christian König 

A fence is never later than itself. This caused a bunch of overhead for AMDGPU.

v2: simplify check as suggested by Michel.

Signed-off-by: Christian König 
Reviewed-by: Michel Dänzer 
Reviewed-by: Alex Deucher 
Signed-off-by: Alex Deucher 
---
 include/linux/fence.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/fence.h b/include/linux/fence.h
index bb52201..5aa95eb 100644
--- a/include/linux/fence.h
+++ b/include/linux/fence.h
@@ -292,7 +292,7 @@ static inline bool fence_is_later(struct fence *f1, struct 
fence *f2)
if (WARN_ON(f1->context != f2->context))
return false;

-   return f1->seqno - f2->seqno < INT_MAX;
+   return (int)(f1->seqno - f2->seqno) > 0;
 }

 /**
-- 
2.5.0



[REGRESSION] i915: No HDMI output with 4.4

2016-02-22 Thread Oleksandr Natalenko
Ville, Daniel,

any additional info I could provide? I have to return dual-link DVI 
cable back, so let me know if I could reveal more details if necessary.

Regards,
   Oleksandr

16.02.2016 14:54, Daniel Vetter написав:
> On Tue, Feb 16, 2016 at 12:58:56PM +0200, Oleksandr Natalenko wrote:
>> Ville, Daniel,
>> 
>> I've just got another monitor and another DVI-HDMI cable, and here 
>> what I've
>> got.
>> 
>> ===Single Link DVI-D cable with 3 different monitors===
>> 
>> Computer DVI ——— DVI-D (Single Link)/HDMI cable ——— HDMI LG 
>> 23MP65HQ-P 
>> ===
>> not working
> 
> I presume the above LG screen is what you've called previously "old
> monitor"?
> 
>> Computer DVI ——— DVI-D (Single Link)/HDMI cable ——— HDMI LG 
>> 23MP67HQ-P 
>> ===
>> not working
>> Computer DVI ——— DVI-D (Single Link)/HDMI cable ——— HDMI LG 
>> 23MP55HQ-P 
>> ===
>> works!
>> 
>> ===Dual Link DVI-D cable with monitor that doesn't work with Single 
>> Link
>> cable===
>> 
>> Computer DVI ——— DVI-D (Dual Link)/HDMI cable ——— HDMI LG 
>> 23MP65HQ-P 
>> ===
>> works!
> 
> Funky. Can you pls grab the debug logs (with the special patches from
> Ville) for this case? I wonder why suddenly different cable and it 
> works.
> 
> Also: Is this one of these older-ish screens where you must have a
> dual-link cable to drive it at full resolution&refresh rate?
> -Daniel
> 
> 
>> ===Laptop with HDMI output===
>> 
>> Laptop HDMI ——— HDMI/HDMI cable ——— HDMI LG 23MP65HQ-P === works!
>> 
>> I'd say that single link DVI cables are broken with new kernel, but 
>> one of
>> monitors could work with such a cable. So I have no idea :(.
>> 
>> Regards,
>>   Oleksandr.
>> 
>> 15.02.2016 17:42, Daniel Vetter wrote:
>> >The other downside is that it'll make us non-compliant, which was the
>> >point of this entire ordeal: HDMI spec forbids us from starting any i2c
>> >transactions when the hpd isn't signalling a present screen.
>> >
>> >So maybe we need to buy one of these broken screens.
>> >
>> >Oleksandr, what exact model are you using? And any chance that you could
>> >test this on some other machine with intel gfx and latest kernel, just to
>> >make sure this really is some issue with the sink and not with the machine
>> >itself? And I guess you've tested with some other hdmi sink, and that
>> >works?


[PATCH] drm/i915: Change WARN_ON(!wm_changed) to I915_STATE_WARN_ON()

2016-02-22 Thread Lyude
These warnings still seem to be present with DP MST configurations. They
don't actually indicate any impending doom, so we may as well use
I915_STATE_WARN_ON() here to help quiet things down a little bit for
distro kernel users.

Signed-off-by: Lyude 
---
 drivers/gpu/drm/i915/intel_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index a234687..1870185 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3545,7 +3545,7 @@ static void skl_update_other_pipe_wm(struct drm_device 
*dev,
 * because it was really needed, so we expect the WM values to
 * be different.
 */
-   WARN_ON(!wm_changed);
+   I915_STATE_WARN_ON(!wm_changed);

skl_compute_wm_results(dev, &pipe_wm, r, intel_crtc);
r->dirty[intel_crtc->pipe] = true;
-- 
2.5.0



[PATCH 5/5] drm/i915: Implement color management on chv

2016-02-22 Thread Lionel Landwerlin
Patch based on a previous series by Shashank Sharma.

v2: Update contributors

v3: Refactor degamma/gamma LUTs load into a single function

v4: Remove unused variable

Signed-off-by: Shashank Sharma 
Signed-off-by: Lionel Landwerlin 
Signed-off-by: Kumar, Kiran S 
Signed-off-by: Kausal Malladi 
---
 drivers/gpu/drm/i915/i915_drv.c|   3 +
 drivers/gpu/drm/i915/i915_reg.h|  31 +
 drivers/gpu/drm/i915/intel_color.c | 133 +++--
 3 files changed, 161 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 3807b73..8a2aaa7 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -68,6 +68,8 @@ static struct drm_driver driver;

 #define BDW_COLORS \
.color = { .degamma_lut_size = 512, .gamma_lut_size = 512 }
+#define CHV_COLORS \
+   .color = { .degamma_lut_size = 65, .gamma_lut_size = 257 }

 static const struct intel_device_info intel_i830_info = {
.gen = 2, .is_mobile = 1, .cursor_needs_physical = 1, .num_pipes = 2,
@@ -325,6 +327,7 @@ static const struct intel_device_info intel_cherryview_info 
= {
.display_mmio_offset = VLV_DISPLAY_BASE,
GEN_CHV_PIPEOFFSETS,
CURSOR_OFFSETS,
+   CHV_COLORS,
 };

 static const struct intel_device_info intel_skylake_info = {
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 8ce76d7..effd79e 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -7672,6 +7672,37 @@ enum skl_disp_power_wells {
 #define PREC_PAL_GC_MAX(pipe, i)   _MMIO(_PIPE(pipe, _PAL_PREC_GC_MAX_A, 
_PAL_PREC_GC_MAX_B) + (i) * 4)
 #define PREC_PAL_EXT_GC_MAX(pipe, i)   _MMIO(_PIPE(pipe, 
_PAL_PREC_EXT_GC_MAX_A, _PAL_PREC_EXT_GC_MAX_B) + (i) * 4)

+/* pipe CSC & degamma/gamma LUTs on CHV */
+#define _CGM_PIPE_A_CSC_COEFF01(VLV_DISPLAY_BASE + 0x67900)
+#define _CGM_PIPE_A_CSC_COEFF23(VLV_DISPLAY_BASE + 0x67904)
+#define _CGM_PIPE_A_CSC_COEFF45(VLV_DISPLAY_BASE + 0x67908)
+#define _CGM_PIPE_A_CSC_COEFF67(VLV_DISPLAY_BASE + 0x6790C)
+#define _CGM_PIPE_A_CSC_COEFF8 (VLV_DISPLAY_BASE + 0x67910)
+#define _CGM_PIPE_A_DEGAMMA(VLV_DISPLAY_BASE + 0x66000)
+#define _CGM_PIPE_A_GAMMA  (VLV_DISPLAY_BASE + 0x67000)
+#define _CGM_PIPE_A_MODE   (VLV_DISPLAY_BASE + 0x67A00)
+#define   CGM_PIPE_MODE_GAMMA  (1 << 2)
+#define   CGM_PIPE_MODE_CSC(1 << 1)
+#define   CGM_PIPE_MODE_DEGAMMA(1 << 0)
+
+#define _CGM_PIPE_B_CSC_COEFF01(VLV_DISPLAY_BASE + 0x69900)
+#define _CGM_PIPE_B_CSC_COEFF23(VLV_DISPLAY_BASE + 0x69904)
+#define _CGM_PIPE_B_CSC_COEFF45(VLV_DISPLAY_BASE + 0x69908)
+#define _CGM_PIPE_B_CSC_COEFF67(VLV_DISPLAY_BASE + 0x6990C)
+#define _CGM_PIPE_B_CSC_COEFF8 (VLV_DISPLAY_BASE + 0x69910)
+#define _CGM_PIPE_B_DEGAMMA(VLV_DISPLAY_BASE + 0x68000)
+#define _CGM_PIPE_B_GAMMA  (VLV_DISPLAY_BASE + 0x69000)
+#define _CGM_PIPE_B_MODE   (VLV_DISPLAY_BASE + 0x69A00)
+
+#define CGM_PIPE_CSC_COEFF01(pipe) _MMIO_PIPE(pipe, 
_CGM_PIPE_A_CSC_COEFF01, _CGM_PIPE_B_CSC_COEFF01)
+#define CGM_PIPE_CSC_COEFF23(pipe) _MMIO_PIPE(pipe, 
_CGM_PIPE_A_CSC_COEFF23, _CGM_PIPE_B_CSC_COEFF23)
+#define CGM_PIPE_CSC_COEFF45(pipe) _MMIO_PIPE(pipe, 
_CGM_PIPE_A_CSC_COEFF45, _CGM_PIPE_B_CSC_COEFF45)
+#define CGM_PIPE_CSC_COEFF67(pipe) _MMIO_PIPE(pipe, 
_CGM_PIPE_A_CSC_COEFF67, _CGM_PIPE_B_CSC_COEFF67)
+#define CGM_PIPE_CSC_COEFF8(pipe)  _MMIO_PIPE(pipe, 
_CGM_PIPE_A_CSC_COEFF8, _CGM_PIPE_B_CSC_COEFF8)
+#define CGM_PIPE_DEGAMMA(pipe, i, w)   _MMIO(_PIPE(pipe, _CGM_PIPE_A_DEGAMMA, 
_CGM_PIPE_B_DEGAMMA) + (i) * 8 + (w) * 4)
+#define CGM_PIPE_GAMMA(pipe, i, w) _MMIO(_PIPE(pipe, _CGM_PIPE_A_GAMMA, 
_CGM_PIPE_B_GAMMA) + (i) * 8 + (w) * 4)
+#define CGM_PIPE_MODE(pipe)_MMIO_PIPE(pipe, _CGM_PIPE_A_MODE, 
_CGM_PIPE_B_MODE)
+
 /* MIPI DSI registers */

 #define _MIPI_PORT(port, a, c) _PORT3(port, a, 0, c)   /* ports A and C only */
diff --git a/drivers/gpu/drm/i915/intel_color.c 
b/drivers/gpu/drm/i915/intel_color.c
index a6c7d22..b8b4a9b 100644
--- a/drivers/gpu/drm/i915/intel_color.c
+++ b/drivers/gpu/drm/i915/intel_color.c
@@ -29,6 +29,7 @@
 #define CTM_COEFF_1_0  (1ULL << 32)
 #define CTM_COEFF_2_0  (CTM_COEFF_1_0 << 1)
 #define CTM_COEFF_4_0  (CTM_COEFF_2_0 << 1)
+#define CTM_COEFF_8_0  (CTM_COEFF_4_0 << 1)
 #define CTM_COEFF_0_5  (CTM_COEFF_1_0 >> 1)
 #define CTM_COEFF_0_25 (CTM_COEFF_0_5 >> 1)
 #define CTM_COEFF_0_125(CTM_COEFF_0_25 >> 1)
@@ -216,6 +217,58 @@ static void i9xx_load_csc_matrix(struct drm_crtc *crtc)
}
 }

+/*
+ * Set up the pipe CSC unit on CherryView.
+ */
+static void cherryview_load_csc_matrix(struct drm_crtc *crtc)
+{
+   struct drm_device *dev = crtc->dev;
+   struct drm_crtc_state *state = crtc->state;
+   struct drm_i915_private *dev_priv = dev->dev_private;
+   int pipe = to_intel_crtc(crtc)->pipe;
+   uint32_t mode;
+
+

[PATCH 4/5] drm/i915: Implement color management on bdw/skl/bxt/kbl

2016-02-22 Thread Lionel Landwerlin
Patch based on a previous series by Shashank Sharma.

v2: Do not read GAMMA_MODE register to figure what mode we're in

v3: Program PREC_PAL_GC_MAX to clamp pixel values > 1.0

Add documentation on how the Broadcast RGB property is affected by CTM

v4: Update contributors

v5: Refactor degamma/gamma LUTs load into a single function

v6: Fix missing intel_crtc variable (bisect issue)

Signed-off-by: Shashank Sharma 
Signed-off-by: Lionel Landwerlin 
Signed-off-by: Kumar, Kiran S 
Signed-off-by: Kausal Malladi 
---
 Documentation/DocBook/gpu.tmpl   |   6 +-
 drivers/gpu/drm/i915/i915_drv.c  |  24 ++-
 drivers/gpu/drm/i915/i915_drv.h  |   6 +
 drivers/gpu/drm/i915/i915_reg.h  |  22 +++
 drivers/gpu/drm/i915/intel_color.c   | 356 ++-
 drivers/gpu/drm/i915/intel_display.c |  22 ++-
 drivers/gpu/drm/i915/intel_drv.h |   3 +-
 drivers/gpu/drm/i915/intel_fbdev.c   |   8 +
 8 files changed, 383 insertions(+), 64 deletions(-)

diff --git a/Documentation/DocBook/gpu.tmpl b/Documentation/DocBook/gpu.tmpl
index 1692c4d..430e99b 100644
--- a/Documentation/DocBook/gpu.tmpl
+++ b/Documentation/DocBook/gpu.tmpl
@@ -2153,7 +2153,11 @@ void intel_crt_init(struct drm_device *dev)
ENUM
{ "Automatic", "Full", "Limited 16:235" }
Connector
-   TBD
+   When this property is set to Limited 16:235
+   and CTM is set, the hardware will be programmed with the
+   result of the multiplication of CTM by the limited range
+   matrix to ensure the pixels normaly in the range 0..1.0 are
+   remapped to the range 16/255..235/255.


“audio”
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 20e8200..3807b73 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -66,6 +66,9 @@ static struct drm_driver driver;
 #define IVB_CURSOR_OFFSETS \
.cursor_offsets = { CURSOR_A_OFFSET, IVB_CURSOR_B_OFFSET, 
IVB_CURSOR_C_OFFSET }

+#define BDW_COLORS \
+   .color = { .degamma_lut_size = 512, .gamma_lut_size = 512 }
+
 static const struct intel_device_info intel_i830_info = {
.gen = 2, .is_mobile = 1, .cursor_needs_physical = 1, .num_pipes = 2,
.has_overlay = 1, .overlay_needs_physical = 1,
@@ -288,24 +291,28 @@ static const struct intel_device_info 
intel_haswell_m_info = {
.is_mobile = 1,
 };

+#define BDW_FEATURES \
+   HSW_FEATURES, \
+   BDW_COLORS
+
 static const struct intel_device_info intel_broadwell_d_info = {
-   HSW_FEATURES,
+   BDW_FEATURES,
.gen = 8,
 };

 static const struct intel_device_info intel_broadwell_m_info = {
-   HSW_FEATURES,
+   BDW_FEATURES,
.gen = 8, .is_mobile = 1,
 };

 static const struct intel_device_info intel_broadwell_gt3d_info = {
-   HSW_FEATURES,
+   BDW_FEATURES,
.gen = 8,
.ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
 };

 static const struct intel_device_info intel_broadwell_gt3m_info = {
-   HSW_FEATURES,
+   BDW_FEATURES,
.gen = 8, .is_mobile = 1,
.ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
 };
@@ -321,13 +328,13 @@ static const struct intel_device_info 
intel_cherryview_info = {
 };

 static const struct intel_device_info intel_skylake_info = {
-   HSW_FEATURES,
+   BDW_FEATURES,
.is_skylake = 1,
.gen = 9,
 };

 static const struct intel_device_info intel_skylake_gt3_info = {
-   HSW_FEATURES,
+   BDW_FEATURES,
.is_skylake = 1,
.gen = 9,
.ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
@@ -345,17 +352,18 @@ static const struct intel_device_info intel_broxton_info 
= {
.has_fbc = 1,
GEN_DEFAULT_PIPEOFFSETS,
IVB_CURSOR_OFFSETS,
+   BDW_COLORS,
 };

 static const struct intel_device_info intel_kabylake_info = {
-   HSW_FEATURES,
+   BDW_FEATURES,
.is_preliminary = 1,
.is_kabylake = 1,
.gen = 9,
 };

 static const struct intel_device_info intel_kabylake_gt3_info = {
-   HSW_FEATURES,
+   BDW_FEATURES,
.is_preliminary = 1,
.is_kabylake = 1,
.gen = 9,
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 6634c09..7627a4e 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -660,6 +660,7 @@ struct drm_i915_display_funcs {
/* display clock increase/decrease */
/* pll clock increase/decrease */

+   void (*load_csc_matrix)(struct drm_crtc *crtc);
void (*load_luts)(struct drm_crtc *crtc);
 };

@@ -808,6 +809,11 @@ struct intel_device_info {
u8 has_slice_pg:1;
u8 has_subslice_pg:1;
u8 has_eu_pg:1;
+
+   struct color_luts {
+   u16 degamma_lut_size;
+   u16 gamma_lut_size;
+   } color;
 };

 #undef DEFINE_F

[PATCH 3/5] drm: introduce pipe color correction properties

2016-02-22 Thread Lionel Landwerlin
Patch based on a previous series by Shashank Sharma.

This introduces optional properties to enable color correction at the
pipe level. It relies on 3 transformations applied to every pixels
displayed. First a lookup into a degamma table, then a multiplication
of the rgb components by a 3x3 matrix and finally another lookup into
a gamma table.

The following properties can be added to a pipe :
  - DEGAMMA_LUT : blob containing degamma LUT
  - DEGAMMA_LUT_SIZE : number of elements in DEGAMMA_LUT
  - CTM : transformation matrix applied after the degamma LUT
  - GAMMA_LUT : blob containing gamma LUT
  - GAMMA_LUT_SIZE : number of elements in GAMMA_LUT

DEGAMMA_LUT_SIZE and GAMMA_LUT_SIZE are read only properties, set by
the driver to tell userspace applications what sizes should be the
lookup tables in DEGAMMA_LUT and GAMMA_LUT.

A helper is also provided so legacy gamma correction is redirected
through these new properties.

v2: Register LUT size properties as range

v3: Fix round in drm_color_lut_get_value() helper
More docs on how degamma/gamma properties are used

v4: Update contributors

v5: Rename CTM_MATRIX property to CTM (Doh!)
Add legacy gamma_set atomic helper
Describe CTM/LUT acronyms in the kernel doc

Signed-off-by: Shashank Sharma 
Signed-off-by: Lionel Landwerlin 
Signed-off-by: Kumar, Kiran S 
Signed-off-by: Kausal Malladi 
Reviewed-by: Matt Roper 
---
 Documentation/DocBook/gpu.tmpl  |  59 -
 drivers/gpu/drm/drm_atomic.c|  86 +-
 drivers/gpu/drm/drm_atomic_helper.c | 103 
 drivers/gpu/drm/drm_crtc.c  |  35 
 drivers/gpu/drm/drm_crtc_helper.c   |  33 
 include/drm/drm_atomic_helper.h |   3 ++
 include/drm/drm_crtc.h  |  46 +++-
 include/drm/drm_crtc_helper.h   |   3 ++
 include/uapi/drm/drm_mode.h |  15 ++
 9 files changed, 378 insertions(+), 5 deletions(-)

diff --git a/Documentation/DocBook/gpu.tmpl b/Documentation/DocBook/gpu.tmpl
index fe6b36a..1692c4d 100644
--- a/Documentation/DocBook/gpu.tmpl
+++ b/Documentation/DocBook/gpu.tmpl
@@ -1816,7 +1816,7 @@ void intel_crt_init(struct drm_device *dev)
Description/Restrictions


-   DRM
+   DRM
Generic
“rotation”
BITMASK
@@ -2068,7 +2068,7 @@ void intel_crt_init(struct drm_device *dev)
property to suggest an Y offset for a connector


-   Optional
+   Optional
“scaling mode”
ENUM
{ "None", "Full", "Center", "Full aspect" }
@@ -2092,6 +2092,61 @@ void intel_crt_init(struct drm_device *dev)
TBD


+   “DEGAMMA_LUT”
+   BLOB
+   0
+   CRTC
+   DRM property to set the degamma lookup table
+   (LUT) mapping pixel data from the framebuffer before it is
+   given to the transformation matrix. The data is an interpreted
+   as an array of struct drm_color_lut elements. Hardware might
+   choose not to use the full precision of the LUT elements nor
+   use all the elements of the LUT (for example the hardware
+   might choose to interpolate between LUT[0] and LUT[4]). 
+   
+   
+   “DEGAMMA_LUT_SIZE”
+   RANGE | IMMUTABLE
+   Min=0, Max=UINT_MAX
+   CRTC
+   DRM property to gives the size of the lookup
+   table to be set on the DEGAMMA_LUT property (the size depends
+   on the underlying hardware).
+   
+   
+   “CTM”
+   BLOB
+   0
+   CRTC
+   DRM property to set the current
+   transformation matrix (CTM) apply to pixel data after the
+   lookup through the degamma LUT and before the lookup through
+   the gamma LUT. The data is an interpreted as a struct
+   drm_color_ctm.
+   
+   
+   “GAMMA_LUT”
+   BLOB
+   0
+   CRTC
+   DRM property to set the gamma lookup table
+   (LUT) mapping pixel data after to the transformation matrix to
+   data sent to the connector. The data is an interpreted as an
+   array of struct drm_color_lut elements. Hardware might choose
+   not to use the full precision of the LUT elements nor use all
+   the elements of the LUT (for example the hardware might choose
+   to interpolate between LUT[0] and LUT[4]).
+   
+   
+   “GAMMA_LUT_SIZE”
+   RANGE | IMMUTABLE
+   Min=0, Max=UINT_MAX
+   CRTC
+   DRM property to gives the size of the lookup
+   table to be set on the GAMMA_LUT property (the size depends on
+   the underlying hardware).
+   
+   
i915
Generic
"Broadcast RGB"
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 092620c..b767a4f 100644
--- a

[PATCH 2/5] drm/i915: Do not read GAMMA_MODE register

2016-02-22 Thread Lionel Landwerlin
Implement Daniel Stone's recommendation to not read registers to infer
the hardware's state.

Signed-off-by: Lionel Landwerlin 
---
 drivers/gpu/drm/i915/intel_color.c | 7 +--
 drivers/gpu/drm/i915/intel_drv.h   | 3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_color.c 
b/drivers/gpu/drm/i915/intel_color.c
index cce0155..ba27ce2 100644
--- a/drivers/gpu/drm/i915/intel_color.c
+++ b/drivers/gpu/drm/i915/intel_color.c
@@ -126,6 +126,8 @@ static void haswell_load_luts(struct drm_crtc *crtc)
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+   struct intel_crtc_state *intel_crtc_state =
+   to_intel_crtc_state(crtc->state);
bool reenable_ips = false;

/*
@@ -133,11 +135,12 @@ static void haswell_load_luts(struct drm_crtc *crtc)
 * GAMMA_MODE is configured for split gamma and IPS_CTL has IPS enabled.
 */
if (IS_HASWELL(dev) && intel_crtc->config->ips_enabled &&
-   ((I915_READ(GAMMA_MODE(intel_crtc->pipe)) & GAMMA_MODE_MODE_MASK) ==
-GAMMA_MODE_MODE_SPLIT)) {
+   (intel_crtc_state->gamma_mode == GAMMA_MODE_MODE_SPLIT)) {
hsw_disable_ips(intel_crtc);
reenable_ips = true;
}
+
+   intel_crtc_state->gamma_mode = GAMMA_MODE_MODE_8BIT;
I915_WRITE(GAMMA_MODE(intel_crtc->pipe), GAMMA_MODE_MODE_8BIT);

i9xx_load_luts(crtc);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 40fc486..9742d5b 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -517,6 +517,9 @@ struct intel_crtc_state {
struct skl_pipe_wm skl;
} optimal;
} wm;
+
+   /* Gamma mode programmed on the pipe */
+   uint32_t gamma_mode;
 };

 struct vlv_wm_state {
-- 
2.7.0



[PATCH 1/5] drm/i915: Extract out gamma table and CSC to their own file

2016-02-22 Thread Lionel Landwerlin
The moves a couple of functions programming the gamma LUT and CSC
units into their own file.

On generations prior to Haswell there is only a gamma LUT. From
haswell on there is also a new enhanced color correction unit that
isn't used yet. This is why we need to set the GAMMA_MODE register,
either we're using the legacy 8bits LUT or enhanced LUTs (of 10 or
12bits).

The CSC unit is only available from Haswell on.

We also need to make a special case for CherryView which is recognized
as a gen 8 but doesn't have the same enhanced color correction unit
from Haswell on.

v2: Fix access to GAMMA_MODE register on older generations than
Haswell (from Matt Roper's comments)

Signed-off-by: Lionel Landwerlin 
---
 drivers/gpu/drm/i915/Makefile|   1 +
 drivers/gpu/drm/i915/i915_drv.h  |   2 +
 drivers/gpu/drm/i915/intel_color.c   | 195 +++
 drivers/gpu/drm/i915/intel_display.c | 163 +++--
 drivers/gpu/drm/i915/intel_drv.h |  10 ++
 5 files changed, 220 insertions(+), 151 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_color.c

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 0851de07..0516300 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -55,6 +55,7 @@ i915-y += intel_audio.o \
  intel_atomic.o \
  intel_atomic_plane.o \
  intel_bios.o \
+ intel_color.o \
  intel_display.o \
  intel_fbc.o \
  intel_fifo_underrun.o \
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 6644c2e..6634c09 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -659,6 +659,8 @@ struct drm_i915_display_funcs {
/* render clock increase/decrease */
/* display clock increase/decrease */
/* pll clock increase/decrease */
+
+   void (*load_luts)(struct drm_crtc *crtc);
 };

 enum forcewake_domain_id {
diff --git a/drivers/gpu/drm/i915/intel_color.c 
b/drivers/gpu/drm/i915/intel_color.c
new file mode 100644
index 000..cce0155
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_color.c
@@ -0,0 +1,195 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include "intel_drv.h"
+
+/*
+ * Set up the pipe CSC unit.
+ *
+ * Currently only full range RGB to limited range RGB conversion
+ * is supported, but eventually this should handle various
+ * RGB<->YCbCr scenarios as well.
+ */
+static void i9xx_load_csc_matrix(struct drm_crtc *crtc)
+{
+   struct drm_device *dev = crtc->dev;
+   struct drm_i915_private *dev_priv = dev->dev_private;
+   struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+   int pipe = intel_crtc->pipe;
+   uint16_t coeff = 0x7800; /* 1.0 */
+
+   /*
+* TODO: Check what kind of values actually come out of the pipe
+* with these coeff/postoff values and adjust to get the best
+* accuracy. Perhaps we even need to take the bpc value into
+* consideration.
+*/
+
+   if (intel_crtc->config->limited_color_range)
+   coeff = ((235 - 16) * (1 << 12) / 255) & 0xff8; /* 0.xxx... */
+
+   /*
+* GY/GU and RY/RU should be the other way around according
+* to BSpec, but reality doesn't agree. Just set them up in
+* a way that results in the correct picture.
+*/
+   I915_WRITE(PIPE_CSC_COEFF_RY_GY(pipe), coeff << 16);
+   I915_WRITE(PIPE_CSC_COEFF_BY(pipe), 0);
+
+   I915_WRITE(PIPE_CSC_COEFF_RU_GU(pipe), coeff);
+   I915_WRITE(PIPE_CSC_COEFF_BU(pipe), 0);
+
+   I915_WRITE(PIPE_CSC_COEFF_RV_GV(pipe), 0);
+   I915_WRITE(PIPE_CSC_COEFF_BV(pipe), coeff << 16);
+
+   I915_WRITE(PIPE_CSC_PREOFF_HI(pipe), 0);
+   I915_WRITE(PIPE_CSC_PREOFF_ME(pipe), 0);
+   I915_WRITE(PIPE_CSC_PREOFF_LO(pip

[PATCH 0/5] Pipe level color management V6

2016-02-22 Thread Lionel Landwerlin
This series introduces pipe level color management through a set of properties
attached to the CRTC. It also provides an implementation for some Intel
platforms.

This series is based of a previous set of patches by Shashank Sharma.

Cheers,

Lionel


Lionel Landwerlin (5):
  drm/i915: Extract out gamma table and CSC to their own file
  drm/i915: Do not read GAMMA_MODE register
  drm: introduce pipe color correction properties
  drm/i915: Implement color management on bdw/skl/bxt/kbl
  drm/i915: Implement color management on chv

 Documentation/DocBook/gpu.tmpl   |  65 +++-
 drivers/gpu/drm/drm_atomic.c |  86 +-
 drivers/gpu/drm/drm_atomic_helper.c  | 103 +++
 drivers/gpu/drm/drm_crtc.c   |  35 +++
 drivers/gpu/drm/drm_crtc_helper.c|  33 ++
 drivers/gpu/drm/i915/Makefile|   1 +
 drivers/gpu/drm/i915/i915_drv.c  |  27 +-
 drivers/gpu/drm/i915/i915_drv.h  |   8 +
 drivers/gpu/drm/i915/i915_reg.h  |  53 
 drivers/gpu/drm/i915/intel_color.c   | 573 +++
 drivers/gpu/drm/i915/intel_display.c | 181 ++-
 drivers/gpu/drm/i915/intel_drv.h |  12 +
 drivers/gpu/drm/i915/intel_fbdev.c   |   8 +
 include/drm/drm_atomic_helper.h  |   3 +
 include/drm/drm_crtc.h   |  46 ++-
 include/drm/drm_crtc_helper.h|   3 +
 include/uapi/drm/drm_mode.h  |  15 +
 17 files changed, 1087 insertions(+), 165 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_color.c

--
2.7.0


[Bug 94231] Problems compiling libdrm since glibc 2.23

2016-02-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=94231

--- Comment #10 from Mike Lothian  ---
And the relevant details:

Subject: [PATCH] sys/types.h: drop sys/sysmacros.h include

We want to break apart this include path due to namespace pollution.
https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/574a19d0/attachment-0001.html>


Disabling graph endpoints in device trees

2016-02-22 Thread John Keeping
Hi,

Is there a reason why endpoints in a device tree graph can't be
disabled?

I would like to be able to force the use of a particular CRTC for
certain outputs even though the hardware is capable of connecting any
CRTC to any output.  In this case I need to be able to support a wide
range of frequencies for external HDMI monitors so I will configure one
of the CRTCs to be able to generate these while the other will be tied
into a limited set of clock rates as a result of the overall system
clock setup.

Currently this can only be achieved by removing the endpoints from the
base SoC .dtsi file but it feels like it should be possible to add
'status = "disabled"' to the nodes in the board-specific .dts in order
to disable undesirable configurations.

I tested the change below and it behaves exactly as I want, but I don't
claim to understand all of the users of these functions to know if it
will break something else (hence this isn't a formal patch).

-- >8 --
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 017dd94..1e56b91 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2143,7 +2143,7 @@ struct device_node *of_graph_get_port_by_id(struct 
device_node *parent, u32 id)
if (node)
parent = node;

-   for_each_child_of_node(parent, port) {
+   for_each_available_child_of_node(parent, port) {
u32 port_id = 0;

if (of_node_cmp(port->name, "port") != 0)
@@ -2209,7 +2209,7 @@ struct device_node *of_graph_get_next_endpoint(const 
struct device_node *parent,
 * getting the next child. If the previous endpoint is NULL this
 * will return the first child.
 */
-   endpoint = of_get_next_child(port, prev);
+   endpoint = of_get_next_available_child(port, prev);
if (endpoint) {
of_node_put(port);
return endpoint;
@@ -2219,7 +2219,7 @@ struct device_node *of_graph_get_next_endpoint(const 
struct device_node *parent,
prev = NULL;

do {
-   port = of_get_next_child(parent, port);
+   port = of_get_next_available_child(parent, port);
if (!port)
return NULL;
} while (of_node_cmp(port->name, "port"));
-- 8< --


Thanks,
John


[PATCH 6/6] drm/msm/dsi: Parse DSI lanes via DT

2016-02-22 Thread Rob Herring
On Mon, Feb 22, 2016 at 1:19 AM, Archit Taneja  
wrote:
>
>
> On 02/22/2016 08:23 AM, Rob Herring wrote:
>>
>> On Mon, Feb 15, 2016 at 06:30:59PM +0530, Archit Taneja wrote:
>>>
>>> The DSI driver is currently unaware of how the DSI clock and data pins
>>> are mapped to the logical lanes provided by the DSI controller.
>>>
>>> Use the generic 'lanes' DT binding provided for DSI lanes (used for DSI
>>> in bindings/display/ti/ti,omap4-dss.txt) to get the desired mapping.
>>>
>>> The MSM DSI controller is restricted in terms of what all mappings
>>> it can support. The lane polarity is fixed for all the lanes, the clock
>>> lanes are fixed, and the data lanes can be swapped among each other only
>>> for a few combinations. Apply these restrictions when we parse the DT
>>> data.
>>>
>>> Cc: devicetree at vger.kernel.org
>>> Cc: Rob Herring 
>>> Cc: Tomi Valkeinen 
>>>
>>> Signed-off-by: Archit Taneja 
>>> ---
>>>   .../devicetree/bindings/display/msm/dsi.txt|  26 +++-
>>>   drivers/gpu/drm/msm/dsi/dsi_host.c | 146
>>> ++---
>>>   2 files changed, 149 insertions(+), 23 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/display/msm/dsi.txt
>>> b/Documentation/devicetree/bindings/display/msm/dsi.txt
>>> index e7423be..f0d8b6f 100644
>>> --- a/Documentation/devicetree/bindings/display/msm/dsi.txt
>>> +++ b/Documentation/devicetree/bindings/display/msm/dsi.txt
>>> @@ -44,9 +44,28 @@ Optional properties:
>>>   - pinctrl-names: the pin control state names; should contain "default"
>>>   - pinctrl-0: the default pinctrl state (active)
>>>   - pinctrl-n: the "sleep" pinctrl state
>>> -- port: DSI controller output port. This contains one endpoint subnode,
>>> with its
>>> -  remote-endpoint set to the phandle of the connected panel's endpoint.
>>> -  See Documentation/devicetree/bindings/graph.txt for device graph info.
>>> +- port: DSI controller output port, containing one endpoint subnode.
>>> +
>>> +  DSI Endpoint properties:
>>> +  - remote-endpoint: set to phandle of the connected panel's endpoint.
>>> +See Documentation/devicetree/bindings/graph.txt for device graph
>>> info.
>>> +  - lanes: list of pin numbers for the DSI lanes: CLKp, CLKn, DATA0p,
>>> DATA0n,
>>> +DATA1p, DATA1n, ...
>>> +This provides a physical to logical mapping of the DSI lanes. The
>>> CLKp and
>>> +CLKn pins have to be mapped to pins 0 and 1. For data lanes, there
>>> are only
>>
>>
>> Then why describe the clk pins?
>
>
> I was trying to use a DT binding that is already used for DSI hosts in
> TI SoCs.
>
> SoCs give different flexibility over how we map the physical lines with
> the actual data/clock lanes in the DSI controller. From what I know,
> this flexibility varies. For example, TI SoCs lets us move clock lanes
> too, and swap polarities.
>
> If we want all DSI host controllers to use a common binding to describe
> lanes, we'd need to go with the most flexible one, and the driver
> restricts it to the subsets that we support.
>
>>
>>> +a limited number of physical to logical mappings possible:
>>> +
>>> + "0123": Logic 0->Phys 0; Logic 1->Phys 1; Logic 2->Phys 2; Logic
>>> 3->Phys 3;
>>> + "3012": Logic 3->Phys 0; Logic 0->Phys 1; Logic 1->Phys 2; Logic
>>> 2->Phys 3;
>>> + "2301": Logic 2->Phys 0; Logic 3->Phys 1; Logic 0->Phys 2; Logic
>>> 1->Phys 3;
>>> + "1230": Logic 1->Phys 0; Logic 2->Phys 1; Logic 3->Phys 2; Logic
>>> 0->Phys 3;
>>> + "0321": Logic 0->Phys 0; Logic 3->Phys 1; Logic 2->Phys 2; Logic
>>> 1->Phys 3;
>>> + "1032": Logic 1->Phys 0; Logic 0->Phys 1; Logic 3->Phys 2; Logic
>>> 2->Phys 3;
>>> + "2103": Logic 2->Phys 0; Logic 1->Phys 1; Logic 0->Phys 2; Logic
>>> 3->Phys 3;
>>> + "3210": Logic 3->Phys 0; Logic 2->Phys 1; Logic 1->Phys 2; Logic
>>> 0->Phys 3;
>>> +
>>> + Here, a "3012" mapping will be represented by:
>>> + lanes = <0 1 8 9 2 3 4 5 6 7>;
>>
>>
>> I'm lost here. What does 8 mean for example. The index represents?
>
>
> The numbers here describe the logical lanes. I.e, the way in which the
> DSI controller pushes out data to the PHY. The ordering is as follows:
>
> 0 - CLKp
> 1 - CLKn
> 2 - DATA0p
> 3 - DATA0n
> 4 - DATA1p
> 5 - DATA1n
> 6 - DATA2p
> 7 - DATA2n
> 8 - DATA3p
> 9 - DATA3n
>
> The indices corresponding to these values represent the actual
> physical pins. The index 0 will always represent the pin CLKp,
> index 8 will always represent the physical pin DATA3p. This is
> something we would want to keep fixed across all SoCs.
>
> The configuration in the example would provide the following
> mapping:
>
> L: CLKp CLKn DATA3p DATA3n ATA0p DATA0n DATA1p DATA1n DATA2p DATA2n
>
> P: CLKp CLKn DATA0p DATA0n DATA1p DATA1n DATA2p DATA2n DATA3p DATA3n
>
> L represents the logical lanes, and P represents the physical lanes.
> L is what we provide in the DT property, and P are what the indices
> represent. Here, the 3rd logical lane is mapped on to the 0th
> physical data lane. The 0th l

[Bug 94231] Problems compiling libdrm since glibc 2.23

2016-02-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=94231

--- Comment #9 from Mike Lothian  ---
Created attachment 121891
  --> https://bugs.freedesktop.org/attachment.cgi?id=121891&action=edit
Glibc patches

Here's the patch tarball for your convenience

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/b44b18d5/attachment.html>


[Bug 94231] Problems compiling libdrm since glibc 2.23

2016-02-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=94231

--- Comment #8 from Mike Lothian  ---
The patches are bundled up into a tar file: glibc-2.23-patches-1.tar.bz2 which
is on the gentoo mirrors

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/80836dcc/attachment.html>


[Bug 94231] Problems compiling libdrm since glibc 2.23

2016-02-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=94231

--- Comment #7 from Emil Velikov  ---
Hmm... Gentoo devs decided to patch glibc in order to remove the include.

At the same time they lean that applications (25+ based on the incomplete list)
should be fixed to use sys/sysmacros.h. There's no justification and the manual
does not support this :-(

To make it even more strange the patch isn't alongside the glibc-2.23.ebuild in
the repo. Am I looking at the wrong repo ? Can anyone share a link with
discussion behind this decision ?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160222/ef3f8f0b/attachment.html>


  1   2   >