]> git.baikalelectronics.ru Git - kernel.git/commit
drm: bridge: ti-sn65dsi83: Retrieve output format from bridge state
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 21 Jun 2021 12:55:17 +0000 (15:55 +0300)
committerRobert Foss <robert.foss@linaro.org>
Tue, 22 Jun 2021 08:15:56 +0000 (10:15 +0200)
commit59e589cae37c49ca05d90130efa56ca42443efd5
treeee0193e2ee8fe96c84cb2709252c5d5fc13e3b4e
parent8ecbf21c01e2eeca13381a715e874592c0617189
drm: bridge: ti-sn65dsi83: Retrieve output format from bridge state

The driver currently iterates over all connectors to get the bus format,
used to configure the LVDS output format. This causes several issues:

- If other connectors than the LVDS output are present, the format used
  by the driver may end up belonging to an entirely different output.

- The code can crash if some connectors are not connected, as bus_format
  may then be NULL.

- There's no guarantee that the bus format on the connector at the
  output of the pipeline matches the output of the sn65dsi83, as there
  may be other bridges in the pipeline.

Solve this by retrieving the format from the bridge state instead, which
provides the format corresponding to the output of the bridge.

The struct sn65dsi83 lvds_format_24bpp and lvds_format_jeida fields are
moved to local variables in sn65dsi83_atomic_enable() as they're now
used in that function only.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210621125518.13715-5-laurent.pinchart@ideasonboard.com
drivers/gpu/drm/bridge/ti-sn65dsi83.c