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

drm/tinydrm: Advertise that we can do only DRM_FORMAT_MOD_LINEAR.

Without this, the xserver relies on what the 3D driver exposes and
assumes that the display can handle it, and then the DRM driver
happily tries to scan out a tiled format.

Signed-off-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20181025162635.6689-1-eric@anholt.net
Acked-by: Noralf Trønnes <noralf@tronnes.org>

+14 -1
+8
drivers/gpu/drm/drm_simple_kms_helper.c
··· 190 190 pipe->funcs->cleanup_fb(pipe, state); 191 191 } 192 192 193 + static bool drm_simple_kms_format_mod_supported(struct drm_plane *plane, 194 + uint32_t format, 195 + uint64_t modifier) 196 + { 197 + return modifier == DRM_FORMAT_MOD_LINEAR; 198 + } 199 + 193 200 static const struct drm_plane_helper_funcs drm_simple_kms_plane_helper_funcs = { 194 201 .prepare_fb = drm_simple_kms_plane_prepare_fb, 195 202 .cleanup_fb = drm_simple_kms_plane_cleanup_fb, ··· 211 204 .reset = drm_atomic_helper_plane_reset, 212 205 .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, 213 206 .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, 207 + .format_mod_supported = drm_simple_kms_format_mod_supported, 214 208 }; 215 209 216 210 /**
+1
drivers/gpu/drm/tinydrm/core/tinydrm-core.c
··· 146 146 drm->dev_private = tdev; 147 147 drm_mode_config_init(drm); 148 148 drm->mode_config.funcs = &tinydrm_mode_config_funcs; 149 + drm->mode_config.allow_fb_modifiers = true; 149 150 150 151 return 0; 151 152 }
+5 -1
drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c
··· 184 184 struct drm_display_mode mode_copy; 185 185 struct drm_connector *connector; 186 186 int ret; 187 + static const uint64_t modifiers[] = { 188 + DRM_FORMAT_MOD_LINEAR, 189 + DRM_FORMAT_MOD_INVALID 190 + }; 187 191 188 192 drm_mode_copy(&mode_copy, mode); 189 193 ret = tinydrm_rotate_mode(&mode_copy, rotation); ··· 206 202 return PTR_ERR(connector); 207 203 208 204 return drm_simple_display_pipe_init(drm, &tdev->pipe, funcs, formats, 209 - format_count, NULL, connector); 205 + format_count, modifiers, connector); 210 206 } 211 207 EXPORT_SYMBOL(tinydrm_display_pipe_init);