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 | 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, |
| @@ -204,6 +211,7 @@ static const struct drm_plane_funcs drm_simple_kms_plane_funcs = { · 8 unmodified lines | ||
| 204 | 211 | .reset = drm_atomic_helper_plane_reset, |
| 205 | 212 | .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, |
| 206 | 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 | 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 | } |
| @@ -184,6 +184,10 @@ tinydrm_display_pipe_init(struct tinydrm_device *tdev, · 183 unmodified lines | ||
| 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); |
| @@ -202,6 +206,6 @@ tinydrm_display_pipe_init(struct tinydrm_device *tdev, · 12 unmodified lines | ||
| 202 | 206 | return PTR_ERR(connector); |
| 203 | 207 | |
| 204 | 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 | 211 | EXPORT_SYMBOL(tinydrm_display_pipe_init); |