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

Configure Feed

Select the types of activity you want to include in your feed.

drm/ingenic: Implement proper .atomic_get_input_bus_fmts

The .atomic_get_input_bus_fmts() callback of our top bridge should
return the possible input formats for a given output format. If the
requested output format is not supported, then NULL should be returned,
otherwise the bus format negociation will end with a bus format that the
encoder does not support.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://patchwork.freedesktop.org/patch/msgid/ab25925723cff2f3e773e7137567ef86fff5fdba.1649330171.git.hns@goldelico.com

+27 -1
+27 -1
drivers/gpu/drm/ingenic/ingenic-drm-drv.c
··· 833 833 } 834 834 } 835 835 836 + static u32 * 837 + ingenic_drm_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, 838 + struct drm_bridge_state *bridge_state, 839 + struct drm_crtc_state *crtc_state, 840 + struct drm_connector_state *conn_state, 841 + u32 output_fmt, 842 + unsigned int *num_input_fmts) 843 + { 844 + switch (output_fmt) { 845 + case MEDIA_BUS_FMT_RGB888_1X24: 846 + case MEDIA_BUS_FMT_RGB666_1X18: 847 + case MEDIA_BUS_FMT_RGB565_1X16: 848 + case MEDIA_BUS_FMT_RGB888_3X8: 849 + case MEDIA_BUS_FMT_RGB888_3X8_DELTA: 850 + break; 851 + default: 852 + *num_input_fmts = 0; 853 + return NULL; 854 + } 855 + 856 + return drm_atomic_helper_bridge_propagate_bus_fmt(bridge, bridge_state, 857 + crtc_state, conn_state, 858 + output_fmt, 859 + num_input_fmts); 860 + } 861 + 836 862 static irqreturn_t ingenic_drm_irq_handler(int irq, void *arg) 837 863 { 838 864 struct ingenic_drm *priv = drm_device_get_priv(arg); ··· 1010 984 .atomic_reset = drm_atomic_helper_bridge_reset, 1011 985 .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, 1012 986 .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, 1013 - .atomic_get_input_bus_fmts = drm_atomic_helper_bridge_propagate_bus_fmt, 987 + .atomic_get_input_bus_fmts = ingenic_drm_bridge_atomic_get_input_bus_fmts, 1014 988 }; 1015 989 1016 990 static const struct drm_mode_config_funcs ingenic_drm_mode_config_funcs = {