Skip to content

Commit 0b4aa85

Browse files
committed
drm/edid: Add support for quirks visible to DRM core and drivers
Add support for EDID based quirks which can be queried outside of the EDID parser iteself by DRM core and drivers. There are at least two such quirks applicable to all drivers: the DPCD register access probe quirk and the 128b/132b DPRX Lane Count Conversion quirk (see 3.5.2.16.3 in the v2.1a DP Standard). The latter quirk applies to panels with specific EDID panel names, support for defining a quirk this way will be added as a follow-up. v2: Reset global_quirks in drm_reset_display_info(). v3: (Jani) - Use one list for both the global and internal quirks. - Drop change for panel name specific quirks. - Add comment about the way quirks should be queried. Cc: Ville Syrjälä <[email protected]> Cc: Jani Nikula <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5281cbe commit 0b4aa85

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

drivers/gpu/drm/drm_edid.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static int oui(u8 first, u8 second, u8 third)
6868

6969
enum drm_edid_internal_quirk {
7070
/* First detailed mode wrong, use largest 60Hz mode */
71-
EDID_QUIRK_PREFER_LARGE_60,
71+
EDID_QUIRK_PREFER_LARGE_60 = DRM_EDID_QUIRK_NUM,
7272
/* Reported 135MHz pixel clock is too high, needs adjustment */
7373
EDID_QUIRK_135_CLOCK_TOO_HIGH,
7474
/* Prefer the largest mode at 75 Hz */
@@ -2959,6 +2959,12 @@ static bool drm_edid_has_internal_quirk(struct drm_connector *connector,
29592959
return connector->display_info.quirks & BIT(quirk);
29602960
}
29612961

2962+
bool drm_edid_has_quirk(struct drm_connector *connector, enum drm_edid_quirk quirk)
2963+
{
2964+
return connector->display_info.quirks & BIT(quirk);
2965+
}
2966+
EXPORT_SYMBOL(drm_edid_has_quirk);
2967+
29622968
#define MODE_SIZE(m) ((m)->hdisplay * (m)->vdisplay)
29632969
#define MODE_REFRESH_DIFF(c,t) (abs((c) - (t)))
29642970

include/drm/drm_connector.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,9 @@ struct drm_display_info {
843843
int vics_len;
844844

845845
/**
846-
* @quirks: EDID based quirks. Internal to EDID parsing.
846+
* @quirks: EDID based quirks. DRM core and drivers can query the
847+
* @drm_edid_quirk quirks using drm_edid_has_quirk(), the rest of
848+
* the quirks also tracked here are internal to EDID parsing.
847849
*/
848850
u32 quirks;
849851

include/drm/drm_edid.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ struct detailed_data_string {
109109
#define DRM_EDID_CVT_FLAGS_STANDARD_BLANKING (1 << 3)
110110
#define DRM_EDID_CVT_FLAGS_REDUCED_BLANKING (1 << 4)
111111

112+
enum drm_edid_quirk {
113+
DRM_EDID_QUIRK_NUM,
114+
};
115+
112116
struct detailed_data_monitor_range {
113117
u8 min_vfreq;
114118
u8 max_vfreq;
@@ -476,5 +480,6 @@ void drm_edid_print_product_id(struct drm_printer *p,
476480
u32 drm_edid_get_panel_id(const struct drm_edid *drm_edid);
477481
bool drm_edid_match(const struct drm_edid *drm_edid,
478482
const struct drm_edid_ident *ident);
483+
bool drm_edid_has_quirk(struct drm_connector *connector, enum drm_edid_quirk quirk);
479484

480485
#endif /* __DRM_EDID_H__ */

0 commit comments

Comments
 (0)