History

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.

Eric Anholt committed 8 years ago

Commit dff906c1 parent 01f23453 files · +14 −1Browse files

Unified · Split

3 files
  1. drivers/gpu/drm/drm_simple_kms_helper.c +8 −0
  2. drivers/gpu/drm/tinydrm/core/tinydrm-core.c +1 −0
  3. drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c +5 −1
drivers/gpu/drm/drm_simple_kms_helper.c+8−0
@@ -190,6 +190,13 @@ static void drm_simple_kms_plane_cleanup_fb(struct drm_plane *plane, · 189 unmodified lines
190190 pipe->funcs->cleanup_fb(pipe, state);
191191 }
192192
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+
193200 static const struct drm_plane_helper_funcs drm_simple_kms_plane_helper_funcs = {
194201 .prepare_fb = drm_simple_kms_plane_prepare_fb,
195202 .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
204211 .reset = drm_atomic_helper_plane_reset,
205212 .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
206213 .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
214+ .format_mod_supported = drm_simple_kms_format_mod_supported,
207215 };
208216
209217 /**
drivers/gpu/drm/tinydrm/core/tinydrm-core.c+1−0
@@ -146,6 +146,7 @@ static int tinydrm_init(struct device *parent, struct tinydrm_device *tdev, · 145 unmodified lines
146146 drm->dev_private = tdev;
147147 drm_mode_config_init(drm);
148148 drm->mode_config.funcs = &tinydrm_mode_config_funcs;
149+ drm->mode_config.allow_fb_modifiers = true;
149150
150151 return 0;
151152 }
drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c+5−1
@@ -184,6 +184,10 @@ tinydrm_display_pipe_init(struct tinydrm_device *tdev, · 183 unmodified lines
184184 struct drm_display_mode mode_copy;
185185 struct drm_connector *connector;
186186 int ret;
187+ static const uint64_t modifiers[] = {
188+ DRM_FORMAT_MOD_LINEAR,
189+ DRM_FORMAT_MOD_INVALID
190+ };
187191
188192 drm_mode_copy(&mode_copy, mode);
189193 ret = tinydrm_rotate_mode(&mode_copy, rotation);
@@ -202,6 +206,6 @@ tinydrm_display_pipe_init(struct tinydrm_device *tdev, · 12 unmodified lines
202206 return PTR_ERR(connector);
203207
204208 return drm_simple_display_pipe_init(drm, &tdev->pipe, funcs, formats,
205− format_count, NULL, connector);
209+ format_count, modifiers, connector);
206210 }
207211 EXPORT_SYMBOL(tinydrm_display_pipe_init);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t