Commit 2467d946 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'imx-drm-next-2019-08-23' of git://git.pengutronix.de/pza/linux into drm-next

drm/imx: IPUv3 image converter fixes and improvements

Fix image converter seam handling for 1024x1024 pixel hardware
limitation at the main processing section input, improve error
handling, and slightly optimize for 1:1 conversions.
Add support for newly defined 32-bit RGB V4L2 pixel formats.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/1566573659.23587.2.camel@pengutronix.de
parents 29d9d76a 4d243763
...@@ -8,5 +8,4 @@ obj-$(CONFIG_DRM_IMX_PARALLEL_DISPLAY) += parallel-display.o ...@@ -8,5 +8,4 @@ obj-$(CONFIG_DRM_IMX_PARALLEL_DISPLAY) += parallel-display.o
obj-$(CONFIG_DRM_IMX_TVE) += imx-tve.o obj-$(CONFIG_DRM_IMX_TVE) += imx-tve.o
obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o
obj-$(CONFIG_DRM_IMX_IPUV3) += imx-ipuv3-crtc.o
obj-$(CONFIG_DRM_IMX_HDMI) += dw_hdmi-imx.o obj-$(CONFIG_DRM_IMX_HDMI) += dw_hdmi-imx.o
...@@ -113,13 +113,17 @@ enum ipu_color_space ipu_pixelformat_to_colorspace(u32 pixelformat) ...@@ -113,13 +113,17 @@ enum ipu_color_space ipu_pixelformat_to_colorspace(u32 pixelformat)
case V4L2_PIX_FMT_NV16: case V4L2_PIX_FMT_NV16:
case V4L2_PIX_FMT_NV61: case V4L2_PIX_FMT_NV61:
return IPUV3_COLORSPACE_YUV; return IPUV3_COLORSPACE_YUV;
case V4L2_PIX_FMT_XRGB32:
case V4L2_PIX_FMT_XBGR32:
case V4L2_PIX_FMT_RGB32:
case V4L2_PIX_FMT_BGR32:
case V4L2_PIX_FMT_RGB24:
case V4L2_PIX_FMT_BGR24:
case V4L2_PIX_FMT_RGB565: case V4L2_PIX_FMT_RGB565:
case V4L2_PIX_FMT_BGR24:
case V4L2_PIX_FMT_RGB24:
case V4L2_PIX_FMT_ABGR32:
case V4L2_PIX_FMT_XBGR32:
case V4L2_PIX_FMT_BGRA32:
case V4L2_PIX_FMT_BGRX32:
case V4L2_PIX_FMT_RGBA32:
case V4L2_PIX_FMT_RGBX32:
case V4L2_PIX_FMT_ARGB32:
case V4L2_PIX_FMT_XRGB32:
return IPUV3_COLORSPACE_RGB; return IPUV3_COLORSPACE_RGB;
default: default:
return IPUV3_COLORSPACE_UNKNOWN; return IPUV3_COLORSPACE_UNKNOWN;
......
...@@ -182,9 +182,27 @@ static int v4l2_pix_fmt_to_drm_fourcc(u32 pixelformat) ...@@ -182,9 +182,27 @@ static int v4l2_pix_fmt_to_drm_fourcc(u32 pixelformat)
case V4L2_PIX_FMT_RGB32: case V4L2_PIX_FMT_RGB32:
/* R G B A <=> [32:0] A:B:G:R */ /* R G B A <=> [32:0] A:B:G:R */
return DRM_FORMAT_XBGR8888; return DRM_FORMAT_XBGR8888;
case V4L2_PIX_FMT_ABGR32:
/* B G R A <=> [32:0] A:R:G:B */
return DRM_FORMAT_ARGB8888;
case V4L2_PIX_FMT_XBGR32: case V4L2_PIX_FMT_XBGR32:
/* B G R X <=> [32:0] X:R:G:B */ /* B G R X <=> [32:0] X:R:G:B */
return DRM_FORMAT_XRGB8888; return DRM_FORMAT_XRGB8888;
case V4L2_PIX_FMT_BGRA32:
/* A B G R <=> [32:0] R:G:B:A */
return DRM_FORMAT_RGBA8888;
case V4L2_PIX_FMT_BGRX32:
/* X B G R <=> [32:0] R:G:B:X */
return DRM_FORMAT_RGBX8888;
case V4L2_PIX_FMT_RGBA32:
/* R G B A <=> [32:0] A:B:G:R */
return DRM_FORMAT_ABGR8888;
case V4L2_PIX_FMT_RGBX32:
/* R G B X <=> [32:0] X:B:G:R */
return DRM_FORMAT_XBGR8888;
case V4L2_PIX_FMT_ARGB32:
/* A R G B <=> [32:0] B:G:R:A */
return DRM_FORMAT_BGRA8888;
case V4L2_PIX_FMT_XRGB32: case V4L2_PIX_FMT_XRGB32:
/* X R G B <=> [32:0] B:G:R:X */ /* X R G B <=> [32:0] B:G:R:X */
return DRM_FORMAT_BGRX8888; return DRM_FORMAT_BGRX8888;
...@@ -823,8 +841,14 @@ int ipu_cpmem_set_image(struct ipuv3_channel *ch, struct ipu_image *image) ...@@ -823,8 +841,14 @@ int ipu_cpmem_set_image(struct ipuv3_channel *ch, struct ipu_image *image)
break; break;
case V4L2_PIX_FMT_RGB32: case V4L2_PIX_FMT_RGB32:
case V4L2_PIX_FMT_BGR32: case V4L2_PIX_FMT_BGR32:
case V4L2_PIX_FMT_XRGB32: case V4L2_PIX_FMT_ABGR32:
case V4L2_PIX_FMT_XBGR32: case V4L2_PIX_FMT_XBGR32:
case V4L2_PIX_FMT_BGRA32:
case V4L2_PIX_FMT_BGRX32:
case V4L2_PIX_FMT_RGBA32:
case V4L2_PIX_FMT_RGBX32:
case V4L2_PIX_FMT_ARGB32:
case V4L2_PIX_FMT_XRGB32:
offset = image->rect.left * 4 + offset = image->rect.left * 4 +
image->rect.top * pix->bytesperline; image->rect.top * pix->bytesperline;
break; break;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment