]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: Refactor CRTC interrupt toggling logic
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Fri, 5 Apr 2019 13:35:14 +0000 (09:35 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 29 Apr 2019 19:58:08 +0000 (14:58 -0500)
commitd04c1a5110b0f7ab42c895af69053dbbb57854fb
tree810a108d804f082eb8c93513d1209eaeaeb1b5e5
parent64a074ceb0b01f14f610188e3ee36c779f90a18c
drm/amd/display: Refactor CRTC interrupt toggling logic

[Why]
The vblank and pageflip interrupts should only be enabled for a CRTC
that's enabled and has active planes.

The current logic takes care of this, but isn't setup to handle the case
where the active plane count goes to zero but the stream remains
enabled.

We currently block this case since we don't allow commits that enable a
CRTC with no active planes, but shouldn't be any reason we can't support
this from a hardware perspective and many userspace applications expect
to be able to do it (like IGT).

[How]
The count_crtc_active_planes function fills in the number of
"active_planes" on the dm_crtc_state. This should be the same as
DC's plane_count on the stream_status but easier to access since we
don't need to lock the private atomic state with the DC context.

Add the "interrupts_enabled" flag to the dm_crtc_state and set it based
on whether the stream exists and if there are active planes on the
stream.

Update the disable and enable logic to make use of this new flag.

There shouldn't be any functional change (yet) with this patch.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: David Francis <David.Francis@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h