All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/4] PMIC based Panel and Backlight Control
@ 2014-12-26 10:23 Shobhit Kumar
  2014-12-26 10:23 ` [RFC 1/4] drm/i915: Define a common data structure for Panel Info Shobhit Kumar
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Shobhit Kumar @ 2014-12-26 10:23 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jani Nikula, Daniel Vetter, Shobhit Kumar

Hi All,
For quite some time this problem is there in front of us and I am trying to have
a closure on how to go about doing this. This patch set is a crude implementation
to trigger the discussion. 

Daniel sometime back suggested to look at drm_panel for doing this but I was not able
to figure out how the panel driver will be loaded because PMIC probe success does not
really imply that we need to load a PMIC based panel driver. It all depends on the OEM
design if there is a DSI panel. Even then there is a possibility of SoC being usde for
panel control. All this decission can be made from the VBT information. Hence as of now
I have kept this inside i915 to init, if from VBT we know that PMIC controls the panel
enable/disable. Maybe drm_panel is not needed and we can have it internal to i915.

Similar problem is there for backlight control over PMIC as well. For that probably we
need to have independant backlight class driver, but this panel driver can also control
backlight if needed.

Also currently this needs PMIC register read/write capability which is not there in
upstream yet. For my testing I used the crude implementation for the same from a patch 
attached in -
https://bugs.freedesktop.org/show_bug.cgi?id=85977

Requesting your comments to converge on best way of implementing this.

Regards
Shobhit

Shobhit Kumar (4):
  drm/i915: Define a common data structure for Panel Info
  drm/i915: Add a drm_panel over INTEL_SOC_PMIC
  drm/i915/Kconfig: By default select DRM_PANEL
  drm/i915: Enable PMIC panel control as drm_panel for DSI

 drivers/gpu/drm/i915/Kconfig               |   1 +
 drivers/gpu/drm/i915/Makefile              |   1 +
 drivers/gpu/drm/i915/intel_drv.h           |  14 +++
 drivers/gpu/drm/i915/intel_dsi.c           |  20 +++-
 drivers/gpu/drm/i915/intel_dsi.h           |  13 +--
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c |  11 +-
 drivers/gpu/drm/i915/intel_panel_pmic.c    | 157 +++++++++++++++++++++++++++++
 7 files changed, 202 insertions(+), 15 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_panel_pmic.c

-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [RFC 1/4] drm/i915: Define a common data structure for Panel Info
  2014-12-26 10:23 [RFC 0/4] PMIC based Panel and Backlight Control Shobhit Kumar
@ 2014-12-26 10:23 ` Shobhit Kumar
  2015-01-05 15:04   ` Daniel Vetter
  2014-12-26 10:23 ` [RFC 2/4] drm/i915: Add a drm_panel over INTEL_SOC_PMIC Shobhit Kumar
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Shobhit Kumar @ 2014-12-26 10:23 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jani Nikula, Daniel Vetter, Shobhit Kumar

As of now this includes only PPS and BLC delays. New things can be added
as and when needed

Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
---
 drivers/gpu/drm/i915/intel_drv.h           | 11 +++++++++++
 drivers/gpu/drm/i915/intel_dsi.h           |  7 +------
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 10 +++++-----
 3 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 588b618..0088f16 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -731,6 +731,17 @@ struct intel_load_detect_pipe {
 	int dpms_mode;
 };
 
+struct panel_info {
+	/* all delays in ms */
+	u16 backlight_off_delay;
+	u16 backlight_on_delay;
+	u16 panel_on_delay;
+	u16 panel_off_delay;
+	u16 panel_pwr_cycle_delay;
+
+	/* Other panel specififc stuff */
+};
+
 static inline struct intel_encoder *
 intel_attached_encoder(struct drm_connector *connector)
 {
diff --git a/drivers/gpu/drm/i915/intel_dsi.h b/drivers/gpu/drm/i915/intel_dsi.h
index 8fe2064..8b20f76 100644
--- a/drivers/gpu/drm/i915/intel_dsi.h
+++ b/drivers/gpu/drm/i915/intel_dsi.h
@@ -129,12 +129,7 @@ struct intel_dsi {
 	u32 pclk;
 	u16 burst_mode_ratio;
 
-	/* all delays in ms */
-	u16 backlight_off_delay;
-	u16 backlight_on_delay;
-	u16 panel_on_delay;
-	u16 panel_off_delay;
-	u16 panel_pwr_cycle_delay;
+	struct panel_info pinfo;
 };
 
 /* XXX: Transitional before dual port configuration */
diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
index 5493aef..56b5b80 100644
--- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
+++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
@@ -550,11 +550,11 @@ static bool generic_init(struct intel_dsi_device *dsi)
 	/* delays in VBT are in unit of 100us, so need to convert
 	 * here in ms
 	 * Delay (100us) * 100 /1000 = Delay / 10 (ms) */
-	intel_dsi->backlight_off_delay = pps->bl_disable_delay / 10;
-	intel_dsi->backlight_on_delay = pps->bl_enable_delay / 10;
-	intel_dsi->panel_on_delay = pps->panel_on_delay / 10;
-	intel_dsi->panel_off_delay = pps->panel_off_delay / 10;
-	intel_dsi->panel_pwr_cycle_delay = pps->panel_power_cycle_delay / 10;
+	intel_dsi->pinfo.backlight_off_delay = pps->bl_disable_delay / 10;
+	intel_dsi->pinfo.backlight_on_delay = pps->bl_enable_delay / 10;
+	intel_dsi->pinfo.panel_on_delay = pps->panel_on_delay / 10;
+	intel_dsi->pinfo.panel_off_delay = pps->panel_off_delay / 10;
+	intel_dsi->pinfo.panel_pwr_cycle_delay = pps->panel_power_cycle_delay / 10;
 
 	return true;
 }
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC 2/4] drm/i915: Add a drm_panel over INTEL_SOC_PMIC
  2014-12-26 10:23 [RFC 0/4] PMIC based Panel and Backlight Control Shobhit Kumar
  2014-12-26 10:23 ` [RFC 1/4] drm/i915: Define a common data structure for Panel Info Shobhit Kumar
@ 2014-12-26 10:23 ` Shobhit Kumar
  2014-12-26 10:23 ` [RFC 3/4] drm/i915/Kconfig: By default select DRM_PANEL Shobhit Kumar
  2014-12-26 10:23 ` [RFC 4/4] drm/i915: Enable PMIC panel control as drm_panel for DSI Shobhit Kumar
  3 siblings, 0 replies; 8+ messages in thread
From: Shobhit Kumar @ 2014-12-26 10:23 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jani Nikula, Daniel Vetter, Shobhit Kumar

This driver just add PANEL_ENABLE/DISABLE control using drm_panel
framework.

Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
---
 drivers/gpu/drm/i915/Makefile           |   1 +
 drivers/gpu/drm/i915/intel_drv.h        |   3 +
 drivers/gpu/drm/i915/intel_panel_pmic.c | 157 ++++++++++++++++++++++++++++++++
 3 files changed, 161 insertions(+)
 create mode 100644 drivers/gpu/drm/i915/intel_panel_pmic.c

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 1849ffa..d282476 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -79,6 +79,7 @@ i915-y += dvo_ch7017.o \
 	  intel_i2c.o \
 	  intel_lvds.o \
 	  intel_panel.o \
+	  intel_panel_pmic.o \
 	  intel_sdvo.o \
 	  intel_tv.o
 
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 0088f16..1dab753 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1142,6 +1142,9 @@ extern struct drm_display_mode *intel_find_panel_downclock(
 void intel_backlight_register(struct drm_device *dev);
 void intel_backlight_unregister(struct drm_device *dev);
 
+/* intel_panel_soc_pmic.c */
+struct drm_panel *intel_panel_pmic_init(struct device *dev,
+					struct panel_info *info);
 
 /* intel_psr.c */
 void intel_psr_enable(struct intel_dp *intel_dp);
diff --git a/drivers/gpu/drm/i915/intel_panel_pmic.c b/drivers/gpu/drm/i915/intel_panel_pmic.c
new file mode 100644
index 0000000..28a9f00
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_panel_pmic.c
@@ -0,0 +1,157 @@
+/*
+ * Copyright © 2006-2014 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.
+ *
+ * Authors:
+ *	Shobhit Kumar <shobhit.kumar@intel.com>
+ */
+
+#include <drm/drmP.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_panel.h>
+#include <linux/mfd/intel_soc_pmic.h>
+#include "intel_drv.h"
+
+#define PMIC_PANEL_EN	0x52
+struct panel_pmic {
+	struct drm_panel base;
+	bool prepared;
+	bool enabled;
+
+	/* Panel enable/disable specififc delays */
+	struct panel_info pinfo;
+};
+
+static inline struct panel_pmic *to_panel_pmic(struct drm_panel *panel)
+{
+	return container_of(panel, struct panel_pmic, base);
+}
+
+static int panel_pmic_disable(struct drm_panel *panel)
+{
+	struct panel_pmic *p = to_panel_pmic(panel);
+
+	if (!p->enabled)
+		return 0;
+
+	DRM_DEBUG_KMS("\n");
+
+	/* invoke the pmic driver */
+	intel_soc_pmic_writeb(PMIC_PANEL_EN, 0x00);
+	msleep(p->pinfo.panel_off_delay);
+	msleep(p->pinfo.panel_pwr_cycle_delay);
+
+	p->enabled = false;
+
+	return 0;
+}
+
+static int panel_pmic_unprepare(struct drm_panel *panel)
+{
+	struct panel_pmic *p = to_panel_pmic(panel);
+
+	if (!p->prepared)
+		return 0;
+
+	/* Nothing needed */
+	p->prepared = false;
+
+	return 0;
+}
+
+static int panel_pmic_prepare(struct drm_panel *panel)
+{
+	struct panel_pmic *p = to_panel_pmic(panel);
+
+	if (p->prepared)
+		return 0;
+
+	/* Nothing needed */
+	p->prepared = true;
+
+	return 0;
+}
+
+static int panel_pmic_enable(struct drm_panel *panel)
+{
+	struct panel_pmic *p = to_panel_pmic(panel);
+
+	if (p->enabled)
+		return 0;
+
+	DRM_DEBUG_KMS("\n");
+
+	/* invoke the pmic driver */
+	intel_soc_pmic_writeb(PMIC_PANEL_EN, 0x01);
+	msleep(p->pinfo.panel_on_delay);
+
+	p->enabled = true;
+
+	return 0;
+}
+
+static const struct drm_panel_funcs panel_pmic_funcs = {
+	.disable = panel_pmic_disable,
+	.unprepare = panel_pmic_unprepare,
+	.prepare = panel_pmic_prepare,
+	.enable = panel_pmic_enable,
+};
+
+struct drm_panel *intel_panel_pmic_init(struct device *dev,
+					struct panel_info *info)
+{
+	struct panel_pmic *panel;
+	bool status = false;
+
+	DRM_DEBUG_KMS("\n");
+
+	panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
+	if (!panel)
+		return NULL;
+
+	status = intel_soc_pmic_readb(PMIC_PANEL_EN) ? true : false;
+	panel->enabled = panel->prepared = status;
+
+	memcpy(&panel->pinfo, info, sizeof(struct panel_info));
+
+	drm_panel_init(&panel->base);
+	panel->base.dev = dev;
+	panel->base.funcs = &panel_pmic_funcs;
+
+	drm_panel_add(&panel->base);
+
+	return &panel->base;
+}
+
+int intel_panel_pmic_remove(struct device *dev)
+{
+	struct panel_pmic *panel = dev_get_drvdata(dev);
+
+	DRM_DEBUG_KMS("\n");
+
+	drm_panel_detach(&panel->base);
+	drm_panel_remove(&panel->base);
+
+	panel_pmic_disable(&panel->base);
+
+	kfree(panel);
+	return 0;
+}
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC 3/4] drm/i915/Kconfig: By default select DRM_PANEL
  2014-12-26 10:23 [RFC 0/4] PMIC based Panel and Backlight Control Shobhit Kumar
  2014-12-26 10:23 ` [RFC 1/4] drm/i915: Define a common data structure for Panel Info Shobhit Kumar
  2014-12-26 10:23 ` [RFC 2/4] drm/i915: Add a drm_panel over INTEL_SOC_PMIC Shobhit Kumar
@ 2014-12-26 10:23 ` Shobhit Kumar
  2014-12-26 10:23 ` [RFC 4/4] drm/i915: Enable PMIC panel control as drm_panel for DSI Shobhit Kumar
  3 siblings, 0 replies; 8+ messages in thread
From: Shobhit Kumar @ 2014-12-26 10:23 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jani Nikula, Daniel Vetter, Shobhit Kumar

This will be needed for enabling drm_panel driver over pmic

Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
---
 drivers/gpu/drm/i915/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index 4e39ab3..3210dbb 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -18,6 +18,7 @@ config DRM_I915
 	select INPUT if ACPI
 	select ACPI_VIDEO if ACPI
 	select ACPI_BUTTON if ACPI
+	select DRM_PANEL
 	help
 	  Choose this option if you have a system that has "Intel Graphics
 	  Media Accelerator" or "HD Graphics" integrated graphics,
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC 4/4] drm/i915: Enable PMIC panel control as drm_panel for DSI
  2014-12-26 10:23 [RFC 0/4] PMIC based Panel and Backlight Control Shobhit Kumar
                   ` (2 preceding siblings ...)
  2014-12-26 10:23 ` [RFC 3/4] drm/i915/Kconfig: By default select DRM_PANEL Shobhit Kumar
@ 2014-12-26 10:23 ` Shobhit Kumar
  3 siblings, 0 replies; 8+ messages in thread
From: Shobhit Kumar @ 2014-12-26 10:23 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jani Nikula, Daniel Vetter, Shobhit Kumar

This initialize the drm_panel based on PMIC driver and uses drm_panel_*
for controlling the panel enable/disable states

Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
---
 drivers/gpu/drm/i915/intel_dsi.c           | 20 ++++++++++++++++----
 drivers/gpu/drm/i915/intel_dsi.h           |  6 ++++++
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c |  1 +
 3 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 42b6d6f..3a56674 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -26,6 +26,7 @@
 #include <drm/drmP.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
+#include <drm/drm_panel.h>
 #include <drm/i915_drm.h>
 #include <linux/slab.h>
 #include "i915_drv.h"
@@ -230,6 +231,8 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)
 
 	DRM_DEBUG_KMS("\n");
 
+	drm_panel_enable(intel_dsi->panel);
+
 	/* Disable DPOunit clock gating, can stall pipe
 	 * and we need DPLL REFA always enabled */
 	tmp = I915_READ(DPLL(pipe));
@@ -247,8 +250,6 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)
 	/* put device in ready state */
 	intel_dsi_device_ready(encoder);
 
-	msleep(intel_dsi->panel_on_delay);
-
 	if (intel_dsi->dev.dev_ops->panel_reset)
 		intel_dsi->dev.dev_ops->panel_reset(&intel_dsi->dev);
 
@@ -390,8 +391,7 @@ static void intel_dsi_post_disable(struct intel_encoder *encoder)
 	if (intel_dsi->dev.dev_ops->disable_panel_power)
 		intel_dsi->dev.dev_ops->disable_panel_power(&intel_dsi->dev);
 
-	msleep(intel_dsi->panel_off_delay);
-	msleep(intel_dsi->panel_pwr_cycle_delay);
+	drm_panel_disable(intel_dsi->panel);
 }
 
 static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
@@ -896,6 +896,18 @@ void intel_dsi_init(struct drm_device *dev)
 	fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
 	intel_panel_init(&intel_connector->panel, fixed_mode, NULL);
 
+	/* Initialize the PMIC based drm_panel if available on the platform */
+	if (intel_dsi->pps_blc == PPS_BLC_PMIC) {
+		intel_dsi->panel = intel_panel_pmic_init(dev->dev,
+							&intel_dsi->pinfo);
+		if (!intel_dsi->panel) {
+			DRM_ERROR("Panel init fail !! EN/DISABLE will not work leaking power !!\n");
+			return;
+		}
+
+		drm_panel_attach(intel_dsi->panel, connector);
+	}
+
 	return;
 
 err:
diff --git a/drivers/gpu/drm/i915/intel_dsi.h b/drivers/gpu/drm/i915/intel_dsi.h
index 8b20f76..641c80d 100644
--- a/drivers/gpu/drm/i915/intel_dsi.h
+++ b/drivers/gpu/drm/i915/intel_dsi.h
@@ -33,6 +33,9 @@
 #define DSI_DUAL_LINK_FRONT_BACK	1
 #define DSI_DUAL_LINK_PIXEL_ALT		2
 
+#define PPS_BLC_PMIC	0
+#define PPS_BLC_SOC	1
+
 struct intel_dsi_device {
 	unsigned int panel_id;
 	const char *name;
@@ -83,6 +86,8 @@ struct intel_dsi {
 
 	struct intel_connector *attached_connector;
 
+	struct drm_panel *panel;
+
 	/* bit mask of ports being driven */
 	u16 ports;
 
@@ -116,6 +121,7 @@ struct intel_dsi {
 	u32 dphy_reg;
 	u32 video_frmt_cfg_bits;
 	u16 lp_byte_clk;
+	u8 pps_blc;
 
 	/* timeouts in byte clocks */
 	u16 lp_rx_timeout;
diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
index 56b5b80..b91667b 100644
--- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
+++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
@@ -297,6 +297,7 @@ static bool generic_init(struct intel_dsi_device *dsi)
 	intel_dsi->pixel_format = mipi_config->videomode_color_format << 7;
 	intel_dsi->dual_link = mipi_config->dual_link;
 	intel_dsi->pixel_overlap = mipi_config->pixel_overlap;
+	intel_dsi->pps_blc = mipi_config->pwm_blc;
 
 	if (intel_dsi->dual_link)
 		intel_dsi->ports = ((1 << PORT_A) | (1 << PORT_C));
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [RFC 1/4] drm/i915: Define a common data structure for Panel Info
  2014-12-26 10:23 ` [RFC 1/4] drm/i915: Define a common data structure for Panel Info Shobhit Kumar
@ 2015-01-05 15:04   ` Daniel Vetter
  2015-01-05 15:44     ` Jani Nikula
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Vetter @ 2015-01-05 15:04 UTC (permalink / raw)
  To: Shobhit Kumar; +Cc: Jani Nikula, Daniel Vetter, intel-gfx

On Fri, Dec 26, 2014 at 03:53:27PM +0530, Shobhit Kumar wrote:
> As of now this includes only PPS and BLC delays. New things can be added
> as and when needed
> 
> Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_drv.h           | 11 +++++++++++
>  drivers/gpu/drm/i915/intel_dsi.h           |  7 +------
>  drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 10 +++++-----
>  3 files changed, 17 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 588b618..0088f16 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -731,6 +731,17 @@ struct intel_load_detect_pipe {
>  	int dpms_mode;
>  };
>  
> +struct panel_info {

intel_panel_info please.
-Daniel

> +	/* all delays in ms */
> +	u16 backlight_off_delay;
> +	u16 backlight_on_delay;
> +	u16 panel_on_delay;
> +	u16 panel_off_delay;
> +	u16 panel_pwr_cycle_delay;
> +
> +	/* Other panel specififc stuff */
> +};
> +
>  static inline struct intel_encoder *
>  intel_attached_encoder(struct drm_connector *connector)
>  {
> diff --git a/drivers/gpu/drm/i915/intel_dsi.h b/drivers/gpu/drm/i915/intel_dsi.h
> index 8fe2064..8b20f76 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.h
> +++ b/drivers/gpu/drm/i915/intel_dsi.h
> @@ -129,12 +129,7 @@ struct intel_dsi {
>  	u32 pclk;
>  	u16 burst_mode_ratio;
>  
> -	/* all delays in ms */
> -	u16 backlight_off_delay;
> -	u16 backlight_on_delay;
> -	u16 panel_on_delay;
> -	u16 panel_off_delay;
> -	u16 panel_pwr_cycle_delay;
> +	struct panel_info pinfo;
>  };
>  
>  /* XXX: Transitional before dual port configuration */
> diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
> index 5493aef..56b5b80 100644
> --- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
> +++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
> @@ -550,11 +550,11 @@ static bool generic_init(struct intel_dsi_device *dsi)
>  	/* delays in VBT are in unit of 100us, so need to convert
>  	 * here in ms
>  	 * Delay (100us) * 100 /1000 = Delay / 10 (ms) */
> -	intel_dsi->backlight_off_delay = pps->bl_disable_delay / 10;
> -	intel_dsi->backlight_on_delay = pps->bl_enable_delay / 10;
> -	intel_dsi->panel_on_delay = pps->panel_on_delay / 10;
> -	intel_dsi->panel_off_delay = pps->panel_off_delay / 10;
> -	intel_dsi->panel_pwr_cycle_delay = pps->panel_power_cycle_delay / 10;
> +	intel_dsi->pinfo.backlight_off_delay = pps->bl_disable_delay / 10;
> +	intel_dsi->pinfo.backlight_on_delay = pps->bl_enable_delay / 10;
> +	intel_dsi->pinfo.panel_on_delay = pps->panel_on_delay / 10;
> +	intel_dsi->pinfo.panel_off_delay = pps->panel_off_delay / 10;
> +	intel_dsi->pinfo.panel_pwr_cycle_delay = pps->panel_power_cycle_delay / 10;
>  
>  	return true;
>  }
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC 1/4] drm/i915: Define a common data structure for Panel Info
  2015-01-05 15:04   ` Daniel Vetter
@ 2015-01-05 15:44     ` Jani Nikula
  2015-01-06  7:58       ` Kumar, Shobhit
  0 siblings, 1 reply; 8+ messages in thread
From: Jani Nikula @ 2015-01-05 15:44 UTC (permalink / raw)
  To: Daniel Vetter, Shobhit Kumar; +Cc: Daniel Vetter, intel-gfx

On Mon, 05 Jan 2015, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Fri, Dec 26, 2014 at 03:53:27PM +0530, Shobhit Kumar wrote:
>> As of now this includes only PPS and BLC delays. New things can be added
>> as and when needed
>> 
>> Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_drv.h           | 11 +++++++++++
>>  drivers/gpu/drm/i915/intel_dsi.h           |  7 +------
>>  drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 10 +++++-----
>>  3 files changed, 17 insertions(+), 11 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
>> index 588b618..0088f16 100644
>> --- a/drivers/gpu/drm/i915/intel_drv.h
>> +++ b/drivers/gpu/drm/i915/intel_drv.h
>> @@ -731,6 +731,17 @@ struct intel_load_detect_pipe {
>>  	int dpms_mode;
>>  };
>>  
>> +struct panel_info {
>
> intel_panel_info please.
> -Daniel
>
>> +	/* all delays in ms */
>> +	u16 backlight_off_delay;
>> +	u16 backlight_on_delay;
>> +	u16 panel_on_delay;
>> +	u16 panel_off_delay;
>> +	u16 panel_pwr_cycle_delay;

struct intel_dp already has

	int panel_power_up_delay;
	int panel_power_down_delay;
	int panel_power_cycle_delay;
	int backlight_on_delay;
	int backlight_off_delay;

so I think it would be good to abstract the delays into a separate
struct with these names.

BR,
Jani.


>> +
>> +	/* Other panel specififc stuff */
>> +};
>> +
>>  static inline struct intel_encoder *
>>  intel_attached_encoder(struct drm_connector *connector)
>>  {
>> diff --git a/drivers/gpu/drm/i915/intel_dsi.h b/drivers/gpu/drm/i915/intel_dsi.h
>> index 8fe2064..8b20f76 100644
>> --- a/drivers/gpu/drm/i915/intel_dsi.h
>> +++ b/drivers/gpu/drm/i915/intel_dsi.h
>> @@ -129,12 +129,7 @@ struct intel_dsi {
>>  	u32 pclk;
>>  	u16 burst_mode_ratio;
>>  
>> -	/* all delays in ms */
>> -	u16 backlight_off_delay;
>> -	u16 backlight_on_delay;
>> -	u16 panel_on_delay;
>> -	u16 panel_off_delay;
>> -	u16 panel_pwr_cycle_delay;
>> +	struct panel_info pinfo;
>>  };
>>  
>>  /* XXX: Transitional before dual port configuration */
>> diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
>> index 5493aef..56b5b80 100644
>> --- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
>> +++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
>> @@ -550,11 +550,11 @@ static bool generic_init(struct intel_dsi_device *dsi)
>>  	/* delays in VBT are in unit of 100us, so need to convert
>>  	 * here in ms
>>  	 * Delay (100us) * 100 /1000 = Delay / 10 (ms) */
>> -	intel_dsi->backlight_off_delay = pps->bl_disable_delay / 10;
>> -	intel_dsi->backlight_on_delay = pps->bl_enable_delay / 10;
>> -	intel_dsi->panel_on_delay = pps->panel_on_delay / 10;
>> -	intel_dsi->panel_off_delay = pps->panel_off_delay / 10;
>> -	intel_dsi->panel_pwr_cycle_delay = pps->panel_power_cycle_delay / 10;
>> +	intel_dsi->pinfo.backlight_off_delay = pps->bl_disable_delay / 10;
>> +	intel_dsi->pinfo.backlight_on_delay = pps->bl_enable_delay / 10;
>> +	intel_dsi->pinfo.panel_on_delay = pps->panel_on_delay / 10;
>> +	intel_dsi->pinfo.panel_off_delay = pps->panel_off_delay / 10;
>> +	intel_dsi->pinfo.panel_pwr_cycle_delay = pps->panel_power_cycle_delay / 10;
>>  
>>  	return true;
>>  }
>> -- 
>> 1.9.1
>> 
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC 1/4] drm/i915: Define a common data structure for Panel Info
  2015-01-05 15:44     ` Jani Nikula
@ 2015-01-06  7:58       ` Kumar, Shobhit
  0 siblings, 0 replies; 8+ messages in thread
From: Kumar, Shobhit @ 2015-01-06  7:58 UTC (permalink / raw)
  To: Jani Nikula, Daniel Vetter, Shobhit Kumar; +Cc: Daniel Vetter, intel-gfx

On 1/5/2015 9:14 PM, Jani Nikula wrote:
> On Mon, 05 Jan 2015, Daniel Vetter <daniel@ffwll.ch> wrote:
>> On Fri, Dec 26, 2014 at 03:53:27PM +0530, Shobhit Kumar wrote:
>>> As of now this includes only PPS and BLC delays. New things can be added
>>> as and when needed
>>>
>>> Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
>>> ---
>>>   drivers/gpu/drm/i915/intel_drv.h           | 11 +++++++++++
>>>   drivers/gpu/drm/i915/intel_dsi.h           |  7 +------
>>>   drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 10 +++++-----
>>>   3 files changed, 17 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
>>> index 588b618..0088f16 100644
>>> --- a/drivers/gpu/drm/i915/intel_drv.h
>>> +++ b/drivers/gpu/drm/i915/intel_drv.h
>>> @@ -731,6 +731,17 @@ struct intel_load_detect_pipe {
>>>   	int dpms_mode;
>>>   };
>>>
>>> +struct panel_info {
>>
>> intel_panel_info please.
>> -Daniel
>>
>>> +	/* all delays in ms */
>>> +	u16 backlight_off_delay;
>>> +	u16 backlight_on_delay;
>>> +	u16 panel_on_delay;
>>> +	u16 panel_off_delay;
>>> +	u16 panel_pwr_cycle_delay;
>
> struct intel_dp already has
>
> 	int panel_power_up_delay;
> 	int panel_power_down_delay;
> 	int panel_power_cycle_delay;
> 	int backlight_on_delay;
> 	int backlight_off_delay;
>
> so I think it would be good to abstract the delays into a separate
> struct with these names.

intel_dsi already had the names that I used. I can change to the ones 
used by eDP.

Regards
Shobhit

>
> BR,
> Jani.
>
>
>>> +
>>> +	/* Other panel specififc stuff */
>>> +};
>>> +
>>>   static inline struct intel_encoder *
>>>   intel_attached_encoder(struct drm_connector *connector)
>>>   {
>>> diff --git a/drivers/gpu/drm/i915/intel_dsi.h b/drivers/gpu/drm/i915/intel_dsi.h
>>> index 8fe2064..8b20f76 100644
>>> --- a/drivers/gpu/drm/i915/intel_dsi.h
>>> +++ b/drivers/gpu/drm/i915/intel_dsi.h
>>> @@ -129,12 +129,7 @@ struct intel_dsi {
>>>   	u32 pclk;
>>>   	u16 burst_mode_ratio;
>>>
>>> -	/* all delays in ms */
>>> -	u16 backlight_off_delay;
>>> -	u16 backlight_on_delay;
>>> -	u16 panel_on_delay;
>>> -	u16 panel_off_delay;
>>> -	u16 panel_pwr_cycle_delay;
>>> +	struct panel_info pinfo;
>>>   };
>>>
>>>   /* XXX: Transitional before dual port configuration */
>>> diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
>>> index 5493aef..56b5b80 100644
>>> --- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
>>> +++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
>>> @@ -550,11 +550,11 @@ static bool generic_init(struct intel_dsi_device *dsi)
>>>   	/* delays in VBT are in unit of 100us, so need to convert
>>>   	 * here in ms
>>>   	 * Delay (100us) * 100 /1000 = Delay / 10 (ms) */
>>> -	intel_dsi->backlight_off_delay = pps->bl_disable_delay / 10;
>>> -	intel_dsi->backlight_on_delay = pps->bl_enable_delay / 10;
>>> -	intel_dsi->panel_on_delay = pps->panel_on_delay / 10;
>>> -	intel_dsi->panel_off_delay = pps->panel_off_delay / 10;
>>> -	intel_dsi->panel_pwr_cycle_delay = pps->panel_power_cycle_delay / 10;
>>> +	intel_dsi->pinfo.backlight_off_delay = pps->bl_disable_delay / 10;
>>> +	intel_dsi->pinfo.backlight_on_delay = pps->bl_enable_delay / 10;
>>> +	intel_dsi->pinfo.panel_on_delay = pps->panel_on_delay / 10;
>>> +	intel_dsi->pinfo.panel_off_delay = pps->panel_off_delay / 10;
>>> +	intel_dsi->pinfo.panel_pwr_cycle_delay = pps->panel_power_cycle_delay / 10;
>>>
>>>   	return true;
>>>   }
>>> --
>>> 1.9.1
>>>
>>> _______________________________________________
>>> Intel-gfx mailing list
>>> Intel-gfx@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>>
>> --
>> Daniel Vetter
>> Software Engineer, Intel Corporation
>> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-01-06  7:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-26 10:23 [RFC 0/4] PMIC based Panel and Backlight Control Shobhit Kumar
2014-12-26 10:23 ` [RFC 1/4] drm/i915: Define a common data structure for Panel Info Shobhit Kumar
2015-01-05 15:04   ` Daniel Vetter
2015-01-05 15:44     ` Jani Nikula
2015-01-06  7:58       ` Kumar, Shobhit
2014-12-26 10:23 ` [RFC 2/4] drm/i915: Add a drm_panel over INTEL_SOC_PMIC Shobhit Kumar
2014-12-26 10:23 ` [RFC 3/4] drm/i915/Kconfig: By default select DRM_PANEL Shobhit Kumar
2014-12-26 10:23 ` [RFC 4/4] drm/i915: Enable PMIC panel control as drm_panel for DSI Shobhit Kumar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.