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

FKMS overscan support. #3090

Merged
merged 7 commits into from
Jul 23, 2019
Merged

FKMS overscan support. #3090

merged 7 commits into from
Jul 23, 2019

Conversation

6by9
Copy link
Contributor

@6by9 6by9 commented Jul 19, 2019

5 patches backported from 5.1, and then implementing margins for FKMS.

You can test with either modetest (from https://gitlab.freedesktop.org/mesa/drm/tree/master/tests/modetest), with
modetest -M vc4 -w 51:"top margin":50
replace "top" with "bottom", "left" or "right" as appropriate.
51 is the DRM connector ID, and can be determined with

pi@raspberrypi:~ $ drm/build/tests/modetest/modetest -M vc4 -c
Connectors:
id	encoder	status		name		size (mm)	modes	encoders
51	50	connected	HDMI-A-1       	610x350		43	50
  modes:
	name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  3840x2160 30 3840 4016 4104 4400 2160 2168 2178 2250 297000 flags: phsync, pvsync; type: driver

or from xrandr

xrandr --output HDMI-1 --set "top margin" 50

NB because the primary (background) plane isn't redrawn at this point, your mouse cursor won't now align with things. Change resolution using lxrandr or similar, or otherwise force a full screen redraw, and your new settings should take effect.

Boris Brezillon and others added 7 commits July 19, 2019 15:47
Commit eda6887 upstream.

The in the kernel-doc header did not match the function name.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20181206142439.10441-2-boris.brezillon@bootlin.com
Commit 56406e1 upstream.

All margins are expressed in pixels. Clarify that in the doc.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20181206142439.10441-3-boris.brezillon@bootlin.com
Commit 6c4f52d upstream.

TV margins properties can only be added as part of the SDTV TV
connector properties creation, but we might need those props for HDMI
TVs too, so let's move the margins props creation in a separate
function and expose it to drivers.

We also add an helper to attach margins props to a connector.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20181206142439.10441-4-boris.brezillon@bootlin.com
Commit 666e735 upstream.

Applyin margins is just a matter of scaling all planes appropriately
and adjusting the CRTC X/Y offset to account for the
left/right/top/bottom borders.

Create a vc4_plane_margins_adj() function doing that and call it from
vc4_plane_setup_clipping_and_scaling() so that we are ready to attach
margins properties to the HDMI connector.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20181206142439.10441-5-boris.brezillon@bootlin.com
Commit db99953 upstream.

Now that the plane code takes the margins setup into account, we can
safely attach margin props to the HDMI connector.

We also take care of filling AVI infoframes correctly to expose the
top/botton/left/right bar.

Note that those margin props match pretty well the
overscan_{left,right,top,bottom} properties defined in config.txt and
parsed by the VC4 firmware.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20181206142439.10441-6-boris.brezillon@bootlin.com
Allows for overscan to be configured under FKMS.
NB This is rescaling the planes, not reducing the size of the
display mode.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
The compiler is warning that default_zpos can be used
uninitialised as there is no default case to catch all plane
types.
No other plane types should ever be presented to vc4_fkms_plane_init,
but add a default case regardless.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
@6by9
Copy link
Contributor Author

6by9 commented Jul 23, 2019

Odd sized cursor after screen saver resolved.
This patch set moved where the mailbox parameters are set up from vc4_plane_atomic_update to vc4_plane_atomic_check as otherwise we miss some of the plane state required for overscan. This is then in line with the full KMS driver too.
Within check we don't necessarily have a mode set, therefore the code that was trying to clip the cursor plane within the bounds of the mode went nuts.

Dispmanx does that job for us anyway, so ditching it gives the right results.

Branch/PR updated.

@popcornmix popcornmix merged commit 689fc28 into raspberrypi:rpi-4.19.y Jul 23, 2019
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jul 23, 2019
kernel: overlays: Add PCF2129 RTC
See: #1190

kernel: overlays: dpi18 and dpi24 vc4 compatibility
kernel: overlays: Add i2c0 and i2c1 for regularity

kernel: Pisound: Remove spinlock usage around spi_sync
See: raspberrypi/linux#3069

kernel: configs: Enable iio driver for TI ADS1015
See: raspberrypi/linux#3083

kernel: bcm2711_defconfig: enable PCI portbus support (and implicitly, PCIe AER)
See: raspberrypi/linux#3086

kernel: FKMS hdmi_timings settings
See: raspberrypi/linux#3082

kernel: overlays: audremap: Support GPIOs 18 & 19
See: #1178

kernel: FKMS overscan support
See: raspberrypi/linux#3090

firmware: Change order of display remapping for default display number

firmware: AWB: Set default number of stats regions for RPi AWB
See: #1198

firmware: Fix composite interrupt HVS channel

firmware: scalarlib: Fix width setting for SCALERLIB_PIXEL_FORMAT_YUV10COL

firmware: vcmailbox: Add a new SET_AUDIO_LDO_STATE mailbox command

firmware: Add mailbox call to report the HDMI timings

firmware: H264: Set the decoder cache AXI burst length to the same as the encoder

firmware: gencmd: Fix gencmd max result length
firmware: bootloader_config: New gencmd to read the EEPROM config

firmware: pwm_audio: Use PWM1 on BCM2838 unless remapped
See: #1178
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Jul 23, 2019
kernel: overlays: Add PCF2129 RTC
See: raspberrypi/firmware#1190

kernel: overlays: dpi18 and dpi24 vc4 compatibility
kernel: overlays: Add i2c0 and i2c1 for regularity

kernel: Pisound: Remove spinlock usage around spi_sync
See: raspberrypi/linux#3069

kernel: configs: Enable iio driver for TI ADS1015
See: raspberrypi/linux#3083

kernel: bcm2711_defconfig: enable PCI portbus support (and implicitly, PCIe AER)
See: raspberrypi/linux#3086

kernel: FKMS hdmi_timings settings
See: raspberrypi/linux#3082

kernel: overlays: audremap: Support GPIOs 18 & 19
See: raspberrypi/firmware#1178

kernel: FKMS overscan support
See: raspberrypi/linux#3090

firmware: Change order of display remapping for default display number

firmware: AWB: Set default number of stats regions for RPi AWB
See: raspberrypi/firmware#1198

firmware: Fix composite interrupt HVS channel

firmware: scalarlib: Fix width setting for SCALERLIB_PIXEL_FORMAT_YUV10COL

firmware: vcmailbox: Add a new SET_AUDIO_LDO_STATE mailbox command

firmware: Add mailbox call to report the HDMI timings

firmware: H264: Set the decoder cache AXI burst length to the same as the encoder

firmware: gencmd: Fix gencmd max result length
firmware: bootloader_config: New gencmd to read the EEPROM config

firmware: pwm_audio: Use PWM1 on BCM2838 unless remapped
See: raspberrypi/firmware#1178
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.

2 participants