@@ -969,6 +969,7 @@ struct drm_display_mode *drm_mode_new_from_umode(struct drm_device *dev,
out->type = in->type;
strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
out->name[DRM_DISPLAY_MODE_LEN-1] = 0;
+ out->umode = *in;
out->status = drm_mode_validate_basic(out);
if (out->status != MODE_OK)
@@ -1282,6 +1283,7 @@ void drm_mode_connector_list_update(struct drm_connector *connector,
}
if (!found_it) {
+ drm_mode_convert_to_umode(&pmode->umode, pmode);
list_move_tail(&pmode->head, &connector->modes);
}
}
@@ -100,6 +100,7 @@ struct drm_display_mode {
/* Header */
struct list_head head;
struct drm_mode_object base;
+ struct drm_mode_modeinfo umode;
char name[DRM_DISPLAY_MODE_LEN];
For every mode which may be visible to userspace - either current on a CRTC as a result of setcrtc, or advertised through the connector's mode list - cache the drm_mode_modeinfo representation to send back to userspace. Signed-off-by: Daniel Stone <daniels@collabora.com> --- drivers/gpu/drm/drm_modes.c | 2 ++ include/drm/drm_modes.h | 1 + 2 files changed, 3 insertions(+)