drm/panel-edp: Allow querying the detected panel via sysfs
authorDouglas Anderson <dianders@chromium.org>
Tue, 25 Jan 2022 21:54:09 +0000 (13:54 -0800)
committerDouglas Anderson <dianders@chromium.org>
Tue, 1 Feb 2022 16:35:28 +0000 (08:35 -0800)
commit363c4c3811db330dee9ce27dd3cee6f590d44e4c
tree96642790306f34962580a133a9421a91eeb1a002
parentb5c84a9edcd418cd055becad6a22439e7c5e3bf8
drm/panel-edp: Allow querying the detected panel via sysfs

Recently we added generic "edp-panel"s probed by EDID. To support
panels in this way we look at the panel ID in the EDID and look up the
panel in a table that has power sequence timings. If we find a panel
that's not in the table we will still attempt to use it but we'll use
conservative timings. While it's likely that these conservative
timings will work for most nearly all panels, the performance of
turning the panel off and on suffers.

We'd like to be able to reliably detect the case that we're using the
hardcoded timings without relying on parsing dmesg. This allows us to
implement tests that ensure that no devices get shipped that are
relying on the conservative timings.

Let's add a new sysfs entry to panel devices. It will have one of:
* UNKNOWN - We tried to detect a panel but it wasn't in our table.
* HARDCODED - We're not using generic "edp-panel" probed by EDID.
* A panel name - This is the name of the panel from our table.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220125135406.1.I62322abf81dbc1a1b72392a093be0c767da9bf51@changeid
drivers/gpu/drm/panel/panel-edp.c