1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/gpu/drm/amd/display/amdgpu_dm
Rodrigo Siqueira ddab8bd788 drm/amd/display: Fix two cursor duplication when using overlay
Our driver supports overlay planes, and as expected, some userspace
compositor takes advantage of these features. If the userspace is not
enabling the cursor, they can use multiple planes as they please.
Nevertheless, we start to have constraints when userspace tries to
enable hardware cursor with various planes. Basically, we cannot draw
the cursor at the same size and position on two separated pipes since it
uses extra bandwidth and DML only run with one cursor.

For those reasons, when we enable hardware cursor and multiple planes,
our driver should accept variations like the ones described below:

  +-------------+   +--------------+
  | +---------+ |   |              |
  | |Primary  | |   | Primary      |
  | |         | |   | Overlay      |
  | +---------+ |   |              |
  |Overlay      |   |              |
  +-------------+   +--------------+

In this scenario, we can have the desktop UI in the overlay and some
other framebuffer attached to the primary plane (e.g., video). However,
userspace needs to obey some rules and avoid scenarios like the ones
described below (when enabling hw cursor):

                                      +--------+
                                      |Overlay |
 +-------------+    +-----+-------+ +-|        |--+
 | +--------+  | +--------+       | | +--------+  |
 | |Overlay |  | |Overlay |       | |             |
 | |        |  | |        |       | |             |
 | +--------+  | +--------+       | |             |
 | Primary     |    | Primary     | | Primary     |
 +-------------+    +-------------+ +-------------+

 +-------------+   +-------------+
 |     +--------+  |  Primary    |
 |     |Overlay |  |             |
 |     |        |  |             |
 |     +--------+  | +--------+  |
 | Primary     |   | |Overlay |  |
 +-------------+   +-|        |--+
                     +--------+

If the userspace violates some of the above scenarios, our driver needs
to reject the commit; otherwise, we can have unexpected behavior. Since
we don't have a proper driver validation for the above case, we can see
some problems like a duplicate cursor in applications that use multiple
planes. This commit fixes the cursor issue and others by adding adequate
verification for multiple planes.

Change since V1 (Harry and Sean):
- Remove cursor verification from the equation.

Cc: Louis Li <Ching-shih.Li@amd.com>
Cc: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Cc: Harry Wentland <Harry.Wentland@amd.com>
Cc: Hersen Wu <hersenxs.wu@amd.com>
Cc: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-05-10 18:06:43 -04:00
..
amdgpu_dm.c drm/amd/display: Fix two cursor duplication when using overlay 2021-05-10 18:06:43 -04:00
amdgpu_dm.h drm/amdgpu/display: add documentation for dmcub_trace_event_en 2021-05-10 18:06:42 -04:00
amdgpu_dm_color.c drm/amd/display/amdgpu_dm/amdgpu_dm_color: Demote a misuse and fix another kernel-doc header 2020-12-01 16:04:45 -05:00
amdgpu_dm_crc.c drm/amd/display: use MST downstream AUX to dump DPRX CRCs 2021-04-09 16:51:35 -04:00
amdgpu_dm_crc.h drm/amd/display: Use PSP TA to read out crc 2021-03-05 15:12:09 -05:00
amdgpu_dm_debugfs.c drm/amd/display: fix wrong statement in mst hpd debugfs 2021-04-28 23:35:50 -04:00
amdgpu_dm_debugfs.h drm/amd/display: Support crc on specific region 2021-03-05 15:11:47 -05:00
amdgpu_dm_hdcp.c drm/amd/display: update hdcp display using correct CP type. 2021-04-20 21:37:28 -04:00
amdgpu_dm_hdcp.h drm/amdgpu/display: remove hdcp_srm sysfs on device removal 2021-02-18 16:43:08 -05:00
amdgpu_dm_helpers.c drm/amd/display: add helper for enabling mst stream features 2021-04-20 21:42:53 -04:00
amdgpu_dm_irq.c drm/amd/display: Deallocate IRQ handlers on amdgpu_dm_irq_fini 2021-04-09 16:41:12 -04:00
amdgpu_dm_irq.h drm/amd/display: make amdgpu_dm_irq_handler static 2017-10-17 10:43:04 +10:00
amdgpu_dm_irq_params.h drm/amd/display: Support crc on specific region 2021-03-05 15:11:47 -05:00
amdgpu_dm_mst_types.c drm/amd/dc: Fix a missing check bug in dm_dp_mst_detect() 2021-04-23 17:19:22 -04:00
amdgpu_dm_mst_types.h drm/amdgpu/display: create fake mst encoders ahead of time (v4) 2020-07-14 15:11:07 -04:00
amdgpu_dm_pp_smu.c drm/amd/pm: make DAL communicate with SMU through unified interfaces 2021-04-09 16:42:37 -04:00
amdgpu_dm_services.c drm/amd/display: Decouple amdgpu_dm_trace from service 2020-10-26 13:33:59 -04:00
amdgpu_dm_trace.h drm/amd/display: Add refresh rate trace 2021-04-09 16:47:57 -04:00
Makefile drm/amd/display: Create amdgpu_dm_hdcp 2019-10-03 09:10:58 -05:00