[RFC PATCH 23/37] drm: mode: Cache userspace mode representation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 drivers/gpu/drm/drm_modes.c | 2 ++
 include/drm/drm_modes.h     | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index bb46335..803e00a 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -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);
 		}
 	}
diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
index ea2f0c2..e7eb727 100644
--- a/include/drm/drm_modes.h
+++ b/include/drm/drm_modes.h
@@ -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];
 
-- 
2.3.2

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux