Add a few panels and use correct modes
v2 cover Add a few panels and use correct modes
This series contains 4 patches:
1. Add a few new generic edp panels.
2. Support a new quirk to override the mode read from edid 3-4. Unset preferred mode from edid if hard-coded mode presents.
v1: https://patchwork.kernel.org/project/dri-devel/cover/[email protected]/
Hsin-Yi Wang (4):
drm/panel-edp: Add several AUO/BOE panels drm/panel-edp: Add override_edid_mode quirk for generic edp drm/modes: Add a function to clear preferred modes drm/panel-edp: Choose correct preferred mode
drivers/gpu/drm/drm_modes.c | 16 ++++ drivers/gpu/drm/panel/panel-edp.c | 130 ++++++++++++++++++++++++++++-- include/drm/drm_modes.h | 1 + 3 files changed, 139 insertions(+), 8 deletions(-)
Signature · 1 line
2.42.0.869.gea05f2083d-goog
PATCH v2 1/4 drm/panel-edp: Add several AUO/BOE panels
Add a few generic edp panels used by mt8186 chromebooks. Besides, modify the following panel:
- AUO 0x235c B116XTN02 renamed to B116XTN02.3.
- AUO 0x405c B116XAK01 adjust the timing of auo_b116xak01. According to the datasheet: T3=200, T12=500, T7_max = 50.
---v1->v2: Address comments: update delay for auo_b116xak01, sort entries.
--- drivers/gpu/drm/panel/panel-edp.c | 57 +++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-edp.c +55 -2
@@ -973,6 +973,8 @@ static const struct panel_desc auo_b116xak01 = { }, .delay = { .hpd_absent = 200, + .unprepare = 500, + .enable = 50, }, };
@@ -1830,6 +1832,12 @@ static const struct panel_delay delay_200_500_e50 = { .enable = 50, }; +static const struct panel_delay delay_200_500_e80 = { + .hpd_absent =200 , + .unprepare =500 , + .enable =80 , +}; +static const struct panel_delay delay_200_500_e80_d50 = { .hpd_absent =200 , .unprepare =500 ,
@@ -1849,6 +1857,19 @@ static const struct panel_delay delay_200_500_e200 = { .enable = 200, }; +static const struct panel_delay delay_200_500_e200_d10 = { + .hpd_absent =200 , + .unprepare =500 , + .enable =200 , + .disable =10 , +}; + +static const struct panel_delay delay_200_150_e200 = { + .hpd_absent =200 , + .unprepare =150 , + .enable =200 , +}; +#define EDP_PANEL_ENTRY (vend_chr_0, vend_chr_1, vend_chr_2, product_id, _delay, _name) \ { \ .name = _name, \
@@ -1869,37 +1890,69 @@ static const struct edp_panel_entry edp_panels[] = {EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x145c , &delay_200_500_e50,"B116XAB01.4" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x1e9b , &delay_200_500_e50,"B133UAN02.1" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x1ea5 , &delay_200_500_e50,"B116XAK01.6" ), -EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x235c , &delay_200_500_e50,"B116XTN02" ), -EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x405c , &auo_b116xak01.delay,"B116XAK01" ), +EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x208d , &delay_200_500_e50,"B140HTN02.1" ), +EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x235c , &delay_200_500_e50,"B116XTN02.3" ), +EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x239b , &delay_200_500_e50,"B116XAN06.1" ), +EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x255c , &delay_200_500_e50,"B116XTN02.5" ), +EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x403d , &delay_200_500_e50,"B140HAN04.0" ), +EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x405c , &auo_b116xak01.delay,"B116XAK01.0" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x582d , &delay_200_500_e50,"B133UAN01.0" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x615c , &delay_200_500_e50,"B116XAN06.1" ), +EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x635c , &delay_200_500_e50,"B116XAN06.3" ), +EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x639c , &delay_200_500_e50,"B140HAK02.7" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x8594 , &delay_200_500_e50,"B133UAN01.0" ), +EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0xf390 , &delay_200_500_e50,"B140XTN07.7" ), +EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x0715 , &delay_200_150_e200,"NT116WHM-N21" ), +EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x0731 , &delay_200_500_e80,"NT116WHM-N42" ), +EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x0741 , &delay_200_500_e200,"NT116WHM-N44" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x0786 , &delay_200_500_p2e80,"NV116WHM-T01" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x07d1 , &boe_nv133fhm_n61.delay,"NV133FHM-N61" ), +EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x07f6 , &delay_200_500_e200,"NT140FHM-N44" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x082d , &boe_nv133fhm_n61.delay,"NV133FHM-N62" ), +EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x08b2 , &delay_200_500_e200,"NT140WHM-N49" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x09c3 , &delay_200_500_e50,"NT116WHM-N21,836X2" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x094b , &delay_200_500_e50,"NT116WHM-N21" ), +EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x0951 , &delay_200_500_e80,"NV116WHM-N47" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x095f , &delay_200_500_e50,"NE135FBM-N41 v8.1" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x0979 , &delay_200_500_e50,"NV116WHM-N49 V8.0" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x098d , &boe_nv110wtm_n61.delay,"NV110WTM-N61" ), +EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x09ae , &delay_200_500_e200,"NT140FHM-N45" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x09dd , &delay_200_500_e50,"NT116WHM-N21" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x0a5d , &delay_200_500_e50,"NV116WHM-N45" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x0ac5 , &delay_200_500_e50,"NV116WHM-N4C" ), +EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x0b43 , &delay_200_500_e200,"NV140FHM-T09" ), +EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x0b56 , &delay_200_500_e80,"NT140FHM-N47" ), +EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x0c20 , &delay_200_500_e80,"NT140FHM-N47" ), +EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x1132 , &delay_200_500_e80_d50,"N116BGE-EA2" ), +EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x1138 , &innolux_n116bca_ea1.delay,"N116BCA-EA1-RC4" ),EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x1139 , &delay_200_500_e80_d50,"N116BGE-EA2" ), +EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x1145 , &delay_200_500_e80_d50,"N116BCN-EB1" ),EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x114c , &innolux_n116bca_ea1.delay,"N116BCA-EA1" ),EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x1152 , &delay_200_500_e80_d50,"N116BCN-EA1" ),EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x1153 , &delay_200_500_e80_d50,"N116BGE-EA2" ),EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x1154 , &delay_200_500_e80_d50,"N116BCA-EA2" ), +EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x1157 , &delay_200_500_e80_d50,"N116BGE-EA2" ), +EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x115b , &delay_200_500_e80_d50,"N116BCN-EB1" ),EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x1247 , &delay_200_500_e80_d50,"N120ACA-EA1" ), +EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x142b , &delay_200_500_e80_d50,"N140HCA-EAC" ), +EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x144f , &delay_200_500_e80_d50,"N140HGA-EA1" ), +EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x1468 , &delay_200_500_e80,"N140HGA-EA1" ), +EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x14e5 , &delay_200_500_e80_d50,"N140HGA-EA1" ),EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x14d4 , &delay_200_500_e80_d50,"N140HCA-EAC" ), +EDP_PANEL_ENTRY ('C' ,'M' ,'N' ,0x14d6 , &delay_200_500_e80_d50,"N140BGA-EA4" ), + +EDP_PANEL_ENTRY ('H' ,'K' ,'C' ,0x2d5c , &delay_200_500_e200,"MB116AN01-2" ), +EDP_PANEL_ENTRY ('I' ,'V' ,'O' ,0x048e , &delay_200_500_e200_d10,"M116NWR6 R5" ),EDP_PANEL_ENTRY ('I' ,'V' ,'O' ,0x057d , &delay_200_500_e200,"R140NWF5 RH" ),EDP_PANEL_ENTRY ('I' ,'V' ,'O' ,0x854a , &delay_200_500_p2e100,"M133NW4J" ),EDP_PANEL_ENTRY ('I' ,'V' ,'O' ,0x854b , &delay_200_500_p2e100,"R133NW4K-R0" ), +EDP_PANEL_ENTRY ('I' ,'V' ,'O' ,0x8c4d , &delay_200_150_e200,"R140NWFM R1" ),EDP_PANEL_ENTRY ('K' ,'D' ,'B' ,0x0624 , &kingdisplay_kd116n21_30nv_a010.delay,"116N21-30NV-A010" ), +EDP_PANEL_ENTRY ('K' ,'D' ,'C' ,0x0809 , &delay_200_500_e50,"KD116N2930A15" ),EDP_PANEL_ENTRY ('K' ,'D' ,'B' ,0x1120 , &delay_200_500_e80_d50,"116N29-30NK-C007" ), EDP_PANEL_ENTRY('S', 'H', 'P', 0x1511, &delay_200_500_e50, "LQ140M1JW48"),
Signature · 1 line
2.42.0.869.gea05f2083d-goog
Re: [PATCH v2 1/4] drm/panel-edp: Add several AUO/BOE panels
Hi,
Quoted 7 lines · Hsin-Yi Wang
Add a few generic edp panels used by mt8186 chromebooks. Besides, modify the following panel:
- AUO0x235cB116XTN02 renamed to B116XTN02.3.
- AUO0x405cB116XAK01 adjust the timing ofauo_b116xak01. According to the datasheet: T3=200, T12=500,T7_max= 50.
Quoted 6 lines
Signed-off-by Hsin-Yi Wang <[email protected]>---
v1->v2: Address comments: update delay forauo_b116xak01, sort entries.--- drivers/gpu/drm/panel/panel-edp.c | 57 +++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-)
This seems good to me now. I guess a tiny nit is that the ${SUBJECT} mentions AUO/BOE panels but a few other model panels are also added, but it's not a huge issue for me.
Normally I apply patches to this table near-instantly, but since it's Friday and this touches a lot of panels, I'll probably wait until sometime next week.
Re: [PATCH v2 1/4] drm/panel-edp: Add several AUO/BOE panels
Quoted 18 lines · Doug Anderson
Hi,
Quoted 7 lines · Hsin-Yi Wang
Add a few generic edp panels used by mt8186 chromebooks. Besides, modify the following panel:
- AUO0x235cB116XTN02 renamed to B116XTN02.3.
- AUO0x405cB116XAK01 adjust the timing ofauo_b116xak01. According to the datasheet: T3=200, T12=500,T7_max= 50.Quoted 6 lines
Signed-off-by Hsin-Yi Wang <[email protected]>---
v1->v2: Address comments: update delay forauo_b116xak01, sort entries.--- drivers/gpu/drm/panel/panel-edp.c | 57 +++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-)
Quoted 4 lines
This seems good to me now. I guess a tiny nit is that the ${SUBJECT} mentions AUO/BOE panels but a few other model panels are also added, but it's not a huge issue for me.
Yeah, it should be "drm/panel-edp: Add several generic edp panels", the same as v1. If there are more comments that I need to send a v3, I'll fix that in v3.
Quoted 5 lines
Normally I apply patches to this table near-instantly, but since it's Friday and this touches a lot of panels, I'll probably wait until sometime next week.
Reviewed-by Douglas Anderson <[email protected]>
PATCH v2 2/4 drm/panel-edp: Add override_edid_mode quirk for generic edp
In reply to Hsin-Yi WangGeneric edp gets mode from edid. However, some panels report incorrect mode in this way, resulting in glitches on panel. Introduce a new quirk additional_mode to the generic edid to pick a correct hardcoded mode.
---v1->v2: no change
--- drivers/gpu/drm/panel/panel-edp.c | 68 ++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 5 deletions(-)
drivers/gpu/drm/panel/panel-edp.c +63 -5
@@ -203,6 +203,9 @@ struct edp_panel_entry {/** @name: Name of this panel (for printing to logs). */ const char *name; + +/** @override_edid_mode: Override the mode obtained by edid. */ +const struct drm_display_mode *override_edid_mode; };struct panel_edp {
@@ -301,6 +304,25 @@ static unsigned int panel_edp_get_display_modes(struct panel_edp *panel,return num; } +static int panel_edp_override_edid_mode (struct panel_edp *panel, +struct drm_connector *connector, +const struct drm_display_mode *override_mode) +{ +struct drm_display_mode *mode; + + mode =drm_mode_duplicate (connector->dev, override_mode); +if (mode) { + mode->type |=DRM_MODE_TYPE_DRIVER |DRM_MODE_TYPE_PREFERRED ; +drm_mode_set_name (mode); +drm_mode_probed_add (connector, mode); +return 1 ; + } + +dev_err (panel->base.dev,"failed to add additional mode\n" ); + +return 0 ; +} +static int panel_edp_get_non_edid_modes (struct panel_edp *panel,struct drm_connector *connector) {
@@ -568,6 +590,9 @@ static int panel_edp_get_modes(struct drm_panel *panel, {struct panel_edp *p =to_panel_edp (panel);int num =0 ; +bool has_override_edid_mode = p->detected_panel && + p->detected_panel !=ERR_PTR (-EINVAL ) && + p->detected_panel->override_edid_mode;/* probe EDID if a DDC bus is available */ if (p->ddc) {
@@ -575,9 +600,18 @@ static int panel_edp_get_modes(struct drm_panel *panel,if (!p->edid) p->edid =drm_get_edid (connector, p->ddc); - -if (p->edid) - num +=drm_add_edid_modes (connector, p->edid); +if (p->edid) { +if (has_override_edid_mode) { +/* +* override_edid_mode is specified. Use +* override_edid_mode instead of from edid. +*/ + num +=panel_edp_override_edid_mode (p, connector, + p->detected_panel->override_edid_mode); + }else { + num +=drm_add_edid_modes (connector, p->edid); + } + }pm_runtime_mark_last_busy (panel->dev);pm_runtime_put_autosuspend (panel->dev);
@@ -950,6 +984,19 @@ static const struct panel_desc auo_b101ean01 = { }, }; +static const struct drm_display_mode auo_b116xa3_mode = { + .clock =70589 , + .hdisplay =1366 , + .hsync_start =1366 +40 , + .hsync_end =1366 +40 +40 , + .htotal =1366 +40 +40 +32 , + .vdisplay =768 , + .vsync_start =768 +10 , + .vsync_end =768 +10 +12 , + .vtotal =768 +10 +12 +6 , + .flags =DRM_MODE_FLAG_NVSYNC |DRM_MODE_FLAG_NHSYNC , +}; +static const struct drm_display_mode auo_b116xak01_mode = { .clock =69300 , .hdisplay =1366 ,
@@ -1878,6 +1925,15 @@ static const struct panel_delay delay_200_150_e200 = { .delay = _delay \ } +#define EDP_PANEL_ENTRY2 (vend_chr_0, vend_chr_1, vend_chr_2, product_id, _delay, _name, _mode) \ +{ \ + .name = _name, \ + .panel_id = drm_edid_encode_panel_id(vend_chr_0, vend_chr_1, vend_chr_2, \ + product_id), \ + .delay = _delay, \ + .override_edid_mode = _mode \ +} +/* * This table is used to figure out power sequencing delays for panels that * are detected by EDID. Entries here may point to entries in the
@@ -1895,9 +1951,11 @@ static const struct edp_panel_entry edp_panels[] = {EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x239b , &delay_200_500_e50,"B116XAN06.1" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x255c , &delay_200_500_e50,"B116XTN02.5" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x403d , &delay_200_500_e50,"B140HAN04.0" ), -EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x405c , &auo_b116xak01.delay,"B116XAK01.0" ), +EDP_PANEL_ENTRY2 ('A' ,'U' ,'O' ,0x405c , &auo_b116xak01.delay,"B116XAK01.0" , + &auo_b116xa3_mode),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x582d , &delay_200_500_e50,"B133UAN01.0" ), -EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x615c , &delay_200_500_e50,"B116XAN06.1" ), +EDP_PANEL_ENTRY2 ('A' ,'U' ,'O' ,0x615c , &delay_200_500_e50,"B116XAN06.1" , + &auo_b116xa3_mode),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x635c , &delay_200_500_e50,"B116XAN06.3" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x639c , &delay_200_500_e50,"B140HAK02.7" ), EDP_PANEL_ENTRY('A', 'U', 'O', 0x8594, &delay_200_500_e50, "B133UAN01.0"),
Signature · 1 line
2.42.0.869.gea05f2083d-goog
PATCH v2 3/4 drm/modes: Add a function to clear preferred modes
In reply to Hsin-Yi WangAdd a function to clear the preferred bit of a connector's existing modes. This is useful for edp panel to unset the preferred modes read from edid if the panel has hard-coded modes.
---v1->v2:
- fix doc string (reported by kernel test robot).
- split mode and panel patches.
--- drivers/gpu/drm/drm_modes.c | 16 ++++++++++++++++ include/drm/drm_modes.h | 1 + 2 files changed, 17 insertions(+)
drivers/gpu/drm/drm_modes.c +16 -0
@@ -1933,6 +1933,22 @@ void drm_connector_list_update(struct drm_connector *connector) }EXPORT_SYMBOL (drm_connector_list_update); +/** +* drm_mode_unset_preferred_modes - clear the preferred bit on existing modes. +* @connector: the connector to update +* +* Walk the mode list for connector, clearing the preferred status on existing +* modes. +*/ +void drm_mode_unset_preferred_modes (struct drm_connector *connector) +{ +struct drm_display_mode *cur_mode; + +list_for_each_entry (cur_mode, &connector->probed_modes, head) + cur_mode->type &= ~DRM_MODE_TYPE_PREFERRED ; +} +EXPORT_SYMBOL_GPL (drm_mode_unset_preferred_modes); +static int drm_mode_parse_cmdline_bpp (const char *str,char **end_ptr,struct drm_cmdline_mode *mode) {
include/drm/drm_modes.h +1 -0
@@ -560,6 +560,7 @@ void drm_mode_prune_invalid(struct drm_device *dev, struct list_head *mode_list, bool verbose);void drm_mode_sort (struct list_head *mode_list);void drm_connector_list_update (struct drm_connector *connector); +void drm_mode_unset_preferred_modes (struct drm_connector *connector);/* parsing cmdline modes */ bool
Signature · 1 line
2.42.0.869.gea05f2083d-goog
Re: [PATCH v2 3/4] drm/modes: Add a function to clear preferred modes
Hi,
Quoted 6 lines · Hsin-Yi Wang
Add a function to clear the preferred bit of a connector's existing modes. This is useful for edp panel to unset the preferred modes read from edid if the panel has hard-coded modes.
Signed-off-by Hsin-Yi Wang <[email protected]>
Quoted 8 lines
---
v1->v2:
- fix doc string (reported by kernel test robot).
- split mode and panel patches.--- drivers/gpu/drm/drm_modes.c | 16 ++++++++++++++++ include/drm/drm_modes.h | 1 + 2 files changed, 17 insertions(+)
This seems fine to me.
Since it introduces a new API to the core and Hsin-Yi and I work directly together, I'd probably give this ~2 weeks on the list before landing so there is adequate time for people to comment. That'll be right in the middle of Plumbers, though, so it might be more like 3 weeks. If someone non-ChromeOS wants to review and/or apply sooner, I certainly wouldn't object.
Maxime Ripard
maintainerRe: [PATCH v2 3/4] drm/modes: Add a function to clear preferred modes
Quoted 20 lines · Doug Anderson
Hi,
Quoted 6 lines · Hsin-Yi Wang
Add a function to clear the preferred bit of a connector's existing modes. This is useful for edp panel to unset the preferred modes read from edid if the panel has hard-coded modes.
Signed-off-by Hsin-Yi Wang <[email protected]>Quoted 8 lines
---
v1->v2:
- fix doc string (reported by kernel test robot).
- split mode and panel patches.--- drivers/gpu/drm/drm_modes.c | 16 ++++++++++++++++ include/drm/drm_modes.h | 1 + 2 files changed, 17 insertions(+)This seems fine to me.
Quoted 8 lines
Reviewed-by Douglas Anderson <[email protected]>Since it introduces a new API to the core and Hsin-Yi and I work directly together, I'd probably give this ~2 weeks on the list before landing so there is adequate time for people to comment. That'll be right in the middle of Plumbers, though, so it might be more like 3 weeks. If someone non-ChromeOS wants to review and/or apply sooner, I certainly wouldn't object.
FTR, I just made some review on v1 that still applies to that version.
Maxime
PATCH v2 4/4 drm/panel-edp: Choose correct preferred mode
In reply to Hsin-Yi WangIf a non generic edp-panel is under aux-bus, the mode read from edid would still be selected as preferred and results in multiple preferred modes, which is ambiguous.
If a hard-coded mode is present, unset the preferred bit of the modes read from edid.
---v1->v2: split patches from drm_modes.
--- drivers/gpu/drm/panel/panel-edp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-edp.c +5 -2
@@ -622,10 +622,13 @@ static int panel_edp_get_modes(struct drm_panel *panel,* and no modes (the generic edp-panel case) because it will clobber * the display_info that was already set by drm_add_edid_modes(). */ -if (p->desc->num_timings || p->desc->num_modes) +if (p->desc->num_timings || p->desc->num_modes) { +/* hard-coded modes present, unset preferred modes from edid. */ +drm_mode_unset_preferred_modes (connector); num +=panel_edp_get_non_edid_modes (p, connector); -else if (!num) + }else if (!num) {dev_warn (p->base.dev,"No display modes\n" ); + }/* * TODO: Remove once all drm drivers call
Signature · 1 line
2.42.0.869.gea05f2083d-goog
Re: [PATCH v2 4/4] drm/panel-edp: Choose correct preferred mode
Hi,
Quoted 8 lines · Hsin-Yi Wang
If a non generic edp-panel is under aux-bus, the mode read from edid would still be selected as preferred and results in multiple preferred modes, which is ambiguous.
If a hard-coded mode is present, unset the preferred bit of the modes read from edid.
Quoted 6 lines
Signed-off-by Hsin-Yi Wang <[email protected]>---
v1->v2: split patches fromdrm_modes.--- drivers/gpu/drm/panel/panel-edp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Do you think this should have a "Fixes?" As per discussion on V1 [1], this has probably been a bit broken from the beginning, though I guess it only became a big deal after the AUX bus made it so that the panel driver commonly had the EDID...
[1] https://lore.kernel.org/r/CAD=FV=WHzCdiYumsxUm_am+ALqq9SOOrjf=JYHqJuiKFB+Dnsw@mail.gmail.com
Re: [PATCH v2 4/4] drm/panel-edp: Choose correct preferred mode
Quoted 19 lines · Doug Anderson
Hi,
Quoted 8 lines · Hsin-Yi Wang
If a non generic edp-panel is under aux-bus, the mode read from edid would still be selected as preferred and results in multiple preferred modes, which is ambiguous.
If a hard-coded mode is present, unset the preferred bit of the modes read from edid.
Quoted 6 lines
Signed-off-by Hsin-Yi Wang <[email protected]>---
v1->v2: split patches fromdrm_modes.--- drivers/gpu/drm/panel/panel-edp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Quoted 7 lines
Reviewed-by Douglas Anderson <[email protected]>Do you think this should have a "Fixes?" As per discussion on V1 [1], this has probably been a bit broken from the beginning, though I guess it only became a big deal after the AUX bus made it so that the panel driver commonly had the EDID...
If this patch needs to apply Fixes, then the previous patch might also have to?