]> Git Repo - linux.git/log
linux.git
5 years agodrm/omap: dpi: Sort includes alphabetically
Laurent Pinchart [Wed, 26 Feb 2020 11:25:05 +0000 (13:25 +0200)]
drm/omap: dpi: Sort includes alphabetically

This makes it easier to quickly locate duplicate includes.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: hdmi5: Simplify EDID read
Laurent Pinchart [Wed, 26 Feb 2020 11:25:04 +0000 (13:25 +0200)]
drm/omap: hdmi5: Simplify EDID read

Now that the omap_dss_device EDID read operation has been removed,
simplify the bridge-based EDID access by merging multiple functions
together.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: hdmi4: Simplify EDID read
Laurent Pinchart [Wed, 26 Feb 2020 11:25:03 +0000 (13:25 +0200)]
drm/omap: hdmi4: Simplify EDID read

Now that the omap_dss_device EDID read operation has been removed,
simplify the bridge-based EDID access by merging multiple functions
together.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: venc: Remove omap_dss_device operations
Laurent Pinchart [Wed, 26 Feb 2020 11:25:02 +0000 (13:25 +0200)]
drm/omap: venc: Remove omap_dss_device operations

Now that the VENC output is driven fully through the drm_bridge API its
omap_dss_device operations are not used anymore. Remove them.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: hdmi: Remove omap_dss_device operations
Laurent Pinchart [Wed, 26 Feb 2020 11:25:01 +0000 (13:25 +0200)]
drm/omap: hdmi: Remove omap_dss_device operations

Now that the HDMI outputs are driven fully through the drm_bridge API
their omap_dss_device operations are not used anymore. Remove them.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: Remove HPD, detect and EDID omapdss operations
Laurent Pinchart [Wed, 26 Feb 2020 11:25:00 +0000 (13:25 +0200)]
drm/omap: Remove HPD, detect and EDID omapdss operations

Due to the removal of several omapdrm display drivers, the omapdss HPD,
detected and EDID operations are not used anymore. Remove them and all
related code.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: Switch the HDMI and VENC outputs to drm_bridge
Laurent Pinchart [Wed, 26 Feb 2020 11:24:59 +0000 (13:24 +0200)]
drm/omap: Switch the HDMI and VENC outputs to drm_bridge

The TPD12S015, OPA362 and analog and HDMI connectors are now supported
by DRM bridge drivers, and the omapdrm HDMI and VENC outputs can be
handled through the drm_bridge API. Switch the outputs to drm_bridge by
making the next bridge mandatory and removing the related
omapdrm-specific display drivers.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: Create connector for bridges
Laurent Pinchart [Wed, 26 Feb 2020 11:24:58 +0000 (13:24 +0200)]
drm/omap: Create connector for bridges

Use the drm_bridge_connector helper to create a connector for pipelines
that use drm_bridge. This allows splitting connector operations across
multiple bridges when necessary, instead of having the last bridge in
the chain creating the connector and handling all connector operations
internally.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: venc: Register a drm_bridge
Laurent Pinchart [Wed, 26 Feb 2020 11:24:57 +0000 (13:24 +0200)]
drm/omap: venc: Register a drm_bridge

In order to integrate with a chain of drm_bridge, the internal VENC
encoder has to expose the mode valid, fixup and set, the enable and
disable and the get modes operations through the drm_bridge API.
Register a bridge at initialisation time to do so.

Most of those operations are removed from the omap_dss_device as they
are now called through the drm_bridge API by the DRM atomic helpers. The
only exception is the .get_modes() operation that is still invoked
through the omap_dss_device-based pipeline.

For the time being make the next bridge in the chain optional as the
VENC output is still based on omap_dss_device. The create_connector
argument to the bridge attach function is also ignored for the same
reason. This will be changed later when removing the related
omapdrm-specific display drivers.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: dss: Remove .set_hdmi_mode() and .set_infoframe() operations
Laurent Pinchart [Wed, 26 Feb 2020 11:24:56 +0000 (13:24 +0200)]
drm/omap: dss: Remove .set_hdmi_mode() and .set_infoframe() operations

The omapdss_hdmi_ops .set_hdmi_mode() and .set_infoframe() operations
operations are not used anymore, remove them.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: hdmi4: Implement drm_bridge .hpd_notify() operation
Laurent Pinchart [Wed, 26 Feb 2020 11:24:55 +0000 (13:24 +0200)]
drm/omap: hdmi4: Implement drm_bridge .hpd_notify() operation

The HDMI4 encoder is transitioning to the drm_bridge API, implement the
last missing operation.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: hdmi5: Move mode set, enable and disable operations to bridge
Laurent Pinchart [Wed, 26 Feb 2020 11:24:54 +0000 (13:24 +0200)]
drm/omap: hdmi5: Move mode set, enable and disable operations to bridge

Move the omap_dss_device .set_timings(), .enable() and .disable()
operations to the drm_bridge functions. As the drm_bridge for the HDMI
encoder is unconditionally registered and attached, those operations
will be called at the appropriate time.

The omapdss device .set_infoframe() and .set_hdmi_mode() operations have
no equivalent in drm_bridge. Thir content is thus moved to the bridge
.enable() operation as the data they store is not needed before the HDMI
encoder gets enabled.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: hdmi4: Move mode set, enable and disable operations to bridge
Laurent Pinchart [Wed, 26 Feb 2020 11:24:53 +0000 (13:24 +0200)]
drm/omap: hdmi4: Move mode set, enable and disable operations to bridge

Move the omap_dss_device .set_timings(), .enable() and .disable()
operations to the drm_bridge functions. As the drm_bridge for the HDMI
encoder is unconditionally registered and attached, those operations
will be called at the appropriate time.

The omapdss device .set_infoframe() and .set_hdmi_mode() operations have
no equivalent in drm_bridge. Thir content is thus moved to the bridge
.enable() operation as the data they store is not needed before the HDMI
encoder gets enabled.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: hdmi5: Register a drm_bridge for EDID read
Laurent Pinchart [Wed, 26 Feb 2020 11:24:52 +0000 (13:24 +0200)]
drm/omap: hdmi5: Register a drm_bridge for EDID read

In order to integrate with a chain of drm_bridge, the internal HDMI5
encoder has to expose the EDID read operation through the drm_bridge
API. Register a bridge at initialisation time to do so.

For the time being make the next bridge in the chain optional as the
HDMI output is still based on omap_dss_device. The create_connector
argument to the bridge attach function is also ignored for the same
reason. This will be changed later when removing the related
omapdrm-specific display drivers.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: hdmi4: Register a drm_bridge for EDID read
Laurent Pinchart [Wed, 26 Feb 2020 11:24:51 +0000 (13:24 +0200)]
drm/omap: hdmi4: Register a drm_bridge for EDID read

In order to integrate with a chain of drm_bridge, the internal HDMI4
encoder has to expose the EDID read operation through the drm_bridge
API. Register a bridge at initialisation time to do so.

For the time being make the next bridge in the chain optional as the
HDMI output is still based on omap_dss_device. The create_connector
argument to the bridge attach function is also ignored for the same
reason. This will be changed later when removing the related
omapdrm-specific display drivers.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: hdmi5: Rework EDID read to isolate data read
Laurent Pinchart [Wed, 26 Feb 2020 11:24:50 +0000 (13:24 +0200)]
drm/omap: hdmi5: Rework EDID read to isolate data read

In preparation of adding DRM bridge support to the hdmi5 encoder code,
rework the EDID read to isolate data read.

The hdmi_read_edid() function is the main entry point. It performs all
initialisation steps required prior to reading the EDID (such as
ensuring the device is powered on), as well as corresponding cleanup
steps afterwards. EDID read itself is handled by hdmi_read_edid_data()
that calls the hdmi5_core_ddc_read() function to read individual blocks.

This new code architecture will allow reusing hdmi_read_edid() and
hdmi5_core_ddc_read() for the drm_bridge EDID read implementation, while
swapping out hdmi_read_edid_data() for the DRM drm_do_get_edid()
function.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: hdmi4: Rework EDID read to isolate data read
Laurent Pinchart [Wed, 26 Feb 2020 11:24:49 +0000 (13:24 +0200)]
drm/omap: hdmi4: Rework EDID read to isolate data read

In preparation of adding DRM bridge support to the hdmi4 encoder code,
rework the EDID read to isolate data read.

The hdmi_read_edid() function is the main entry point. It performs all
initialisation steps required prior to reading the EDID (such as
ensuring the device is powered on), as well as corresponding cleanup
steps afterwards. EDID read itself is handled by hdmi_read_edid_data()
that calls the hdmi4_core_ddc_read() function to read individual blocks.

This new code architecture will allow reusing hdmi_read_edid() and
hdmi4_core_ddc_read() for the drm_bridge EDID read implementation, while
swapping out hdmi_read_edid_data() for the DRM drm_do_get_edid()
function.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: hdmi: Allocate EDID in the .read_edid() operation
Laurent Pinchart [Wed, 26 Feb 2020 11:24:48 +0000 (13:24 +0200)]
drm/omap: hdmi: Allocate EDID in the .read_edid() operation

Bring the omapdss-specific .read_edid() operation in sync with the
drm_bridge .get_edid() operation to ease code reuse.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: dss: Make omap_dss_device_ops optional
Laurent Pinchart [Wed, 26 Feb 2020 11:24:47 +0000 (13:24 +0200)]
drm/omap: dss: Make omap_dss_device_ops optional

As part of the move to drm_bridge ops, the dssdev ops will become empty
for some of the internal encoders. Make them optional in the driver to
allow them to be removed completely, easing the transition.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: Add infrastructure to support drm_bridge local to DSS outputs
Laurent Pinchart [Wed, 26 Feb 2020 11:24:46 +0000 (13:24 +0200)]
drm/omap: Add infrastructure to support drm_bridge local to DSS outputs

In order to support drm_bridge-based pipeline, the internal HDMI
encoders will need to expose the EDID read operation through the
drm_bridge API, and thus to expose a drm_bridge instance corresponding
to the encoder. The HDMI encoders are however handled as omap_dss_device
instances, which conflicts with this requirement.

In order to move forward with the drm_bridge transition, add support for
creating drm_bridge instances local to DSS outputs. If a local bridge is
passed to the omapdss_device_init_output() function, it is used as the
first bridge in the chain, and the omap_dss_device.next_bridge field is
set to the next bridge for the use of the internal encoders' bridges.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: dss: Fix output next device lookup in DT
Laurent Pinchart [Wed, 26 Feb 2020 11:24:45 +0000 (13:24 +0200)]
drm/omap: dss: Fix output next device lookup in DT

The DSS core looks up the next device connected to an output by
traversing the OF graph. It currently hardcodes the local port number to
0, which breaks any output with a different port number (SDI on OMAP3
and any DPI output but the first one). Fix this by repurposing the
currently unused of_ports bitmask in omap_dss_device with an of_port
output port number, and use it to traverse the OF graph.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: Use the drm_panel_bridge API
Laurent Pinchart [Wed, 26 Feb 2020 11:24:44 +0000 (13:24 +0200)]
drm/omap: Use the drm_panel_bridge API

Replace the manual panel handling code by a drm_panel_bridge. This
simplifies the driver and allows all components in the display pipeline
to be treated as bridges, paving the way to generic connector handling.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: Factor out display type to connector type conversion
Laurent Pinchart [Wed, 26 Feb 2020 11:24:43 +0000 (13:24 +0200)]
drm/omap: Factor out display type to connector type conversion

Move the code that computes the DRM connector type for the
omapdss_device display type to a new omapdss_device_connector_type()
function for later reuse.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: Simplify HDMI mode and infoframe configuration
Laurent Pinchart [Wed, 26 Feb 2020 11:24:42 +0000 (13:24 +0200)]
drm/omap: Simplify HDMI mode and infoframe configuration

Remove the omap_connector_get_hdmi_mode() function as the HDMI mode can
be accessed directly from the connector's display info.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/omap: dss: Cleanup DSS ports on initialisation failure
Laurent Pinchart [Wed, 26 Feb 2020 11:24:41 +0000 (13:24 +0200)]
drm/omap: dss: Cleanup DSS ports on initialisation failure

When the DSS initialises its output DPI and SDI ports, failures don't
clean up previous successfully initialised ports. This can lead to
resource leak or memory corruption. Fix it.

Reported-by: Hans Verkuil <[email protected]>
Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm: Add helper to create a connector for a chain of bridges
Laurent Pinchart [Wed, 26 Feb 2020 11:24:40 +0000 (13:24 +0200)]
drm: Add helper to create a connector for a chain of bridges

Most bridge drivers create a DRM connector to model the connector at the
output of the bridge. This model is historical and has worked pretty
well so far, but causes several issues:

- It prevents supporting more complex display pipelines where DRM
connector operations are split over multiple components. For instance a
pipeline with a bridge connected to the DDC signals to read EDID data,
and another one connected to the HPD signal to detect connection and
disconnection, will not be possible to support through this model.

- It requires every bridge driver to implement similar connector
handling code, resulting in code duplication.

- It assumes that a bridge will either be wired to a connector or to
another bridge, but doesn't support bridges that can be used in both
positions very well (although there is some ad-hoc support for this in
the analogix_dp bridge driver).

In order to solve these issues, ownership of the connector needs to be
moved to the display controller driver.

To avoid code duplication in display controller drivers, add a new
helper to create and manage a DRM connector backed by a chain of
bridges. All connector operations are delegating to the appropriate
bridge in the chain.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: tfp410: Allow operation without drm_connector
Laurent Pinchart [Wed, 26 Feb 2020 11:24:39 +0000 (13:24 +0200)]
drm/bridge: tfp410: Allow operation without drm_connector

The tfp410 driver can operate as part of a pipeline where the
drm_connector is created by the display controller. Enable this mode of
operation by skipping creation of a drm_connector internally.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: tfp410: Replace manual connector handling with bridge
Laurent Pinchart [Wed, 26 Feb 2020 11:24:38 +0000 (13:24 +0200)]
drm/bridge: tfp410: Replace manual connector handling with bridge

Now that a driver is available for display connectors, replace the
manual connector handling code with usage of the DRM bridge API. The
tfp410 driver doesn't deal with the display connector directly anymore,
but still delegates drm_connector operations to the next bridge. This
brings us one step closer to having the tfp410 driver handling the
TFP410 only.

Signed-off-by: Laurent Pinchart <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: panel: Implement bridge connector operations
Laurent Pinchart [Wed, 26 Feb 2020 11:24:37 +0000 (13:24 +0200)]
drm/bridge: panel: Implement bridge connector operations

Implement the newly added bridge connector operations, allowing the
usage of drm_bridge_panel with drm_bridge_connector.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Reviewed-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: Add driver for the TI TPD12S015 HDMI level shifter
Laurent Pinchart [Wed, 26 Feb 2020 11:24:36 +0000 (13:24 +0200)]
drm/bridge: Add driver for the TI TPD12S015 HDMI level shifter

The TI TPD12S015 is an HDMI level shifter and ESD protector controlled
through GPIOs. Add a DRM bridge driver for the device.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: Add bridge driver for display connectors
Laurent Pinchart [Wed, 26 Feb 2020 11:24:35 +0000 (13:24 +0200)]
drm/bridge: Add bridge driver for display connectors

Display connectors are modelled in DT as a device node, but have so far
been handled manually in several bridge drivers. This resulted in
duplicate code in several bridge drivers, with slightly different (and
thus confusing) logics.

In order to fix this, implement a bridge driver for display connectors.
The driver centralises logic for the DVI, HDMI, VGAn composite and
S-video connectors and exposes corresponding bridge operations.

This driver in itself doesn't solve the issue completely, changes in
bridge and display controller drivers are needed to make use of the new
connector driver.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Maxime Ripard <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: simple-bridge: Add support for the TI OPA362
Laurent Pinchart [Wed, 26 Feb 2020 11:24:34 +0000 (13:24 +0200)]
drm/bridge: simple-bridge: Add support for the TI OPA362

The TI OPA362 is an analog video amplifier controlled through a GPIO. Add
support for it to the simple-bridge driver.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Andrzej Hajda <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Reviewed-by: Maxime Ripard <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: simple-bridge: Add support for enable GPIO
Laurent Pinchart [Wed, 26 Feb 2020 11:24:33 +0000 (13:24 +0200)]
drm/bridge: simple-bridge: Add support for enable GPIO

If an enable GPIO is declared in the firmware, assert it when enabling
the bridge and deassert it when disabling it.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Andrzej Hajda <[email protected]>
Reviewed-by: Stefan Agner <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Reviewed-by: Maxime Ripard <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: simple-bridge: Add support for non-VGA bridges
Laurent Pinchart [Wed, 26 Feb 2020 11:24:32 +0000 (13:24 +0200)]
drm/bridge: simple-bridge: Add support for non-VGA bridges

Create a new simple_bridge_info structure that stores information about
the bridge model, and store the bridge timings in there, along with the
connector type. Use that new structure for of_device_id data. This
enables support for non-VGA bridges.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Andrzej Hajda <[email protected]>
Reviewed-by: Stefan Agner <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Reviewed-by: Maxime Ripard <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: dumb-vga-dac: Rename driver to simple-bridge
Laurent Pinchart [Wed, 26 Feb 2020 11:24:31 +0000 (13:24 +0200)]
drm/bridge: dumb-vga-dac: Rename driver to simple-bridge

The dumb-vga-dac driver can support simple DRM bridges without being
limited to VGA DACs. Rename it to simple-bridge.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Andrzej Hajda <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: dumb-vga-dac: Rename internal symbols to simple-bridge
Laurent Pinchart [Wed, 26 Feb 2020 11:24:30 +0000 (13:24 +0200)]
drm/bridge: dumb-vga-dac: Rename internal symbols to simple-bridge

The dumb-vga-dac driver is a simple DRM bridge driver for simple VGA
DACs that don't require configuration. Other non-VGA bridges fall in a
similar category, and would benefit from a common driver. Prepare for
this by renaming the internal symbols from dumb-vga-dac to
simple-bridge.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Andrzej Hajda <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Reviewed-by: Maxime Ripard <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: Extend bridge API to disable connector creation
Laurent Pinchart [Wed, 26 Feb 2020 11:24:29 +0000 (13:24 +0200)]
drm/bridge: Extend bridge API to disable connector creation

Most bridge drivers create a DRM connector to model the connector at the
output of the bridge. This model is historical and has worked pretty
well so far, but causes several issues:

- It prevents supporting more complex display pipelines where DRM
connector operations are split over multiple components. For instance a
pipeline with a bridge connected to the DDC signals to read EDID data,
and another one connected to the HPD signal to detect connection and
disconnection, will not be possible to support through this model.

- It requires every bridge driver to implement similar connector
handling code, resulting in code duplication.

- It assumes that a bridge will either be wired to a connector or to
another bridge, but doesn't support bridges that can be used in both
positions very well (although there is some ad-hoc support for this in
the analogix_dp bridge driver).

In order to solve these issues, ownership of the connector should be
moved to the display controller driver (where it can be implemented
using helpers provided by the core).

Extend the bridge API to allow disabling connector creation in bridge
drivers as a first step towards the new model. The new flags argument to
the bridge .attach() operation allows instructing the bridge driver to
skip creating a connector. Unconditionally set the new flags argument to
0 for now to keep the existing behaviour, and modify all existing bridge
drivers to return an error when connector creation is not requested as
they don't support this feature yet.

The change is based on the following semantic patch, with manual review
and edits.

@ rule1 @
identifier funcs;
identifier fn;
@@
 struct drm_bridge_funcs funcs = {
  ...,
  .attach = fn
 };

@ depends on rule1 @
identifier rule1.fn;
identifier bridge;
statement S, S1;
@@
 int fn(
  struct drm_bridge *bridge
+ , enum drm_bridge_attach_flags flags
 )
 {
  ... when != S
+ if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
+ DRM_ERROR("Fix bridge driver to make connector optional!");
+ return -EINVAL;
+ }
+
  S1
  ...
 }

@ depends on rule1 @
identifier rule1.fn;
identifier bridge, flags;
expression E1, E2, E3;
@@
 int fn(
  struct drm_bridge *bridge,
  enum drm_bridge_attach_flags flags
 ) {
 <...
 drm_bridge_attach(E1, E2, E3
+ , flags
 )
 ...>
 }

@@
expression E1, E2, E3;
@@
 drm_bridge_attach(E1, E2, E3
+ , 0
 )

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: Add interlace_allowed flag to drm_bridge
Laurent Pinchart [Wed, 26 Feb 2020 11:24:28 +0000 (13:24 +0200)]
drm/bridge: Add interlace_allowed flag to drm_bridge

In preparation for a connector creation helper based on a chain of
bridges, add a flag to the drm_bridge structure to report support for
interlaced modes. This will be used to set the connector's
interlace_allowed flag.

Signed-off-by: Laurent Pinchart <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: Add connector-related bridge operations and data
Laurent Pinchart [Wed, 26 Feb 2020 11:24:27 +0000 (13:24 +0200)]
drm/bridge: Add connector-related bridge operations and data

To support implementation of DRM connectors on top of DRM bridges
instead of by bridges, the drm_bridge needs to expose new operations and
data:

- Output detection, hot-plug notification, mode retrieval and EDID
  retrieval operations
- Bitmask of supported operations
- Bridge output type
- I2C adapter for DDC access

Add and document these.

Three new bridge helper functions are also added to handle hot plug
notification in a way that is as transparent as possible for the
bridges.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Reviewed-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: Improve overview documentation
Laurent Pinchart [Wed, 26 Feb 2020 11:24:26 +0000 (13:24 +0200)]
drm/bridge: Improve overview documentation

Clean up the drm_bridge overview documentation, and expand the
operations documentation to provide more details on API usage.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: Fix atomic state ops documentation
Laurent Pinchart [Wed, 26 Feb 2020 11:24:25 +0000 (13:24 +0200)]
drm/bridge: Fix atomic state ops documentation

The drm_bridge_funcs atomic_state_duplicate and atomic_state_destroy
operations are erroneously documented as having a default implementation
if not implemented in bridge drivers. This isn't correct, fix the
documentation.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: Document the drm_encoder.bridge_chain field as private
Laurent Pinchart [Wed, 26 Feb 2020 11:24:24 +0000 (13:24 +0200)]
drm/bridge: Document the drm_encoder.bridge_chain field as private

The drm_encoder.bridge_chain is not meant to be touched manually by
drivers. Make this clear in the documentation.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/edid: Add flag to drm_display_info to identify HDMI sinks
Laurent Pinchart [Wed, 26 Feb 2020 11:24:23 +0000 (13:24 +0200)]
drm/edid: Add flag to drm_display_info to identify HDMI sinks

The drm_display_info structure contains many fields related to HDMI
sinks, but none that identifies if a sink compliant with CEA-861 (EDID)
shall be treated as an HDMI sink or a DVI sink. Add such a flag, and
populate it according to section 8.3.3 ("DVI/HDMI Device
Discrimination") of the HDMI v1.3 specification.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Andrzej Hajda <[email protected]>
Reviewed-by: Ville Syrjälä <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/connector: Add helper to get a connector type name
Laurent Pinchart [Wed, 26 Feb 2020 11:24:22 +0000 (13:24 +0200)]
drm/connector: Add helper to get a connector type name

drm_connector.c contains a map of connector types (DRM_MODE_CONNECTOR_*)
to name strings, but doesn't expose it. This leads to drivers having to
store a similar map.

Add a new drm_get_connector_type_name() helper function that return a
name string for a connector type.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Reviewed-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agovideo: hdmi: Change return type of hdmi_avi_infoframe_init() to void
Laurent Pinchart [Wed, 26 Feb 2020 11:24:21 +0000 (13:24 +0200)]
video: hdmi: Change return type of hdmi_avi_infoframe_init() to void

The hdmi_avi_infoframe_init() never needs to return an error, change its
return type to void.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Andrzej Hajda <[email protected]>
Acked-by: Bartlomiej Zolnierkiewicz <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Tested-by: Sebastian Reichel <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/panfrost: Add support for multiple power domains
Nicolas Boichat [Fri, 7 Feb 2020 05:26:25 +0000 (13:26 +0800)]
drm/panfrost: Add support for multiple power domains

When there is a single power domain per device, the core will
ensure the power domain is switched on (so it is technically
equivalent to having not power domain specified at all).

However, when there are multiple domains, as in MT8183 Bifrost
GPU, we need to handle them in driver code.

Signed-off-by: Nicolas Boichat <[email protected]>
Reviewed-by: Ulf Hansson <[email protected]>
Reviewed-by: Steven Price <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/panfrost: Add support for multiple regulators
Nicolas Boichat [Fri, 7 Feb 2020 05:26:24 +0000 (13:26 +0800)]
drm/panfrost: Add support for multiple regulators

Some GPUs, namely, the bifrost/g72 part on MT8183, have a second
regulator for their SRAM, let's add support for that.

We extend the framework in a generic manner so that we could
support more than 2 regulators, if required.

Signed-off-by: Nicolas Boichat <[email protected]>
Reviewed-by: Steven Price <[email protected]>
Reviwed-by: Mark Brown <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/panfrost: Improve error reporting in panfrost_gpu_power_on
Nicolas Boichat [Fri, 7 Feb 2020 05:26:23 +0000 (13:26 +0800)]
drm/panfrost: Improve error reporting in panfrost_gpu_power_on

It is useful to know which component cannot be powered on.

Signed-off-by: Nicolas Boichat <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Reviewed-by: Steven Price <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/i915: Update DRIVER_DATE to 20200225
Rodrigo Vivi [Tue, 25 Feb 2020 18:41:22 +0000 (10:41 -0800)]
drm/i915: Update DRIVER_DATE to 20200225

Signed-off-by: Rodrigo Vivi <[email protected]>
5 years agoMerge drm/drm-next into drm-intel-next-queued
Rodrigo Vivi [Tue, 25 Feb 2020 17:29:58 +0000 (09:29 -0800)]
Merge drm/drm-next into drm-intel-next-queued

Some DSI and VBT pending patches from Hans will apply
cleanly and with less ugly conflicts if they are rebuilt
on top of other patches that recently landed on drm-next.

Reference: https://patchwork.freedesktop.org/series/70952/
Cc: Hans de Goede <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]
5 years agodrm/amd/display: limit display clock to 100MHz to avoid FIFO error
Yu-ting Shen [Fri, 7 Feb 2020 07:19:31 +0000 (15:19 +0800)]
drm/amd/display: limit display clock to 100MHz to avoid FIFO error

[Why]
when changing display clock, SMU need to use power up DFS and use
DENTIST to ramp DFS DID to switch target frequency before switching back
to bypass.

[How]
fixed the minimum display clock to 100MHz, it's W/A the same with PCO.

Signed-off-by: Yu-ting Shen <[email protected]>
Reviewed-by: Tony Cheng <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Access patches from stream for ignore MSA monitor patch
Jaehyun Chung [Tue, 18 Feb 2020 23:01:19 +0000 (18:01 -0500)]
drm/amd/display: Access patches from stream for ignore MSA monitor patch

[Why]
System will crash when trying to access local sink in
core_link_enable_stream in MST case.

[How]
Access patches directly from stream.

Signed-off-by: Jaehyun Chung <[email protected]>
Reviewed-by: Aric Cyr <[email protected]>
Reviewed-by: Ashley Thomas <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Temporarily disable stutter on MPO transition
George Shen [Thu, 30 Jan 2020 20:57:36 +0000 (15:57 -0500)]
drm/amd/display: Temporarily disable stutter on MPO transition

[Why]
Underflow sometimes occurs during transition into MPO with stutter
enabled.

[How]
When transitioning into MPO, disable stutter. Re-enable stutter within
one frame.

Signed-off-by: George Shen <[email protected]>
Signed-off-by: Tony Cheng <[email protected]>
Reviewed-by: Eric Yang <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Make clock table struct more accessible
Sung Lee [Tue, 18 Feb 2020 20:53:28 +0000 (15:53 -0500)]
drm/amd/display: Make clock table struct more accessible

[WHY]
Currently clock table struct is very far down in the bounding box struct
making it hard to find while debugging, especially when using the
dal3dbgext.

[HOW]
Move it up so it is the first struct defined, and therefore much easier
to find and access.

Signed-off-by: Sung Lee <[email protected]>
Reviewed-by: Eric Yang <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: optimize prgoram wm and clks
Yongqiang Sun [Fri, 14 Feb 2020 17:55:55 +0000 (12:55 -0500)]
drm/amd/display: optimize prgoram wm and clks

[Why]
In some display configuration like 1080P monitor playing a 1080P video,
if user use ALT+F4 to exit Movie and TV, there is a chance clocks are
same only water mark changed. Current clock optimization machanism will
result in water mark keeps high after exit Movie and TV app.

[How]
Return if watermark need to be optimized when doing program watermark,
perform the optimization after.

Signed-off-by: Yongqiang Sun <[email protected]>
Reviewed-by: Tony Cheng <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: correct dml surface size assignment
Dmytro Laktyushkin [Wed, 11 Dec 2019 16:20:01 +0000 (11:20 -0500)]
drm/amd/display: correct dml surface size assignment

Need to assign surface size rather than viewport size for surface size
dml variable.

Signed-off-by: Dmytro Laktyushkin <[email protected]>
Reviewed-by: Eric Bernstein <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Update TTU properly
Alvin Lee [Thu, 13 Feb 2020 14:58:36 +0000 (09:58 -0500)]
drm/amd/display: Update TTU properly

[Why]
We need to update TTU properly if DRAMClockChangeWatermark changes. If
TTU < DRAMClockChangeWatermark, we pstate won't be allowed and we will
hang in some PSR cases.

[How]
Update TTU if DramClockChangeWatermark value increases (only if TTU was
dependent on the watermark value on the DRAMClockChangeWatermark value
in the first place).

Signed-off-by: Alvin Lee <[email protected]>
Reviewed-by: Jun Lei <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Fix RV2 Variant Detection
Michael Strauss [Thu, 13 Feb 2020 20:08:13 +0000 (15:08 -0500)]
drm/amd/display: Fix RV2 Variant Detection

[WHY]
RV2 and variants are indistinguishable by hw internal rev alone, need to
be distinguishable in order to correctly set max vlevel.  Previous
detection change incorrectly checked for hw internal rev.

[HOW]
Use pci revision to check if RV2 or low power variant Correct a few
overlapping ASICREV range checks

Signed-off-by: Michael Strauss <[email protected]>
Reviewed-by: Michael Strauss <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Add driver support for enabling PSR on DMCUB
Wyatt Wood [Wed, 12 Feb 2020 20:17:52 +0000 (15:17 -0500)]
drm/amd/display: Add driver support for enabling PSR on DMCUB

[Why]
We want to be able to enable PSR on DMCUB, and fallback to
DMCU when necessary.

[How]
Add infrastructure to enable and disable PSR on DMCUB.

Signed-off-by: Wyatt Wood <[email protected]>
Reviewed-by: Nicholas Kazlauskas <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: 3.2.74
Aric Cyr [Tue, 18 Feb 2020 15:29:03 +0000 (10:29 -0500)]
drm/amd/display: 3.2.74

Signed-off-by: Aric Cyr <[email protected]>
Reviewed-by: Aric Cyr <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: remove unused dml variable
Dmytro Laktyushkin [Mon, 16 Dec 2019 22:50:33 +0000 (17:50 -0500)]
drm/amd/display: remove unused dml variable

Signed-off-by: Dmytro Laktyushkin <[email protected]>
Reviewed-by: Eric Bernstein <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: update dml input population function
Dmytro Laktyushkin [Wed, 11 Dec 2019 20:16:28 +0000 (15:16 -0500)]
drm/amd/display: update dml input population function

Update dcn20_populate_dml_pipes_from_context to correctly handle odm
when no surface is provided.

Signed-off-by: Dmytro Laktyushkin <[email protected]>
Reviewed-by: Jun Lei <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Add visual confirm support for FreeSync 2 ARGB2101010
Peikang Zhang [Thu, 13 Feb 2020 21:05:23 +0000 (16:05 -0500)]
drm/amd/display: Add visual confirm support for FreeSync 2 ARGB2101010

[Why]
DalMPVisualConfirm does not support FreeSync 2 ARGB2101010 which causes
black visual confirm bar when playing HDR video on FreeSync 2 display in
full screen mode

[How]
Added pink color for DalMPVisualConfirm on FreeSync 2 ARGB2101010
surface

Signed-off-by: Peikang Zhang <[email protected]>
Reviewed-by: Anthony Koo <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Link training TPS1 workaround
Martin Leung [Wed, 12 Feb 2020 20:38:51 +0000 (15:38 -0500)]
drm/amd/display: Link training TPS1 workaround

[Why]
Previously implemented early_cr_pattern was link level but the whole
asic should be affected.

[How]
 - change old link flag to dc level
 - new bit in dc->work_arounds set by DM

Signed-off-by: Martin Leung <[email protected]>
Reviewed-by: Joshua Aberback <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Monitor patch to delay setting ignore MSA bit
Jaehyun Chung [Tue, 11 Feb 2020 16:19:41 +0000 (11:19 -0500)]
drm/amd/display: Monitor patch to delay setting ignore MSA bit

[Why]
Some displays clear ignore MSA bit on mode change, which cause
blackscreen when programming variable vtotals. Ignore MSA bit needs
programming needs to be delayed or re-set to be retained.

[How]
Create patch to delay programming ignore MSA bit after unblanking
stream.

Signed-off-by: Jaehyun Chung <[email protected]>
Reviewed-by: Aric Cyr <[email protected]>
Acked-by: Anthony Koo <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Workaround required for link training reliability
David Galiffi [Wed, 29 Jan 2020 22:02:32 +0000 (17:02 -0500)]
drm/amd/display: Workaround required for link training reliability

[Why]
A software workaround is required for all vendor-built cards on platform.

[How]
When performing DP link training, we must send TPS1 before DPCD:100h is
written with the proper bit rate value. This change must be applies in
ALL cases when LT happens.

Signed-off-by: David Galiffi <[email protected]>
Reviewed-by: Tony Cheng <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Revert "DCN2.x Do not program DPPCLK if same value"
Sung Lee [Wed, 12 Feb 2020 15:29:48 +0000 (10:29 -0500)]
drm/amd/display: Revert "DCN2.x Do not program DPPCLK if same value"

[WHY]
Not programming dto with same values causes test failures in DCN2 diags
DPP tests.

[HOW]
This reverts commit 1b53e733238c0f7faa4744ec7c8c6f193649f168.

Signed-off-by: Sung Lee <[email protected]>
Reviewed-by: Yongqiang Sun <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Add DMUB firmware state debugfs
Nicholas Kazlauskas [Tue, 11 Feb 2020 14:48:18 +0000 (09:48 -0500)]
drm/amd/display: Add DMUB firmware state debugfs

[Why]
Firmware state helps to debug sequence issues and hangs for DMCUB
commands and we don't have an easy mechanism to dump it from the driver.

[How]
Add a debugfs entry to dump the current firmware state.
Example usage:

cat /sys/kernel/debug/dri/0/amdgpu_dm_dmub_fw_state

Signed-off-by: Nicholas Kazlauskas <[email protected]>
Reviewed-by: Hersen Wu <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: programming last delta in output transfer function LUT to a correct...
Vladimir Stempen [Mon, 27 Jan 2020 18:07:45 +0000 (13:07 -0500)]
drm/amd/display: programming last delta in output transfer function LUT to a correct value

[Why]
Currently DAL programs negative slope for the last point of output
transfer function curve.

[How]
Applying a check for the last PWL point for RGB values not to be
smaller than previous. If smaller, initialize the last point values
to a sum of previous PWL value and previous PWL delta;

Signed-off-by: Vladimir Stempen <[email protected]>
Reviewed-by: Tony Cheng <[email protected]>
Acked-by: Jun Lei <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: make some rn_clk_mgr structs and funcs static
Anthony Koo [Thu, 6 Feb 2020 02:01:56 +0000 (21:01 -0500)]
drm/amd/display: make some rn_clk_mgr structs and funcs static

[Why]
There are some structures and functions meant only to be used in the
scope of that single rn_clk_mgr c file.

[How]
Make structs and funcs static if only meant to be used within
rn_clk_mgr

Signed-off-by: Anthony Koo <[email protected]>
Reviewed-by: Aric Cyr <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Add function pointers for panel related hw functions
Anthony Koo [Thu, 6 Feb 2020 01:47:41 +0000 (20:47 -0500)]
drm/amd/display: Add function pointers for panel related hw functions

[Why]
Make panel backlight and power on/off functions into
hardware specific function pointers

[How]
Add function pointers for panel related hw functions
 - is_panel_powered_on
 - is_panel_backlight_on

Signed-off-by: Anthony Koo <[email protected]>
Reviewed-by: Aric Cyr <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Fix HDMI repeater authentication
Bhawanpreet Lakha [Fri, 7 Feb 2020 16:02:26 +0000 (11:02 -0500)]
drm/amd/display: Fix HDMI repeater authentication

when the rxstatus split was done the index was incorrect. This
lead to HDMI repeater authentication failure for HDCP2.X So fix it

Fixes: 302169003733 ("drm/amd/display: split rxstatus for hdmi and dp")
Signed-off-by: Bhawanpreet Lakha <[email protected]>
Reviewed-by: Wenjing Liu <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: 3.2.73
Aric Cyr [Mon, 10 Feb 2020 02:06:00 +0000 (21:06 -0500)]
drm/amd/display: 3.2.73

Signed-off-by: Aric Cyr <[email protected]>
Reviewed-by: Aric Cyr <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Only round InfoFrame refresh rates
Aric Cyr [Sun, 9 Feb 2020 17:31:25 +0000 (12:31 -0500)]
drm/amd/display: Only round InfoFrame refresh rates

[Why]
When calculating nominal refresh rates, don't round.
Only the VSIF needs to be rounded.

[How]
Revert rounding change for nominal and just round when forming the
FreeSync VSIF.

Signed-off-by: Aric Cyr <[email protected]>
Reviewed-by: Anthony Koo <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: System crashes when add_ptb_to_table() gets called
Peikang Zhang [Fri, 7 Feb 2020 21:53:28 +0000 (16:53 -0500)]
drm/amd/display: System crashes when add_ptb_to_table() gets called

[Why]
Unused VMIDs were not evicted correctly

[How]
1. evict_vmids() logic was fixed;
2. Added boundary check for add_ptb_to_table() and
   clear_entry_from_vmid_table() to avoid crash caused by array out of
   boundary;
3. For mod_vmid_get_for_ptb(), vimd is changed from unsigned to signed
   due to vimd is signed.

Signed-off-by: Peikang Zhang <[email protected]>
Reviewed-by: Aric Cyr <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: do not force UCLK DPM to stay at highest state during display off...
Samson Tam [Tue, 4 Feb 2020 19:26:30 +0000 (14:26 -0500)]
drm/amd/display: do not force UCLK DPM to stay at highest state during display off in DCN2

[Why]
Add optimization to allow pstate change support when all displays
are off in DCN2.

[How]
Add clk_mgr_helper_get_active_plane_cnt() to sum plane_count for all
valid stream_status[].  If plane_count is 0, then there are no active
or virtual streams present. Use plane_count == 0 as extra condition to
enable p_state_change_support in dcn2_update_clocks().

Signed-off-by: Samson Tam <[email protected]>
Reviewed-by: Jun Lei <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Add dmcu f/w loading for NV12
Roman Li [Wed, 5 Feb 2020 14:39:41 +0000 (09:39 -0500)]
drm/amd/display: Add dmcu f/w loading for NV12

[Why]
We need DMCU for features like PSR and ABM.

[How]
Add path to dmcu firmware binary and load it for Navi12.

Signed-off-by: Roman Li <[email protected]>
Reviewed-by: Hersen Wu <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Don't ask PSP to load DMCUB for backdoor load
Nicholas Kazlauskas [Tue, 28 Jan 2020 20:14:07 +0000 (15:14 -0500)]
drm/amd/display: Don't ask PSP to load DMCUB for backdoor load

[Why]
If we're doing backdoor load then do it entirely ourselves without
invoking any of the frontdoor path to avoid potential issues with
outdated tOS.

[How]
Check the load type and don't pass it to base if we don't want it
loaded.

Signed-off-by: Nicholas Kazlauskas <[email protected]>
Reviewed-by: Hersen Wu <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Wait for DMCUB to finish loading before executing commands
Nicholas Kazlauskas [Tue, 28 Jan 2020 20:15:10 +0000 (15:15 -0500)]
drm/amd/display: Wait for DMCUB to finish loading before executing commands

[Why]
When we execute the first command for ASIC_INIT for command table
offloading we can hit a timing scenario such that the interrupts
for the inbox wptr haven't been enabled yet and the first command
is ignored until the second command is sent.

[How]
This happens when either the SCRATCH0 is already the correct status
code or autoload check is unsupported.

Clear SCRATCH0 during reset.

Also ensure that we don't accidentally reset the ASIC again in case
of a hang by clearing GPINT while we're at it.

Signed-off-by: Nicholas Kazlauskas <[email protected]>
Reviewed-by: Chris Park <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Disable PG on NV12
Alvin Lee [Tue, 4 Feb 2020 20:19:21 +0000 (15:19 -0500)]
drm/amd/display: Disable PG on NV12

[Why]
According to HW team, PG is dropped for NV12, but programming
the registers will still cause power to be consumed, so don't
program for NV12.

[How]
Set function pointer to NULL if NV12

Signed-off-by: Alvin Lee <[email protected]>
Reviewed-by: Jun Lei <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: DMUB Firmware Load by PSP
Hersen Wu [Wed, 5 Feb 2020 22:48:39 +0000 (17:48 -0500)]
drm/amd/display: DMUB Firmware Load by PSP

Signed-off-by: Hersen Wu <[email protected]>
Signed-off-by: Jerry (Fangzhi) Zuo <[email protected]>
Reviewed-by: Hersen Wu <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: dmub back door load
Hersen Wu [Wed, 5 Feb 2020 19:58:53 +0000 (14:58 -0500)]
drm/amd/display: dmub back door load

Signed-off-by: Hersen Wu <[email protected]>
Signed-off-by: Jerry (Fangzhi) Zuo <[email protected]>
Reviewed-by: Hersen Wu <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Update TX masks correctly
Alvin Lee [Wed, 22 Jan 2020 19:56:35 +0000 (14:56 -0500)]
drm/amd/display: Update TX masks correctly

[Why]
Bugs occur when TX interrupt comes in when no USB-C on board.

[How]
Check PHY for USB-C before enabling TX interrupt in DMCU FW.

Signed-off-by: Alvin Lee <[email protected]>
Reviewed-by: Jun Lei <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: update scaling filters
Dmytro Laktyushkin [Wed, 29 Jan 2020 21:41:20 +0000 (16:41 -0500)]
drm/amd/display: update scaling filters

Currently there is a minor error in scaling filter coefficients
caused by truncation to fit the HW registers.This error accummulates
with increased taps, but has gone unnoticed due to vast majority of
scaling being done with only 4 taps.

Scaling filters are now updated using HW team's filter generator
which has quantization error minimization built in.

Signed-off-by: Dmytro Laktyushkin <[email protected]>
Reviewed-by: Jun Lei <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: dal_ddc_i2c_payloads_create can fail causing panic
Aric Cyr [Thu, 30 Jan 2020 19:46:53 +0000 (14:46 -0500)]
drm/amd/display: dal_ddc_i2c_payloads_create can fail causing panic

[Why]
Since the i2c payload allocation can fail need to check return codes

[How]
Clean up i2c payload allocations and check for errors

Signed-off-by: Aric Cyr <[email protected]>
Reviewed-by: Joshua Aberback <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amd/display: Add aconnector condition check for dpcd read
Zhan Liu [Fri, 21 Feb 2020 22:25:47 +0000 (17:25 -0500)]
drm/amd/display: Add aconnector condition check for dpcd read

[Why]
core_link_read_dpcd() will invoke dm_helpers_dp_read_dpcd(),
which needs to read dpcd info with the help of aconnector.
If aconnector (dc->links[i]->prev) is NULL, then dpcd status
 cannot be read.

As a result, dpcd read fails and a line of error will be
printed out in dmesg.log as:
"*ERROR* Failed to found connector for link!"

[How]
Make sure that aconnector (dc->links[i]->prev) is not NULL,
then read dpcd status.

Signed-off-by: Zhan Liu <[email protected]>
Reviewed-by: Joseph Gravenor <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amdgpu: Improve Vega20 XGMI TLB flush workaround
Felix Kuehling [Sat, 18 Jan 2020 01:29:13 +0000 (20:29 -0500)]
drm/amdgpu: Improve Vega20 XGMI TLB flush workaround

Using a heavy-weight TLB flush once is not sufficient. Concurrent
memory accesses in the same TLB cache line can re-populate TLB entries
from stale texture cache (TC) entries while the heavy-weight TLB
flush is in progress. To fix this race condition, perform another TLB
flush after the heavy-weight one, when TC is known to be clean.

Move the workaround into the low-level TLB flushing functions. This way
they apply to amdgpu as well, and KIQ-based TLB flush only needs to
synchronize once.

Signed-off-by: Felix Kuehling <[email protected]>
Acked-by: Christian König <[email protected]>
Reviewed-by: shaoyun liu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amdgpu: fix psp ucode not loaded in bare-metal
Monk Liu [Fri, 21 Feb 2020 06:54:29 +0000 (14:54 +0800)]
drm/amdgpu: fix psp ucode not loaded in bare-metal

for bare-metal we alawys need to load sys/sos/kdb

Signed-off-by: Monk Liu <[email protected]>
Reviewed-by: Evan Quan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agoamdgpu/gmc_v9: save/restore sdpif regs during S3
Shirish S [Mon, 27 Jan 2020 11:05:24 +0000 (16:35 +0530)]
amdgpu/gmc_v9: save/restore sdpif regs during S3

fixes S3 issue with IOMMU + S/G  enabled @ 64M VRAM.

Suggested-by: Alex Deucher <[email protected]>
Signed-off-by: Shirish S <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amdgpu/discovery: make the discovery code less chatty
Alex Deucher [Wed, 19 Feb 2020 18:46:27 +0000 (13:46 -0500)]
drm/amdgpu/discovery: make the discovery code less chatty

Make the IP block base output debug only.

Reviewed-by: Xiaojie Yuan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amdgpu: fix colliding of preemption
Monk Liu [Thu, 6 Feb 2020 15:55:58 +0000 (23:55 +0800)]
drm/amdgpu: fix colliding of preemption

what:
some os preemption path is messed up with world switch preemption

fix:
cleanup those logics so os preemption not mixed with world switch

this patch is a general fix for issues comes from SRIOV MCBP, but
there is still UMD side issues not resovlved yet, so this patch
cannot fix all world switch bug.

Signed-off-by: Monk Liu <[email protected]>
Acked-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amdgpu: fix memory leak during TDR test(v2)
Monk Liu [Sat, 8 Feb 2020 11:01:21 +0000 (19:01 +0800)]
drm/amdgpu: fix memory leak during TDR test(v2)

fix system memory leak

v2:
fix coding style

Signed-off-by: Monk Liu <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/amdgpu: cleanup some incorrect reg access for SRIOV
Monk Liu [Thu, 23 Jan 2020 09:25:38 +0000 (17:25 +0800)]
drm/amdgpu: cleanup some incorrect reg access for SRIOV

1)
we shouldn't load PSP kdb and sys/sos for VF, they are
supposed to be handled by hypervisor

2)
ih reroute doesn't work on VF thus we should avoid calling
it, besides VF should not use those PSP register sets for PF

3)
shouldn't load SMU ucode under SRIOV, otherwise PSP would report
error

Signed-off-by: Monk Liu <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 years agodrm/i915: Drop assertion that active->fence is unchanged
Chris Wilson [Tue, 25 Feb 2020 08:22:23 +0000 (08:22 +0000)]
drm/i915: Drop assertion that active->fence is unchanged

We cannot assert the fence is not yet changed as the next thread may
change it prior to acquiring our lock.

Signed-off-by: Chris Wilson <[email protected]>
Reviewed-by: Matthew Auld <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/i915/gem: Cleanup shadow batch after I915_EXEC_SECURE
Chris Wilson [Tue, 25 Feb 2020 08:22:26 +0000 (08:22 +0000)]
drm/i915/gem: Cleanup shadow batch after I915_EXEC_SECURE

Tidy up after a call to eb_parse() if a later bind fails.

Closes: https://gitlab.freedesktop.org/drm/intel/issues/1312
Signed-off-by: Chris Wilson <[email protected]>
Reviewed-by: Matthew Auld <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: panel: Propagate bus format/flags
Boris Brezillon [Tue, 28 Jan 2020 13:55:12 +0000 (14:55 +0100)]
drm/bridge: panel: Propagate bus format/flags

Propagate bus format/flags so that the previous bridge element in the
chain knows which input format the panel bridge expects.

v11:
* Fix a typo in the subject
* Update the commit message so it's readable by itself

v10:
* Add changelog to the commit message

v8 -> v9:
* No changes

v7:
* Set atomic state hooks explicitly

v4 -> v6:
* Not part of the series

v3:
* Adjust things to match the new bus-format negotiation approach
* Use drm_atomic_helper_bridge_propagate_bus_fmt
* Don't implement ->atomic_check() (the core now takes care of bus
  flags propagation)

v2:
* Adjust things to match the new bus-format negotiation approach

Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: lvds-codec: Constify the drm_bridge_funcs structure
Laurent Pinchart [Mon, 24 Feb 2020 23:00:56 +0000 (01:00 +0200)]
drm/bridge: lvds-codec: Constify the drm_bridge_funcs structure

The drm_bridge_funcs structure is never modified, make it const. Making
it read-only can improve security as the structure contains function
pointers.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/bridge: lvds-codec: Add to_lvds_codec() function
Laurent Pinchart [Mon, 24 Feb 2020 22:56:45 +0000 (00:56 +0200)]
drm/bridge: lvds-codec: Add to_lvds_codec() function

Factor out the manual container_of() uses to a common to_lvds_codec()
macro to shorten lines (and provide better type safety, although that
won't matter much in this case).

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agodrm/virtio: enqueue virtio_gpu_create_context after the first 3D ioctl
Gurchetan Singh [Tue, 25 Feb 2020 00:08:00 +0000 (16:08 -0800)]
drm/virtio: enqueue virtio_gpu_create_context after the first 3D ioctl

For old userspace, initialization will still be implicit.

For backwards compatibility, enqueue virtio_gpu_cmd_context_create after
the first 3D ioctl.

v3: staticify virtio_gpu_create_context
    remove notify to batch vm-exit
v6: Remove nested 3D checks (emil.velikov):
      - unify 3D check in resource create
v7: Remove check when getting capabilities

Reviewed-by: Chia-I Wu <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Gurchetan Singh <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
5 years agodrm/virtio: track whether or not a context has been initiated
Gurchetan Singh [Tue, 25 Feb 2020 00:07:59 +0000 (16:07 -0800)]
drm/virtio: track whether or not a context has been initiated

Use an boolean variable to track whether a context has been
initiated.

v5: Fix possible race and sleep via mutex (olv)

Reviewed-by: Chia-I Wu <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Gurchetan Singh <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
This page took 0.118577 seconds and 4 git commands to generate.