tree:
https://github.com/superna9999/linux amlogic/v5.9/dw-hdmi-yuv-for-hdmi-only
head: 20ce0db3ea1736c26c86d92427ca50ba600088de
commit: 20ce0db3ea1736c26c86d92427ca50ba600088de [1/1] drm/bridge: synopsys: dw-hdmi:
disable YUV negociation for DVI monitors
config: x86_64-randconfig-m001-20200807 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
smatch warnings:
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c:2610 dw_hdmi_bridge_atomic_get_output_bus_fmts()
warn: maybe use && instead of &
vim +2610 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
2544
2545 static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
2546 struct drm_bridge_state *bridge_state,
2547 struct drm_crtc_state *crtc_state,
2548 struct drm_connector_state *conn_state,
2549 unsigned int *num_output_fmts)
2550 {
2551 struct drm_connector *conn = conn_state->connector;
2552 struct drm_display_info *info = &conn->display_info;
2553 struct drm_display_mode *mode = &crtc_state->mode;
2554 u8 max_bpc = conn_state->max_requested_bpc;
2555 bool is_hdmi2_sink = info->hdmi.scdc.supported ||
2556 (info->color_formats & DRM_COLOR_FORMAT_YCRCB420);
2557 u32 *output_fmts;
2558 unsigned int i = 0;
2559
2560 *num_output_fmts = 0;
2561
2562 output_fmts = kcalloc(MAX_OUTPUT_SEL_FORMATS, sizeof(*output_fmts),
2563 GFP_KERNEL);
2564 if (!output_fmts)
2565 return NULL;
2566
2567 /* If dw-hdmi is the only bridge, avoid negociating with ourselves */
2568 if (list_is_singular(&bridge->encoder->bridge_chain)) {
2569 *num_output_fmts = 1;
2570 output_fmts[0] = MEDIA_BUS_FMT_FIXED;
2571
2572 return output_fmts;
2573 }
2574
2575 /*
2576 * If the current mode enforces 4:2:0, force the output but format
2577 * to 4:2:0 and do not add the YUV422/444/RGB formats
2578 */
2579 if (info->is_hdmi && conn->ycbcr_420_allowed &&
2580 (drm_mode_is_420_only(info, mode) ||
2581 (is_hdmi2_sink && drm_mode_is_420_also(info, mode)))) {
2582
2583 /* Order bus formats from 16bit to 8bit if supported */
2584 if (max_bpc >= 16 && info->bpc == 16 &&
2585 (info->hdmi.y420_dc_modes & DRM_EDID_YCBCR420_DC_48))
2586 output_fmts[i++] = MEDIA_BUS_FMT_UYYVYY16_0_5X48;
2587
2588 if (max_bpc >= 12 && info->bpc >= 12 &&
2589 (info->hdmi.y420_dc_modes & DRM_EDID_YCBCR420_DC_36))
2590 output_fmts[i++] = MEDIA_BUS_FMT_UYYVYY12_0_5X36;
2591
2592 if (max_bpc >= 10 && info->bpc >= 10 &&
2593 (info->hdmi.y420_dc_modes & DRM_EDID_YCBCR420_DC_30))
2594 output_fmts[i++] = MEDIA_BUS_FMT_UYYVYY10_0_5X30;
2595
2596 /* Default 8bit fallback */
2597 output_fmts[i++] = MEDIA_BUS_FMT_UYYVYY8_0_5X24;
2598
2599 *num_output_fmts = i;
2600
2601 return output_fmts;
2602 }
2603
2604 /*
2605 * Order bus formats from 16bit to 8bit and from YUV422 to RGB
2606 * if supported. In any case the default RGB888 format is added
2607 */
2608
2609 if (max_bpc >= 16 && info->bpc == 16) {
2610 if (info->is_hdmi & DRM_COLOR_FORMAT_YCRCB444)
2611 output_fmts[i++] = MEDIA_BUS_FMT_YUV16_1X48;
2612
2613 output_fmts[i++] = MEDIA_BUS_FMT_RGB161616_1X48;
2614 }
2615
2616 if (max_bpc >= 12 && info->bpc >= 12) {
2617 if (info->is_hdmi &&
2618 info->color_formats & DRM_COLOR_FORMAT_YCRCB422)
2619 output_fmts[i++] = MEDIA_BUS_FMT_UYVY12_1X24;
2620
2621 if (info->is_hdmi &&
2622 info->color_formats & DRM_COLOR_FORMAT_YCRCB444)
2623 output_fmts[i++] = MEDIA_BUS_FMT_YUV12_1X36;
2624
2625 output_fmts[i++] = MEDIA_BUS_FMT_RGB121212_1X36;
2626 }
2627
2628 if (max_bpc >= 10 && info->bpc >= 10) {
2629 if (info->is_hdmi &&
2630 info->color_formats & DRM_COLOR_FORMAT_YCRCB422)
2631 output_fmts[i++] = MEDIA_BUS_FMT_UYVY10_1X20;
2632
2633 if (info->is_hdmi &&
2634 info->color_formats & DRM_COLOR_FORMAT_YCRCB444)
2635 output_fmts[i++] = MEDIA_BUS_FMT_YUV10_1X30;
2636
2637 output_fmts[i++] = MEDIA_BUS_FMT_RGB101010_1X30;
2638 }
2639
2640 if (info->is_hdmi &&
2641 info->color_formats & DRM_COLOR_FORMAT_YCRCB422)
2642 output_fmts[i++] = MEDIA_BUS_FMT_UYVY8_1X16;
2643
2644 if (info->is_hdmi &&
2645 info->color_formats & DRM_COLOR_FORMAT_YCRCB444)
2646 output_fmts[i++] = MEDIA_BUS_FMT_YUV8_1X24;
2647
2648 /* Default 8bit RGB fallback */
2649 output_fmts[i++] = MEDIA_BUS_FMT_RGB888_1X24;
2650
2651 *num_output_fmts = i;
2652
2653 return output_fmts;
2654 }
2655
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org