OSDN Git Service

drm/sun4i: frontend: Apply format sub-sampling to CH1 dimensions
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Fri, 23 Nov 2018 09:24:57 +0000 (10:24 +0100)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Tue, 27 Nov 2018 08:58:22 +0000 (09:58 +0100)
commit411e83069e1590cad8c29adcb04de8e73714fa9f
tree9d089fff5825f9876e92f91750f246dde6ca3aa0
parentdc7d4b655a2c4a8db1342600319a7939eafeb9af
drm/sun4i: frontend: Apply format sub-sampling to CH1 dimensions

The frontend comes with two "channels", that can be configured
independently. When used in YUV mode, the first channel (CH0) represents
the luminance component while the second channel (CH1) represents the
chrominance. In RGB mode, both have to be configured the same way.

Use variables (with the YUV terminology) for each channel's
dimensions, calculating the chroma dimensions from the luma dimensions
and the sub-sampling factors from the format description.

Since the configured size only has pixel precision, the fractional
fixed-point part of the source size is dropped for both components to
ensure that the scaling factors are accurate.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181123092515.2511-26-paul.kocialkowski@bootlin.com
drivers/gpu/drm/sun4i/sun4i_frontend.c