Skip to contentSkip to conversation

drm: Add few more wrapper functions for drm panel

PATCH In review Deepak M 3 participants 5 messages Feb 19, 2016

Subsystems (4)
lore
Share & tools
lore

Deepak M

author
#0 lore raw

PATCH 1/2 drm: Add few more wrapper functions for drm panel

Currently there are few pair of functions which are called during the panel enable/disable sequence. To improve the granularity, adding few more wrapper functions so that the functions are more specific on what they are doing.

---
 include/drm/drm_panel.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
include/drm/drm_panel.h +47 -0
index 13ff44b..c729f6d 100644
@@ -73,6 +73,12 @@ struct drm_panel_funcs {
 	int (*get_modes)(struct drm_panel *panel);
 	int (*get_timings)(struct drm_panel *panel, unsigned int num_timings,
 			   struct display_timing *timings);
+	int (*power_on)(struct drm_panel *panel);
+	int (*power_off)(struct drm_panel *panel);
+	int (*backlight_on)(struct drm_panel *panel);
+	int (*backlight_off)(struct drm_panel *panel);
+	int (*get_info)(struct drm_panel *panel,
+				struct drm_connector *connector);
 };
 
 struct drm_panel {
@@ -117,6 +123,47 @@ static inline int drm_panel_enable(struct drm_panel *panel)
 	return panel ? -ENOSYS : -EINVAL;
 }
 
+static inline int drm_panel_power_on(struct drm_panel *panel)
+{
+	if (panel && panel->funcs && panel->funcs->power_on)
+		return panel->funcs->power_on(panel);
+
+	return panel ? -ENOSYS : -EINVAL;
+}
+
+static inline int drm_panel_power_off(struct drm_panel *panel)
+{
+	if (panel && panel->funcs && panel->funcs->power_off)
+		return panel->funcs->power_off(panel);
+
+	return panel ? -ENOSYS : -EINVAL;
+}
+
+static inline int drm_panel_backlight_on(struct drm_panel *panel)
+{
+	if (panel && panel->funcs && panel->funcs->backlight_on)
+		return panel->funcs->backlight_on(panel);
+
+	return panel ? -ENOSYS : -EINVAL;
+}
+
+static inline int drm_panel_backlight_off(struct drm_panel *panel)
+{
+	if (panel && panel->funcs && panel->funcs->backlight_off)
+		return panel->funcs->backlight_off(panel);
+
+	return panel ? -ENOSYS : -EINVAL;
+}
+
+static inline int drm_panel_get_info(struct drm_panel *panel,
+				struct drm_connector *connector)
+{
+	if (connector && panel && panel->funcs && panel->funcs->get_info)
+		return panel->funcs->get_info(panel, connector);
+
+	return panel ? -ENOSYS : -EINVAL;
+}
+
 static inline int drm_panel_get_modes(struct drm_panel *panel)
 {
 	if (panel && panel->funcs && panel->funcs->get_modes)
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#1 lore raw

PATCH 2/2 drm/i915: Add functions to execute the new sequences from VBT

From: Gaurav K Singh <[email protected]>

New sequences are added in the mipi sequence block of the VBT from version 3 onwards. The sequences are added to make the code more generic as the panel related info are placed in the VBT.

---
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 48 ++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
drivers/gpu/drm/i915/intel_dsi_panel_vbt.c +48 -0
index c6e18fe..db8e210 100644
@@ -1035,12 +1035,60 @@ static int vbt_panel_get_modes(struct drm_panel *panel)
 	return 1;
 }
 
+static int vbt_panel_power_on(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_POWER_ON);
+
+	return 0;
+}
+
+static int vbt_panel_power_off(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_POWER_OFF);
+
+	return 0;
+}
+
+static int vbt_panel_backlight_on(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_BACKLIGHT_ON);
+
+	return 0;
+}
+
+static int vbt_panel_backlight_off(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_BACKLIGHT_OFF);
+
+	return 0;
+}
+
+static int vbt_panel_get_info(struct drm_panel *panel,
+					struct drm_connector *connector)
+{
+	struct intel_connector *intel_connector =
+				to_intel_connector(connector);
+
+	if (intel_connector) {
+		connector->display_info.width_mm =
+				intel_connector->panel.fixed_mode->width_mm;
+		connector->display_info.height_mm =
+				intel_connector->panel.fixed_mode->height_mm;
+	}
+	return 0;
+}
+
 static const struct drm_panel_funcs vbt_panel_funcs = {
 	.disable = vbt_panel_disable,
 	.unprepare = vbt_panel_unprepare,
 	.prepare = vbt_panel_prepare,
 	.enable = vbt_panel_enable,
 	.get_modes = vbt_panel_get_modes,
+	.power_on = vbt_panel_power_on,
+	.power_off = vbt_panel_power_off,
+	.backlight_on = vbt_panel_backlight_on,
+	.backlight_off = vbt_panel_backlight_off,
+	.get_info = vbt_panel_get_info,
 };
 
 struct drm_panel *vbt_panel_init(struct intel_dsi *intel_dsi, u16 panel_id)
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

Re: [PATCH 2/2] drm/i915: Add functions to execute the new sequences from VBT

Quoted 54 lines · Deepak M

From: Gaurav K Singh <[email protected]>

New sequences are added in the mipi sequence block of the VBT from version 3 onwards. The sequences are added to make the code more generic as the panel related info are placed in the VBT.

---
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 48 ++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
drivers/gpu/drm/i915/intel_dsi_panel_vbt.c +31 -0
index c6e18fe..db8e210 100644
@@ -1035,12 +1035,60 @@ static int vbt_panel_get_modes(struct drm_panel *panel)
 	return 1;
 }
 
+static int vbt_panel_power_on(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_POWER_ON);
+
+	return 0;
+}
+
+static int vbt_panel_power_off(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_POWER_OFF);
+
+	return 0;
+}
+
+static int vbt_panel_backlight_on(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_BACKLIGHT_ON);
+
+	return 0;
+}
+
+static int vbt_panel_backlight_off(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_BACKLIGHT_OFF);
+
+	return 0;
+}
+
+static int vbt_panel_get_info(struct drm_panel *panel,
+					struct drm_connector *connector)
+{

drivers/gpu/drm/i915/intel_dsi_panel_vbt.c static int vbt_panel_get_modes(struct drm_panel *panel) · line 1078

Quoted 10 lines
drivers/gpu/drm/i915/intel_dsi_panel_vbt.c +10 -0
+	struct intel_connector *intel_connector =
+				to_intel_connector(connector);
+
+	if (intel_connector) {
+		connector->display_info.width_mm =
+				intel_connector->panel.fixed_mode->width_mm;
+		connector->display_info.height_mm =
+				intel_connector->panel.fixed_mode->height_mm;
+	}
+	return 0;

I think we could do this part in the ->get_modes hook. For all the other displays, it's the ->get_modes hook that reads the EDID, and ultimately sets the display_info from EDID. We wouldn't need a new hook at all.

Also, this should be a separate change. If we can get the size information from the fixed mode from VBT, we should do that in ->get_modes, and backport this fix for stable kernels. It's sorely needed for BYT/CHV too.

BR,
Jani.

Quoted 16 lines
drivers/gpu/drm/i915/intel_dsi_panel_vbt.c +7 -0
+}
+
 static const struct drm_panel_funcs vbt_panel_funcs = {
 	.disable = vbt_panel_disable,
 	.unprepare = vbt_panel_unprepare,
 	.prepare = vbt_panel_prepare,
 	.enable = vbt_panel_enable,
 	.get_modes = vbt_panel_get_modes,
+	.power_on = vbt_panel_power_on,
+	.power_off = vbt_panel_power_off,
+	.backlight_on = vbt_panel_backlight_on,
+	.backlight_off = vbt_panel_backlight_off,
+	.get_info = vbt_panel_get_info,
 };
 
 struct drm_panel *vbt_panel_init(struct intel_dsi *intel_dsi, u16 panel_id)
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

✗ Fi.CI.BAT: warning for series starting with [1/2] drm: Add few more wrapper functions for drm panel

In reply to Deepak M
== Summary ==

== Summary ==

Series 3624v1 Series without cover letter
http://patchwork.freedesktop.org/api/1.0/series/3624/revisions/1/mbox/

Test gem_cs_prefetch:

        Subgroup basic-default:
                incomplete -> PASS       (ilk-hp8440p)
Test gem_ctx_param_basic:
        Subgroup basic-default:
                incomplete -> PASS       (snb-x220t)
        Subgroup invalid-ctx-get:
                incomplete -> PASS       (snb-x220t)
        Subgroup non-root-set-no-zeromap:
                incomplete -> PASS       (snb-x220t)
        Subgroup root-set:
                incomplete -> PASS       (snb-x220t)
        Subgroup root-set-no-zeromap-disabled:
                incomplete -> PASS       (snb-x220t)
        Subgroup root-set-no-zeromap-enabled:
                incomplete -> PASS       (snb-x220t)
Test gem_exec_basic:
        Subgroup basic-blt:
                incomplete -> PASS       (snb-x220t)
Test gem_flink_basic:
        Subgroup bad-flink:
                incomplete -> PASS       (snb-x220t)
Test gem_linear_blits:
        Subgroup basic:
                incomplete -> PASS       (snb-x220t)
Test gem_mmap:
        Subgroup basic:
                incomplete -> PASS       (snb-x220t)
        Subgroup basic-small-bo:
                incomplete -> PASS       (snb-x220t)
Test gem_mmap_gtt:
        Subgroup basic:
                incomplete -> PASS       (snb-x220t)
        Subgroup basic-copy:
                incomplete -> PASS       (snb-x220t)
        Subgroup basic-read-no-prefault:
                incomplete -> PASS       (snb-x220t)
        Subgroup basic-read-write-distinct:
                incomplete -> PASS       (snb-x220t)
        Subgroup basic-write-cpu-read-gtt:
                incomplete -> PASS       (snb-x220t)
        Subgroup basic-write-read-distinct:
                incomplete -> PASS       (snb-x220t)
Test gem_pread:
        Subgroup basic:
                incomplete -> PASS       (snb-x220t)
Test gem_render_linear_blits:
        Subgroup basic:
                incomplete -> PASS       (snb-x220t)
Test gem_render_tiled_blits:
        Subgroup basic:
                incomplete -> PASS       (snb-x220t)
Test gem_ringfill:
        Subgroup basic-default:
                incomplete -> PASS       (snb-x220t)
        Subgroup basic-default-bomb:
                incomplete -> PASS       (ivb-t430s)
        Subgroup basic-default-forked:
                incomplete -> PASS       (snb-x220t)
        Subgroup basic-default-hang:
                incomplete -> PASS       (snb-x220t)
Test gem_storedw_loop:
        Subgroup basic-bsd1:
                incomplete -> SKIP       (snb-x220t)
        Subgroup basic-render:
                incomplete -> PASS       (snb-x220t)
        Subgroup basic-vebox:
                incomplete -> SKIP       (snb-x220t)
Test gem_sync:
        Subgroup basic-blt:
                incomplete -> PASS       (snb-x220t)
Test gem_tiled_pread_basic:
                incomplete -> PASS       (snb-x220t)
Test kms_addfb_basic:
        Subgroup addfb25-modifier-no-flag:
                incomplete -> PASS       (snb-x220t)
        Subgroup bad-pitch-0:
                incomplete -> PASS       (snb-x220t)
        Subgroup bad-pitch-1024:
                incomplete -> PASS       (snb-x220t)
        Subgroup bad-pitch-128:
                incomplete -> PASS       (snb-x220t)
        Subgroup bad-pitch-256:
                incomplete -> PASS       (snb-x220t)
        Subgroup bad-pitch-999:
                incomplete -> PASS       (snb-x220t)
        Subgroup basic-x-tiled:
                incomplete -> PASS       (snb-x220t)
        Subgroup framebuffer-vs-set-tiling:
                incomplete -> PASS       (snb-x220t)
        Subgroup no-handle:
                incomplete -> PASS       (snb-x220t)
        Subgroup size-max:
                incomplete -> PASS       (snb-x220t)
        Subgroup too-wide:
                incomplete -> PASS       (snb-x220t)
        Subgroup unused-handle:
                incomplete -> PASS       (snb-x220t)
        Subgroup unused-modifier:
                incomplete -> PASS       (snb-x220t)
Test kms_flip:
        Subgroup basic-flip-vs-dpms:
                incomplete -> PASS       (snb-x220t)
Test kms_force_connector_basic:
        Subgroup force-load-detect:
                dmesg-fail -> FAIL       (snb-dellxps)
                fail       -> SKIP       (ilk-hp8440p)
        Subgroup prune-stale-modes:
                skip       -> PASS       (snb-x220t)
                pass       -> SKIP       (ilk-hp8440p)
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-c-frame-sequence:
                incomplete -> SKIP       (snb-x220t)
        Subgroup read-crc-pipe-a-frame-sequence:
                incomplete -> PASS       (snb-x220t)
        Subgroup read-crc-pipe-b:
                incomplete -> PASS       (snb-x220t)
        Subgroup read-crc-pipe-c-frame-sequence:
                incomplete -> SKIP       (snb-x220t)
        Subgroup suspend-read-crc-pipe-a:
                incomplete -> PASS       (snb-x220t)
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                incomplete -> FAIL       (snb-x220t)
                pass       -> DMESG-WARN (bsw-nuc-2)
        Subgroup basic-rte:
                dmesg-warn -> PASS       (bsw-nuc-2)
Test prime_self_import:
        Subgroup basic-with_two_bos:
                incomplete -> PASS       (snb-x220t)
bdw-nuci7        total:164  pass:153  dwarn:0   dfail:0   fail:0   skip:11 
bdw-ultra        total:167  pass:153  dwarn:0   dfail:0   fail:0   skip:14 
bsw-nuc-2        total:167  pass:136  dwarn:1   dfail:0   fail:0   skip:30 
byt-nuc          total:167  pass:141  dwarn:1   dfail:0   fail:0   skip:25 
hsw-gt2          total:167  pass:156  dwarn:0   dfail:1   fail:0   skip:10 
ilk-hp8440p      total:167  pass:117  dwarn:0   dfail:0   fail:0   skip:50 
ivb-t430s        total:167  pass:152  dwarn:0   dfail:0   fail:1   skip:14 
skl-i5k-2        total:167  pass:150  dwarn:1   dfail:0   fail:0   skip:16 
snb-dellxps      total:167  pass:144  dwarn:0   dfail:0   fail:1   skip:22 
snb-x220t        total:167  pass:144  dwarn:0   dfail:0   fail:2   skip:21 

Results at /archive/results/CI_IGT_test/Patchwork_1444/

e4599905334de9349501a383afb8503a1dde5728 drm-intel-nightly: 2016y-02m-18d-17h-13m-22s UTC integration manifest 5db201fbca7602784c9016292768fd03aced8d98 drm/i915: Add functions to execute the new sequences from VBT 1943085a8fd4900aac695f9c3bda502c19f3a639 drm: Add few more wrapper functions for drm panel

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
In reply to Deepak M
Quoted 5 lines · Deepak M

Currently there are few pair of functions which are called during the panel enable/disable sequence. To improve the granularity, adding few more wrapper functions so that the functions are more specific on what they are doing.

I want to see where all these new drm_panel_* functions would be called in intel_dsi.c.

Also, this patch touches drm core, not i915. You need to send this kind of stuff to [email protected] to get them merged, preferably Cc'ing the relevant maintainers (try scripts/get_maintainer.pl). But for that, I think you need to have the use case and the in-kernel user as well, so please send the intel_dsi.c patch too.

BR,
Jani.

Quoted 73 lines
---
 include/drm/drm_panel.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
include/drm/drm_panel.h +47 -0
index 13ff44b..c729f6d 100644
@@ -73,6 +73,12 @@ struct drm_panel_funcs {
 	int (*get_modes)(struct drm_panel *panel);
 	int (*get_timings)(struct drm_panel *panel, unsigned int num_timings,
 			   struct display_timing *timings);
+	int (*power_on)(struct drm_panel *panel);
+	int (*power_off)(struct drm_panel *panel);
+	int (*backlight_on)(struct drm_panel *panel);
+	int (*backlight_off)(struct drm_panel *panel);
+	int (*get_info)(struct drm_panel *panel,
+				struct drm_connector *connector);
 };
 
 struct drm_panel {
@@ -117,6 +123,47 @@ static inline int drm_panel_enable(struct drm_panel *panel)
 	return panel ? -ENOSYS : -EINVAL;
 }
 
+static inline int drm_panel_power_on(struct drm_panel *panel)
+{
+	if (panel && panel->funcs && panel->funcs->power_on)
+		return panel->funcs->power_on(panel);
+
+	return panel ? -ENOSYS : -EINVAL;
+}
+
+static inline int drm_panel_power_off(struct drm_panel *panel)
+{
+	if (panel && panel->funcs && panel->funcs->power_off)
+		return panel->funcs->power_off(panel);
+
+	return panel ? -ENOSYS : -EINVAL;
+}
+
+static inline int drm_panel_backlight_on(struct drm_panel *panel)
+{
+	if (panel && panel->funcs && panel->funcs->backlight_on)
+		return panel->funcs->backlight_on(panel);
+
+	return panel ? -ENOSYS : -EINVAL;
+}
+
+static inline int drm_panel_backlight_off(struct drm_panel *panel)
+{
+	if (panel && panel->funcs && panel->funcs->backlight_off)
+		return panel->funcs->backlight_off(panel);
+
+	return panel ? -ENOSYS : -EINVAL;
+}
+
+static inline int drm_panel_get_info(struct drm_panel *panel,
+				struct drm_connector *connector)
+{
+	if (connector && panel && panel->funcs && panel->funcs->get_info)
+		return panel->funcs->get_info(panel, connector);
+
+	return panel ? -ENOSYS : -EINVAL;
+}
+
 static inline int drm_panel_get_modes(struct drm_panel *panel)
 {
 	if (panel && panel->funcs && panel->funcs->get_modes)
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx