Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vc4-kms commits backported #3138

Merged
merged 6 commits into from
Aug 9, 2019
Merged

Conversation

6by9
Copy link
Contributor

@6by9 6by9 commented Aug 8, 2019

Backporting a couple of commits from 5.0 so that the vc4-kms driver actually abides by the source rectangle specified on a plane.
Using the dtoverlay=vc4-kms-kippah-7inch just works on a Pi3, but dual screen in X doesn't allow you to move the displays around due to this issue.

drm/vc4: Use drm_atomic_helper_check_plane_state() to simplify the logic required minor conflict resolution as the margins backport had touched the same code.

anholt and others added 6 commits August 8, 2019 16:29
Y_OFFSET field starts at bit 8 not 7.

Signed-off-by: Eric Anholt <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
This is needed to support X/Y negative placement of planes using
T-format buffers.

Signed-off-by: Eric Anholt <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
drm_atomic_helper_check_plane_state() takes care of checking the
scaling capabilities and calculating the clipped X/Y offsets for us.

Rely on this function instead of open-coding the logic.

Incidentally, it seems to fix a problem we had with negative X/Y
positioning of YUV planes.

Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
The offset adjustment depends on the framebuffer modified, so let's
just move this operation in the DRM_FORMAT_MOD_LINEAR case inside
vc4_plane_mode_set().

This we'll be able to fix offset calculation for
DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED and DRM_FORMAT_MOD_BROADCOM_SANDXXX.

Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
X/Y positioning of T-format buffers is quite tricky and the current
implementation was failing to position a plane using this format
correctly when the CRTC X, Y or both X and Y offsets were negative.
It was also failing when the SRC X/Y offsets were != 0.

Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
vc4_plane_atomic_async_update() calls vc4_plane_atomic_check()
which in turn calls vc4_plane_setup_clipping_and_scaling(), and since
commit 58a6a36 ("drm/vc4: Use
drm_atomic_helper_check_plane_state() to simplify the logic"), this
function accesses plane_state->state which will be NULL when called
from the async update path because we're passing the current plane
state, and plane_state->state has been assigned to NULL in
drm_atomic_helper_swap_state().

Pass the new state instead of the current one (the new state has
->state set to a non-NULL value).

Fixes: 58a6a36 ("drm/vc4: Use drm_atomic_helper_check_plane_state() to simplify the logic")
Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
@popcornmix popcornmix merged commit f1c1b67 into raspberrypi:rpi-4.19.y Aug 9, 2019
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Aug 9, 2019
kernel: net: bcmgenet: Workaround #2 for Pi4 Ethernet fail
See: raspberrypi/linux#3108

kernel: drm/vc4: Add missing NULL check to vc4_crtc_consume_event

kernel: vc4-kms commits backported
See: raspberrypi/linux#3138

firmware: AWB: Allow user to set manual gains for the RPi algorithm

firmware: arm_loader: Fix disabling of audio before reboot

firmware: fixed up the custom CVT values to use correct group
firmware: hdmi: Add independent table entries for hdmi_timings on each display
See: #1218
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Aug 9, 2019
kernel: net: bcmgenet: Workaround #2 for Pi4 Ethernet fail
See: raspberrypi/linux#3108

kernel: drm/vc4: Add missing NULL check to vc4_crtc_consume_event

kernel: vc4-kms commits backported
See: raspberrypi/linux#3138

firmware: AWB: Allow user to set manual gains for the RPi algorithm

firmware: arm_loader: Fix disabling of audio before reboot

firmware: fixed up the custom CVT values to use correct group
firmware: hdmi: Add independent table entries for hdmi_timings on each display
See: raspberrypi/firmware#1218
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants