Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'imx-drm-next-2022-05-04' of git://git.pengutronix.de/pza/linux into drm-next

drm/imx: various cleanups

- Use swap() instead of open-coding in ipu-image-convert.
- Use devm_platform_ioremap_resource() helper in imx-tve.
- Make static channel_offsets array const in ipu-dc.
- Remove redundant zpos, color encoding and range initialization.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220504144628.3954620-1-p.zabel@pengutronix.de

+8 -18
+1 -3
drivers/gpu/drm/imx/imx-tve.c
··· 526 526 struct device_node *np = dev->of_node; 527 527 struct device_node *ddc_node; 528 528 struct imx_tve *tve; 529 - struct resource *res; 530 529 void __iomem *base; 531 530 unsigned int val; 532 531 int irq; ··· 567 568 } 568 569 } 569 570 570 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 571 - base = devm_ioremap_resource(dev, res); 571 + base = devm_platform_ioremap_resource(pdev, 0); 572 572 if (IS_ERR(base)) 573 573 return PTR_ERR(base); 574 574
+1 -7
drivers/gpu/drm/imx/ipuv3-plane.c
··· 297 297 298 298 static void ipu_plane_state_reset(struct drm_plane *plane) 299 299 { 300 - unsigned int zpos = (plane->type == DRM_PLANE_TYPE_PRIMARY) ? 0 : 1; 301 300 struct ipu_plane_state *ipu_state; 302 301 303 302 if (plane->state) { ··· 308 309 309 310 ipu_state = kzalloc(sizeof(*ipu_state), GFP_KERNEL); 310 311 311 - if (ipu_state) { 312 + if (ipu_state) 312 313 __drm_atomic_helper_plane_reset(plane, &ipu_state->base); 313 - ipu_state->base.zpos = zpos; 314 - ipu_state->base.normalized_zpos = zpos; 315 - ipu_state->base.color_encoding = DRM_COLOR_YCBCR_BT601; 316 - ipu_state->base.color_range = DRM_COLOR_YCBCR_LIMITED_RANGE; 317 - } 318 314 } 319 315 320 316 static struct drm_plane_state *
+3 -2
drivers/gpu/ipu-v3/ipu-dc.c
··· 344 344 unsigned long base, unsigned long template_base) 345 345 { 346 346 struct ipu_dc_priv *priv; 347 - static int channel_offsets[] = { 0, 0x1c, 0x38, 0x54, 0x58, 0x5c, 348 - 0x78, 0, 0x94, 0xb4}; 347 + static const int channel_offsets[] = { 348 + 0, 0x1c, 0x38, 0x54, 0x58, 0x5c, 0x78, 0, 0x94, 0xb4 349 + }; 349 350 int i; 350 351 351 352 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+3 -6
drivers/gpu/ipu-v3/ipu-image-convert.c
··· 990 990 const struct ipu_image_pixfmt *fmt = image->fmt; 991 991 unsigned int row, col, tile = 0; 992 992 u32 H, top, y_stride, uv_stride; 993 - u32 uv_row_off, uv_col_off, uv_off, u_off, v_off, tmp; 993 + u32 uv_row_off, uv_col_off, uv_off, u_off, v_off; 994 994 u32 y_row_off, y_col_off, y_off; 995 995 u32 y_size, uv_size; 996 996 ··· 1021 1021 1022 1022 u_off = y_size - y_off + uv_off; 1023 1023 v_off = (fmt->uv_packed) ? 0 : u_off + uv_size; 1024 - if (fmt->uv_swapped) { 1025 - tmp = u_off; 1026 - u_off = v_off; 1027 - v_off = tmp; 1028 - } 1024 + if (fmt->uv_swapped) 1025 + swap(u_off, v_off); 1029 1026 1030 1027 image->tile[tile].offset = y_off; 1031 1028 image->tile[tile].u_off = u_off;