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.
Unified · Split
| @@ -190,6 +190,13 @@ static void drm_simple_kms_plane_cleanup_fb(struct drm_plane *plane, · 189 unmodified lines | |||
| 190 | pipe->funcs->cleanup_fb(pipe, state); | 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 | static const struct drm_plane_helper_funcs drm_simple_kms_plane_helper_funcs = { | 200 | static const struct drm_plane_helper_funcs drm_simple_kms_plane_helper_funcs = { |
| 194 | .prepare_fb = drm_simple_kms_plane_prepare_fb, | 201 | .prepare_fb = drm_simple_kms_plane_prepare_fb, |
| 195 | .cleanup_fb = drm_simple_kms_plane_cleanup_fb, | 202 | .cleanup_fb = drm_simple_kms_plane_cleanup_fb, |
| @@ -204,6 +211,7 @@ static const struct drm_plane_funcs drm_simple_kms_plane_funcs = { · 8 unmodified lines | |||
| 204 | .reset = drm_atomic_helper_plane_reset, | 211 | .reset = drm_atomic_helper_plane_reset, |
| 205 | .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, | 212 | .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, |
| 206 | .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, | 213 | .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, |
| 214 | .format_mod_supported = drm_simple_kms_format_mod_supported, | ||
| 207 | }; | 215 | }; |
| 208 | 216 | ||
| 209 | /** | 217 | /** |
| @@ -146,6 +146,7 @@ static int tinydrm_init(struct device *parent, struct tinydrm_device *tdev, · 145 unmodified lines | |||
| 146 | drm->dev_private = tdev; | 146 | drm->dev_private = tdev; |
| 147 | drm_mode_config_init(drm); | 147 | drm_mode_config_init(drm); |
| 148 | drm->mode_config.funcs = &tinydrm_mode_config_funcs; | 148 | drm->mode_config.funcs = &tinydrm_mode_config_funcs; |
| 149 | drm->mode_config.allow_fb_modifiers = true; | ||
| 149 | 150 | ||
| 150 | return 0; | 151 | return 0; |
| 151 | } | 152 | } |
| @@ -184,6 +184,10 @@ tinydrm_display_pipe_init(struct tinydrm_device *tdev, · 183 unmodified lines | |||
| 184 | struct drm_display_mode mode_copy; | 184 | struct drm_display_mode mode_copy; |
| 185 | struct drm_connector *connector; | 185 | struct drm_connector *connector; |
| 186 | int ret; | 186 | int ret; |
| 187 | static const uint64_t modifiers[] = { | ||
| 188 | DRM_FORMAT_MOD_LINEAR, | ||
| 189 | DRM_FORMAT_MOD_INVALID | ||
| 190 | }; | ||
| 187 | 191 | ||
| 188 | drm_mode_copy(&mode_copy, mode); | 192 | drm_mode_copy(&mode_copy, mode); |
| 189 | ret = tinydrm_rotate_mode(&mode_copy, rotation); | 193 | ret = tinydrm_rotate_mode(&mode_copy, rotation); |
| @@ -202,6 +206,6 @@ tinydrm_display_pipe_init(struct tinydrm_device *tdev, · 12 unmodified lines | |||
| 202 | return PTR_ERR(connector); | 206 | return PTR_ERR(connector); |
| 203 | 207 | ||
| 204 | return drm_simple_display_pipe_init(drm, &tdev->pipe, funcs, formats, | 208 | return drm_simple_display_pipe_init(drm, &tdev->pipe, funcs, formats, |
| 205 | format_count, NULL, connector); | 209 | format_count, modifiers, connector); |
| 206 | } | 210 | } |
| 207 | EXPORT_SYMBOL(tinydrm_display_pipe_init); | 211 | EXPORT_SYMBOL(tinydrm_display_pipe_init); |