HDMI stereo support v6
Subsystems (4)
v5 was:
http://lists.freedesktop.org/archives/dri-devel/2013-September/045576.html
Changes from v5:
- Added a size check on frame packing fbs
- Addressed the various reviews
- All the patches now have r-b tags
Signature · 1 line
Damien
PATCH 1/22 drm: Move the GET_CAP macros next to the corresponding ioctl structure
It's a tiny bit more logical to find the different capabilities you can use with the GET_CAP ioctl next to the structure rather than putting them at the end of the file.
v2: Tab align the litterals (David Herrmann)
v3: Make it clearer that DRM_PRIME_CAP_EXPORT/IMPORT are flags of
DRM_CAP_PRIME.
v4: Rebase on top of latest bits (DRM_CAP_ASYNC_PAGE_FLIP was
introduced)
--- include/uapi/drm/drm.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-)
include/uapi/drm/drm.h +10 -11
@@ -611,6 +611,16 @@ struct drm_gem_open {__u64 size; }; +#define DRM_CAP_DUMB_BUFFER 0x1 +#define DRM_CAP_VBLANK_HIGH_CRTC 0x2 +#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 +#define DRM_CAP_DUMB_PREFER_SHADOW 0x4 +#define DRM_CAP_PRIME 0x5 +#define DRM_PRIME_CAP_IMPORT 0x1 +#define DRM_PRIME_CAP_EXPORT 0x2 +#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 +#define DRM_CAP_ASYNC_PAGE_FLIP 0x7 +/** DRM_IOCTL_GET_CAP ioctl argument type */ struct drm_get_cap {__u64 capability;
@@ -774,17 +784,6 @@ struct drm_event_vblank {__u32 reserved; }; -#define DRM_CAP_DUMB_BUFFER 0x1 -#define DRM_CAP_VBLANK_HIGH_CRTC 0x2 -#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 -#define DRM_CAP_DUMB_PREFER_SHADOW 0x4 -#define DRM_CAP_PRIME 0x5 -#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 -#define DRM_CAP_ASYNC_PAGE_FLIP 0x7 - -#define DRM_PRIME_CAP_IMPORT 0x1 -#define DRM_PRIME_CAP_EXPORT 0x2 -/* typedef area */ #ifndef __KERNEL__typedef struct drm_clip_rect drm_clip_rect_t ;
Signature · 1 line
1.8.3.1
PATCH 2/22 drm: Add a SET_CLIENT_CAP ioctl
In reply to Damien LespiauThis ioctl can be used to turn some knobs in a DRM driver. The client can ask the DRM core for an alternate view of the reality: it can be useful to be able to instruct the core that the DRM client can handle new functionnality that would otherwise break current ABI.
v2: Rename to ioctl from SET_CAP to SET_CLIENT_CAP (Chris Wilson)
--- drivers/gpu/drm/drm_drv.c | 1 + drivers/gpu/drm/drm_ioctl.c | 9 +++++++++ include/drm/drmP.h | 2 ++ include/uapi/drm/drm.h | 7 +++++++ 4 files changed, 19 insertions(+)
drivers/gpu/drm/drm_drv.c +1 -0
@@ -69,6 +69,7 @@ static const struct drm_ioctl_desc drm_ioctls[] = {DRM_IOCTL_DEF (DRM_IOCTL_GET_CLIENT , drm_getclient,DRM_UNLOCKED ),DRM_IOCTL_DEF (DRM_IOCTL_GET_STATS , drm_getstats,DRM_UNLOCKED ),DRM_IOCTL_DEF (DRM_IOCTL_GET_CAP , drm_getcap,DRM_UNLOCKED |DRM_RENDER_ALLOW ), +DRM_IOCTL_DEF (DRM_IOCTL_SET_CLIENT_CAP , drm_setclientcap,0 ),DRM_IOCTL_DEF (DRM_IOCTL_SET_VERSION , drm_setversion,DRM_MASTER ), DRM_IOCTL_DEF(DRM_IOCTL_SET_UNIQUE, drm_setunique, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
drivers/gpu/drm/drm_ioctl.c +9 -0
@@ -303,6 +303,15 @@ int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_priv) }/** +* Set device/driver capabilities +*/ +int +drm_setclientcap (struct drm_device *dev,void *data,struct drm_file *file_priv) +{ +return -EINVAL ; +} + +/** * Setversion ioctl. * * \param inode device inode.
include/drm/drmP.h +2 -0
@@ -1303,6 +1303,8 @@ extern int drm_getstats(struct drm_device *dev, void *data, struct drm_file *file_priv);extern int drm_getcap (struct drm_device *dev,void *data,struct drm_file *file_priv); +extern int drm_setclientcap (struct drm_device *dev,void *data, +struct drm_file *file_priv);extern int drm_setversion (struct drm_device *dev,void *data,struct drm_file *file_priv); extern int drm_noop(struct drm_device *dev, void *data,
include/uapi/drm/drm.h +7 -0
@@ -627,6 +627,12 @@ struct drm_get_cap {__u64 value; }; +/** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ +struct drm_set_client_cap { +__u64 capability; +__u64 value; +}; +#define DRM_CLOEXEC O_CLOEXECstruct drm_prime_handle {__u32 handle;
@@ -659,6 +665,7 @@ struct drm_prime_handle {#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink)#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open)#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap) +#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap)#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique)#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth)
Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/22 drm: Add HDMI stereo 3D flags to struct drm_mode_modeinfo
In reply to Damien LespiauHDMI 1.4a defines a few layouts that we'd like to expose. This commits add new modeinfo flags that can be used to list the supported stereo layouts (when querying the list of modes) and to set a given stereo 3D mode (when setting a mode).
v2: Add a drm_mode_is_stereo() helper
--- include/drm/drm_crtc.h | 14 ++++++++++++++ include/uapi/drm/drm_mode.h | 36 ++++++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 14 deletions(-)
include/drm/drm_crtc.h +14 -0
@@ -180,6 +180,20 @@ struct drm_display_mode {int hsync;/* in kHz */ }; +#define DRM_MODE_FLAG_3D_MASK (DRM_MODE_FLAG_3D_FRAME_PACKING | \ + DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE | \ + DRM_MODE_FLAG_3D_LINE_ALTERNATIVE | \ + DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL | \ + DRM_MODE_FLAG_3D_L_DEPTH | \ + DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH | \ + DRM_MODE_FLAG_3D_TOP_AND_BOTTOM | \ + DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF) + +static inline bool drm_mode_is_stereo (const struct drm_display_mode *mode) +{ +return mode->flags &DRM_MODE_FLAG_3D_MASK ; +} +enum drm_connector_status { connector_status_connected =1 , connector_status_disconnected =2 ,
include/uapi/drm/drm_mode.h +22 -14
@@ -44,20 +44,28 @@/* Video mode flags */ /* bit compatible with the xorg definitions. */ -#define DRM_MODE_FLAG_PHSYNC (1<<0) -#define DRM_MODE_FLAG_NHSYNC (1<<1) -#define DRM_MODE_FLAG_PVSYNC (1<<2) -#define DRM_MODE_FLAG_NVSYNC (1<<3) -#define DRM_MODE_FLAG_INTERLACE (1<<4) -#define DRM_MODE_FLAG_DBLSCAN (1<<5) -#define DRM_MODE_FLAG_CSYNC (1<<6) -#define DRM_MODE_FLAG_PCSYNC (1<<7) -#define DRM_MODE_FLAG_NCSYNC (1<<8) -#define DRM_MODE_FLAG_HSKEW (1<<9)/* hskew provided */ -#define DRM_MODE_FLAG_BCAST (1<<10) -#define DRM_MODE_FLAG_PIXMUX (1<<11) -#define DRM_MODE_FLAG_DBLCLK (1<<12) -#define DRM_MODE_FLAG_CLKDIV2 (1<<13) +#define DRM_MODE_FLAG_PHSYNC (1<<0) +#define DRM_MODE_FLAG_NHSYNC (1<<1) +#define DRM_MODE_FLAG_PVSYNC (1<<2) +#define DRM_MODE_FLAG_NVSYNC (1<<3) +#define DRM_MODE_FLAG_INTERLACE (1<<4) +#define DRM_MODE_FLAG_DBLSCAN (1<<5) +#define DRM_MODE_FLAG_CSYNC (1<<6) +#define DRM_MODE_FLAG_PCSYNC (1<<7) +#define DRM_MODE_FLAG_NCSYNC (1<<8) +#define DRM_MODE_FLAG_HSKEW (1<<9)/* hskew provided */ +#define DRM_MODE_FLAG_BCAST (1<<10) +#define DRM_MODE_FLAG_PIXMUX (1<<11) +#define DRM_MODE_FLAG_DBLCLK (1<<12) +#define DRM_MODE_FLAG_CLKDIV2 (1<<13) +#define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14) +#define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (1<<15) +#define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (1<<16) +#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL (1<<17) +#define DRM_MODE_FLAG_3D_L_DEPTH (1<<18) +#define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (1<<19) +#define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (1<<20) +#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (1<<21)/* DPMS flags */ /* bit compatible with the xorg definitions. */
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/22 drm: Add a STEREO_3D capability to the SET_CLIENT_CAP ioctl
In reply to Damien LespiauThis capability allows user space to control the delivery of modes with the 3D flags set. This is to not play games with current user space users not knowing anything about stereo 3D flags and that could try to set a mode with one or several of those bits set.
So, the plan is to remove the stereo modes from the list of modes we give to DRM clients by default, and let them through if we are being told otherwise.
stereo_allowed is bound to the drm_file structure to make it a per-client setting, not a global one.
v2: Replace clearing 3D flags by discarding the stereo modes now that
they are regular modes.
v3: SET_CAP -> SET_CLIENT_CAP rename (Chris Wilson)
--- drivers/gpu/drm/drm_crtc.c | 19 ++++++++++++++++++- drivers/gpu/drm/drm_ioctl.c | 14 +++++++++++++- include/drm/drmP.h | 3 +++ include/uapi/drm/drm.h | 9 +++++++++ 4 files changed, 43 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_crtc.c +18 -1
@@ -1581,6 +1581,19 @@ out:return ret; } +static bool drm_mode_expose_to_userspace (const struct drm_display_mode *mode, +const struct drm_file *file_priv) +{ +/* +* If user-space hasn't configured the driver to expose the stereo 3D +* modes, don't expose them. +*/ +if (!file_priv->stereo_allowed &&drm_mode_is_stereo (mode)) +return false; + +return true; +} +/** * drm_mode_getconnector - get connector configuration * @dev: drm device for the ioctl
@@ -1646,7 +1659,8 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,/* delayed so we get modes regardless of pre-fill_modes state */ list_for_each_entry (mode, &connector->modes, head) - mode_count++; +if (drm_mode_expose_to_userspace (mode, file_priv)) + mode_count++; out_resp->connector_id = connector->base.id; out_resp->connector_type = connector->connector_type;
@@ -1668,6 +1682,9 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, copied =0 ; mode_ptr = (struct drm_mode_modeinfo __user *)(unsigned long )out_resp->modes_ptr;list_for_each_entry (mode, &connector->modes, head) { +if (!drm_mode_expose_to_userspace (mode, file_priv)) +continue ; +drm_crtc_convert_to_umode (&u_mode, mode);if (copy_to_user (mode_ptr + copied, &u_mode,sizeof (u_mode))) {
drivers/gpu/drm/drm_ioctl.c +13 -1
@@ -308,7 +308,19 @@ int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_priv)int drm_setclientcap (struct drm_device *dev,void *data,struct drm_file *file_priv) { -return -EINVAL ; +struct drm_set_client_cap *req = data; + +switch (req->capability) { +case DRM_CLIENT_CAP_STEREO_3D : +if (req->value >1 ) +return -EINVAL ; + file_priv->stereo_allowed = req->value; +break ; +default : +return -EINVAL ; + } + +return 0 ; }/**
include/drm/drmP.h +3 -0
@@ -433,6 +433,9 @@ struct drm_file {struct drm_master *master;/* master this node is currently associated with N.B. not always minor->master */ +/* true when the client has asked us to expose stereo 3D mode flags */ +bool stereo_allowed; +/** * fbs - List of framebuffers associated with this file. *
include/uapi/drm/drm.h +9 -0
@@ -627,6 +627,15 @@ struct drm_get_cap {__u64 value; }; +/** +* DRM_CLIENT_CAP_STEREO_3D +* +* if set to 1, the DRM core will expose the stereo 3D capabilities of the +* monitor by advertising the supported 3D layouts in the flags of struct +* drm_mode_modeinfo. +*/ +#define DRM_CLIENT_CAP_STEREO_3D 1 +/** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ struct drm_set_client_cap {__u64 capability;
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/22 drm/edid: Expose mandatory stereo modes for HDMI sinks
In reply to Damien LespiauFor now, let's just look at the 3D_present flag of the CEA HDMI vendor block to detect if the sink supports a small list of then mandatory 3D formats.
See the HDMI 1.4a 3D extraction for detail:
http://www.hdmi.org/manufacturer/specification.aspx
v2: Rename freq to vrefresh, make the mandatory structure a bit more
compact, fix some white space issues and add a couple of const (Ville Syrjälä)
--- drivers/gpu/drm/drm_edid.c | 110 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 103 insertions(+), 7 deletions(-)
drivers/gpu/drm/drm_edid.c +103 -7
@@ -2553,13 +2553,95 @@ do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len)return modes; } +struct stereo_mandatory_mode { +int width, height, vrefresh; +unsigned int flags; +}; + +static const struct stereo_mandatory_mode stereo_mandatory_modes[] = { + {1920 ,1080 ,24 , +DRM_MODE_FLAG_3D_TOP_AND_BOTTOM |DRM_MODE_FLAG_3D_FRAME_PACKING }, + {1920 ,1080 ,50 , +DRM_MODE_FLAG_INTERLACE |DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF }, + {1920 ,1080 ,60 , +DRM_MODE_FLAG_INTERLACE |DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF }, + {1280 ,720 ,50 , +DRM_MODE_FLAG_3D_TOP_AND_BOTTOM |DRM_MODE_FLAG_3D_FRAME_PACKING }, + {1280 ,720 ,60 , +DRM_MODE_FLAG_3D_TOP_AND_BOTTOM |DRM_MODE_FLAG_3D_FRAME_PACKING } +}; + +static bool +stereo_match_mandatory (const struct drm_display_mode *mode, +const struct stereo_mandatory_mode *stereo_mode) +{ +unsigned int interlaced = mode->flags &DRM_MODE_FLAG_INTERLACE ; + +return mode->hdisplay == stereo_mode->width && + mode->vdisplay == stereo_mode->height && + interlaced == (stereo_mode->flags &DRM_MODE_FLAG_INTERLACE ) && +drm_mode_vrefresh (mode) == stereo_mode->vrefresh; +} + +static const struct stereo_mandatory_mode * +hdmi_find_stereo_mandatory_mode (const struct drm_display_mode *mode) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (stereo_mandatory_modes); i++) +if (stereo_match_mandatory (mode, &stereo_mandatory_modes[i])) +return &stereo_mandatory_modes[i]; + +return NULL ; +} + +static int add_hdmi_mandatory_stereo_modes (struct drm_connector *connector) +{ +struct drm_device *dev = connector->dev; +const struct drm_display_mode *mode; +struct list_head stereo_modes; +int modes =0 ; + +INIT_LIST_HEAD (&stereo_modes); + +list_for_each_entry (mode, &connector->probed_modes, head) { +const struct stereo_mandatory_mode *mandatory; +u32 stereo_layouts, layout; + + mandatory =hdmi_find_stereo_mandatory_mode (mode); +if (!mandatory) +continue ; + + stereo_layouts = mandatory->flags &DRM_MODE_FLAG_3D_MASK ; +do { +struct drm_display_mode *new_mode; + + layout =1 << (ffs (stereo_layouts) -1 ); + stereo_layouts &= ~layout; + + new_mode =drm_mode_duplicate (dev, mode); +if (!new_mode) +continue ; + + new_mode->flags |= layout; +list_add_tail (&new_mode->head, &stereo_modes); + modes++; + }while (stereo_layouts); + } + +list_splice_tail (&stereo_modes, &connector->probed_modes); + +return modes; +} +/* * do_hdmi_vsdb_modes - Parse the HDMI Vendor Specific data block * @connector: connector corresponding to the HDMI sink * @db: start of the CEA vendor specific block * @len: length of the CEA block payload, ie. one can access up to db[len] * -* Parses the HDMI VSDB looking for modes to add to @connector. +* Parses the HDMI VSDB looking for modes to add to @connector. This function +* also adds the stereo 3d modes when applicable. */ static int do_hdmi_vsdb_modes (struct drm_connector *connector,const u8 *db,u8 len)
@@ -2585,10 +2667,15 @@ do_hdmi_vsdb_modes(struct drm_connector *connector, const u8 *db, u8 len)/* the declared length is not long enough for the 2 first bytes * of additional video format capabilities */ - offset +=2 ; -if (len < (8 + offset)) +if (len < (8 + offset +2 )) goto out; +/* 3D_Present */ + offset++; +if (db[8 + offset] & (1 <<7 )) + modes +=add_hdmi_mandatory_stereo_modes (connector); + + offset++; vic_len = db[8 + offset] >>5 ;for (i =0 ; i < vic_len && len >= (9 + offset + i); i++) {
@@ -2668,8 +2755,8 @@ static int add_cea_modes(struct drm_connector *connector, struct edid *edid) { const u8 *cea = drm_find_cea_extension(edid); -const u8 *db; -u8 dbl; +const u8 *db, *hdmi =NULL ; +u8 dbl, hdmi_len;int modes =0 ;if (cea &&cea_revision (cea) >=3 ) {
@@ -2684,11 +2771,20 @@ add_cea_modes(struct drm_connector *connector, struct edid *edid)if (cea_db_tag (db) ==VIDEO_BLOCK ) modes +=do_cea_modes (connector, db +1 , dbl); -else if (cea_db_is_hdmi_vsdb (db)) - modes +=do_hdmi_vsdb_modes (connector, db, dbl); +else if (cea_db_is_hdmi_vsdb (db)) { + hdmi = db; + hdmi_len = dbl; + } } } +/* +* We parse the HDMI VSDB after having added the cea modes as we will +* be patching their flags when the sink supports stereo 3D. +*/ +if (hdmi) + modes +=do_hdmi_vsdb_modes (connector, hdmi, hdmi_len); +return modes; }
Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 6/22 drm: Extract add_hdmi_mode() out of do_hdmi_vsdb_modes()
In reply to Damien LespiauSo we respect a nice design of having similar functions at the same level, in this case:
do_hdmi_vsdb_modes()
- add_hdmi_mandatory_stereo_modes()
- add_hdmi_mode()
--- drivers/gpu/drm/drm_edid.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-)
drivers/gpu/drm/drm_edid.c +21 -15
@@ -2634,6 +2634,26 @@ static int add_hdmi_mandatory_stereo_modes(struct drm_connector *connector)return modes; } +static int add_hdmi_mode (struct drm_connector *connector,u8 vic) +{ +struct drm_device *dev = connector->dev; +struct drm_display_mode *newmode; + + vic--;/* VICs start at 1 */ +if (vic >=ARRAY_SIZE (edid_4k_modes)) { +DRM_ERROR ("Unknown HDMI VIC: %d\n" , vic); +return 0 ; + } + + newmode =drm_mode_duplicate (dev, &edid_4k_modes[vic]); +if (!newmode) +return 0 ; + +drm_mode_probed_add (connector, newmode); + +return 1 ; +} +/* * do_hdmi_vsdb_modes - Parse the HDMI Vendor Specific data block * @connector: connector corresponding to the HDMI sink
@@ -2646,7 +2666,6 @@ static int add_hdmi_mandatory_stereo_modes(struct drm_connector *connector)static int do_hdmi_vsdb_modes (struct drm_connector *connector,const u8 *db,u8 len) { -struct drm_device *dev = connector->dev;int modes =0 , offset =0 , i;u8 vic_len;
@@ -2679,23 +2698,10 @@ do_hdmi_vsdb_modes(struct drm_connector *connector, const u8 *db, u8 len) vic_len = db[8 + offset] >>5 ;for (i =0 ; i < vic_len && len >= (9 + offset + i); i++) { -struct drm_display_mode *newmode;u8 vic; vic = db[9 + offset + i]; - - vic--;/* VICs start at 1 */ -if (vic >=ARRAY_SIZE (edid_4k_modes)) { -DRM_ERROR ("Unknown HDMI VIC: %d\n" , vic); -continue ; - } - - newmode =drm_mode_duplicate (dev, &edid_4k_modes[vic]); -if (!newmode) -continue ; - -drm_mode_probed_add (connector, newmode); - modes++; + modes +=add_hdmi_mode (connector, vic); } out:
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/22 drm: Reject modes with more than 1 stereo flags set
In reply to Damien LespiauWhen setting a stereo 3D mode, there can be only one bit set describing the layout of the frambuffer(s). So reject invalid modes early.
--- drivers/gpu/drm/drm_crtc.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/drm_crtc.c +4 -0
@@ -1319,6 +1319,10 @@ static int drm_crtc_convert_umode(struct drm_display_mode *out,if (in->clock >INT_MAX || in->vrefresh >INT_MAX )return -ERANGE ; +/* At most, 1 set bit describing the 3D layout of the mode */ +if (hweight32 (in->flags &DRM_MODE_FLAG_3D_MASK ) >1 ) +return -EINVAL ; + out->clock = in->clock; out->hdisplay = in->hdisplay; out->hsync_start = in->hsync_start;
Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 8/22 drm: Set the relevant infoframe field when scanning out a 3D mode
In reply to Damien LespiauWhen scanning out a 3D mode on HDMI, we need to send an HDMI infoframe with the corresponding layout to the sink.
v2: Make s3d_structure_from_display_mode() less subtle (Ville Syrjälä)
--- drivers/gpu/drm/drm_edid.c | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_edid.c +38 -2
@@ -3421,6 +3421,33 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, }EXPORT_SYMBOL (drm_hdmi_avi_infoframe_from_display_mode); +static enum hdmi_3d_structure +s3d_structure_from_display_mode (const struct drm_display_mode *mode) +{ +u32 layout = mode->flags &DRM_MODE_FLAG_3D_MASK ; + +switch (layout) { +case DRM_MODE_FLAG_3D_FRAME_PACKING : +return HDMI_3D_STRUCTURE_FRAME_PACKING ; +case DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE : +return HDMI_3D_STRUCTURE_FIELD_ALTERNATIVE ; +case DRM_MODE_FLAG_3D_LINE_ALTERNATIVE : +return HDMI_3D_STRUCTURE_LINE_ALTERNATIVE ; +case DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL : +return HDMI_3D_STRUCTURE_SIDE_BY_SIDE_FULL ; +case DRM_MODE_FLAG_3D_L_DEPTH : +return HDMI_3D_STRUCTURE_L_DEPTH ; +case DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH : +return HDMI_3D_STRUCTURE_L_DEPTH_GFX_GFX_DEPTH ; +case DRM_MODE_FLAG_3D_TOP_AND_BOTTOM : +return HDMI_3D_STRUCTURE_TOP_AND_BOTTOM ; +case DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF : +return HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF ; +default : +return HDMI_3D_STRUCTURE_INVALID ; + } +} +/** * drm_hdmi_vendor_infoframe_from_display_mode() - fill an HDMI infoframe with * data from a DRM display mode
@@ -3438,20 +3465,29 @@ drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame, const struct drm_display_mode *mode) {int err; +u32 s3d_flags;u8 vic;if (!frame || !mode)return -EINVAL ; vic =drm_match_hdmi_mode (mode); -if (!vic) + s3d_flags = mode->flags &DRM_MODE_FLAG_3D_MASK ; + +if (!vic && !s3d_flags) +return -EINVAL ; + +if (vic && s3d_flags)return -EINVAL ; err =hdmi_vendor_infoframe_init (frame);if (err <0 )return err; - frame->vic = vic; +if (vic) + frame->vic = vic; +else + frame->s3d_struct =s3d_structure_from_display_mode (mode);return 0 ; }
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/22 drm: Make drm_match_cea_mode() return the underlying 2D VIC for 3d modes
In reply to Damien LespiauWhen scanning out a stereo mode, the AVI infoframe vic field has to be the underlyng 2D VIC. Before that commit, we weren't matching the CEA mode because of the extra stereo flag and then were setting the VIC field in the AVI infoframe to 0.
--- drivers/gpu/drm/drm_edid.c | 4 ++-- drivers/gpu/drm/drm_modes.c | 18 ++++++++++++------ include/drm/drm_crtc.h | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-)
drivers/gpu/drm/drm_edid.c +2 -2
@@ -2404,7 +2404,7 @@ u8 drm_match_cea_mode(const struct drm_display_mode *to_match)if ((KHZ2PICOS (to_match->clock) ==KHZ2PICOS (clock1) ||KHZ2PICOS (to_match->clock) ==KHZ2PICOS (clock2)) && -drm_mode_equal_no_clocks (to_match, cea_mode)) +drm_mode_equal_no_clocks_no_stereo (to_match, cea_mode))return mode +1 ; }return 0 ;
@@ -2453,7 +2453,7 @@ static u8 drm_match_hdmi_mode(const struct drm_display_mode *to_match)if ((KHZ2PICOS (to_match->clock) ==KHZ2PICOS (clock1) ||KHZ2PICOS (to_match->clock) ==KHZ2PICOS (clock2)) && -drm_mode_equal_no_clocks (to_match, hdmi_mode)) +drm_mode_equal_no_clocks_no_stereo (to_match, hdmi_mode))return mode +1 ; }return 0 ;
drivers/gpu/drm/drm_modes.c +12 -6
@@ -830,12 +830,16 @@ bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_displ }else if (mode1->clock != mode2->clock)return false; -return drm_mode_equal_no_clocks (mode1, mode2); +if ((mode1->flags &DRM_MODE_FLAG_3D_MASK ) != + (mode2->flags &DRM_MODE_FLAG_3D_MASK )) +return false; + +return drm_mode_equal_no_clocks_no_stereo (mode1, mode2); }EXPORT_SYMBOL (drm_mode_equal);/** -* drm_mode_equal_no_clocks - test modes for equality +* drm_mode_equal_no_clocks_no_stereo - test modes for equality * @mode1: first mode * @mode2: second mode *
@@ -843,12 +847,13 @@ EXPORT_SYMBOL(drm_mode_equal);* None. * * Check to see if @mode1 and @mode2 are equivalent, but -* don't check the pixel clocks. +* don't check the pixel clocks nor the stereo layout. * * RETURNS: * True if the modes are equal, false otherwise. */ -bool drm_mode_equal_no_clocks (const struct drm_display_mode *mode1,const struct drm_display_mode *mode2) +bool drm_mode_equal_no_clocks_no_stereo (const struct drm_display_mode *mode1, +const struct drm_display_mode *mode2) { if (mode1->hdisplay == mode2->hdisplay && mode1->hsync_start == mode2->hsync_start &&
@@ -860,12 +865,13 @@ bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct mode1->vsync_end == mode2->vsync_end && mode1->vtotal == mode2->vtotal && mode1->vscan == mode2->vscan && - mode1->flags == mode2->flags) + (mode1->flags & ~DRM_MODE_FLAG_3D_MASK ) == + (mode2->flags & ~DRM_MODE_FLAG_3D_MASK)) return true;return false; } -EXPORT_SYMBOL (drm_mode_equal_no_clocks); +EXPORT_SYMBOL (drm_mode_equal_no_clocks_no_stereo);/** * drm_mode_validate_size - make sure modes adhere to size constraints
include/drm/drm_crtc.h +1 -1
@@ -989,7 +989,7 @@ extern void drm_mode_config_reset(struct drm_device *dev);extern void drm_mode_config_cleanup (struct drm_device *dev);extern void drm_mode_set_name (struct drm_display_mode *mode);extern bool drm_mode_equal (const struct drm_display_mode *mode1,const struct drm_display_mode *mode2); -extern bool drm_mode_equal_no_clocks (const struct drm_display_mode *mode1,const struct drm_display_mode *mode2); +extern bool drm_mode_equal_no_clocks_no_stereo (const struct drm_display_mode *mode1,const struct drm_display_mode *mode2);extern int drm_mode_width (const struct drm_display_mode *mode);extern int drm_mode_height (const struct drm_display_mode *mode);
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/22 drm: Carry over the stereo flags when adding the alternate mode
In reply to Damien LespiauThis allows to expose the alternate clock versions of the stereo modes.
--- drivers/gpu/drm/drm_edid.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_edid.c +3 -0
@@ -2507,6 +2507,9 @@ add_alternate_cea_modes(struct drm_connector *connector, struct edid *edid)if (!newmode)continue ; +/* Carry over the stereo flags */ + newmode->flags |= mode->flags &DRM_MODE_FLAG_3D_MASK ; +/* * The current mode could be either variant. Make * sure to pick the "other" clock for the new mode.
Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 11/22 drm: Make exposing stereo modes a per-connector opt-in
In reply to Damien LespiauJust like with interlaced or double scan modes, make stereo modes a per-connector opt-in to give a chance to driver authors to make it work before enabling it.
--- drivers/gpu/drm/drm_crtc_helper.c | 8 +++++++- include/drm/drm_crtc.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_crtc_helper.c +7 -1
@@ -76,7 +76,8 @@ static void drm_mode_validate_flag(struct drm_connector *connector, {struct drm_display_mode *mode; -if (flags == (DRM_MODE_FLAG_DBLSCAN |DRM_MODE_FLAG_INTERLACE )) +if (flags == (DRM_MODE_FLAG_DBLSCAN |DRM_MODE_FLAG_INTERLACE | +DRM_MODE_FLAG_3D_MASK ))return ;list_for_each_entry (mode, &connector->modes, head) {
@@ -86,6 +87,9 @@ static void drm_mode_validate_flag(struct drm_connector *connector,if ((mode->flags &DRM_MODE_FLAG_DBLSCAN ) && !(flags &DRM_MODE_FLAG_DBLSCAN )) mode->status =MODE_NO_DBLESCAN ; +if ((mode->flags &DRM_MODE_FLAG_3D_MASK ) && + !(flags &DRM_MODE_FLAG_3D_MASK )) + mode->status =MODE_NO_STEREO ; }return ;
@@ -175,6 +179,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, mode_flags |=DRM_MODE_FLAG_INTERLACE ;if (connector->doublescan_allowed) mode_flags |=DRM_MODE_FLAG_DBLSCAN ; +if (connector->stereo_allowed) + mode_flags |=DRM_MODE_FLAG_3D_MASK ;drm_mode_validate_flag (connector, mode_flags);list_for_each_entry (mode, &connector->modes, head) {
include/drm/drm_crtc.h +2 -0
@@ -108,6 +108,7 @@ enum drm_mode_status {MODE_ONE_HEIGHT ,/* only one height is supported */ MODE_ONE_SIZE ,/* only one resolution is supported */ MODE_NO_REDUCED ,/* monitor doesn't accept reduced blanking */ +MODE_NO_STEREO ,/* stereo modes not supported */ MODE_UNVERIFIED =-3 ,/* mode needs to reverified */ MODE_BAD =-2 ,/* unspecified reason */ MODE_ERROR =-1 /* error condition */
@@ -611,6 +612,7 @@ struct drm_connector {int connector_type_id;bool interlace_allowed;bool doublescan_allowed; +bool stereo_allowed;struct list_head modes;/* list of modes on this connector */ enum drm_connector_status status;
Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 12/22 drm: Factor out common CRTC viewport checking code
In reply to Damien LespiauBoth setcrtc and page_flip are checking that the framebuffer is big enough for the defined crtc viewport (x, y, hdisplay, vdisplay). Factor that code out in a single function.
--- drivers/gpu/drm/drm_crtc.c | 70 ++++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 33 deletions(-)
drivers/gpu/drm/drm_crtc.c +37 -33
@@ -2063,6 +2063,37 @@ int drm_mode_set_config_internal(struct drm_mode_set *set) }EXPORT_SYMBOL (drm_mode_set_config_internal); +/* +* Checks that the framebuffer is big enough for the CRTC viewport +* (x, y, hdisplay, vdisplay) +*/ +static int drm_crtc_check_viewport (const struct drm_crtc *crtc, +int x,int y, +const struct drm_display_mode *mode, +const struct drm_framebuffer *fb) + +{ +int hdisplay, vdisplay; + + hdisplay = mode->hdisplay; + vdisplay = mode->vdisplay; + +if (crtc->invert_dimensions) +swap (hdisplay, vdisplay); + +if (hdisplay > fb->width || + vdisplay > fb->height || + x > fb->width - hdisplay || + y > fb->height - vdisplay) { +DRM_DEBUG_KMS ("Invalid fb size %ux%u for CRTC viewport %ux%u+%d+%d%s.\n" , + fb->width, fb->height, hdisplay, vdisplay, x, y, + crtc->invert_dimensions ?" (inverted)" :"" ); +return -ENOSPC ; + } + +return 0 ; +} +/** * drm_mode_setcrtc - set CRTC configuration * @dev: drm device for the ioctl
@@ -2110,7 +2141,6 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,DRM_DEBUG_KMS ("[CRTC:%d]\n" , crtc->base.id);if (crtc_req->mode_valid) { -int hdisplay, vdisplay;/* If we have a mode we need a framebuffer. */ /* If we pass -1, set the mode with the currently bound fb */ if (crtc_req->fb_id ==-1 ) {
@@ -2146,23 +2176,11 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,drm_mode_set_crtcinfo (mode,CRTC_INTERLACE_HALVE_V ); - hdisplay = mode->hdisplay; - vdisplay = mode->vdisplay; - -if (crtc->invert_dimensions) -swap (hdisplay, vdisplay); - -if (hdisplay > fb->width || - vdisplay > fb->height || - crtc_req->x > fb->width - hdisplay || - crtc_req->y > fb->height - vdisplay) { -DRM_DEBUG_KMS ("Invalid fb size %ux%u for CRTC viewport %ux%u+%d+%d%s.\n" , - fb->width, fb->height, - hdisplay, vdisplay, crtc_req->x, crtc_req->y, - crtc->invert_dimensions ?" (inverted)" :"" ); - ret = -ENOSPC ; + ret =drm_crtc_check_viewport (crtc, crtc_req->x, crtc_req->y, + mode, fb); +if (ret) goto out; - } + }if (crtc_req->count_connectors ==0 && mode) {
@@ -3579,7 +3597,6 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,struct drm_framebuffer *fb =NULL , *old_fb =NULL ;struct drm_pending_vblank_event *e =NULL ;unsigned long flags; -int hdisplay, vdisplay;int ret = -EINVAL ; if (page_flip->flags & ~DRM_MODE_PAGE_FLIP_FLAGS ||
@@ -3611,22 +3628,9 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,if (!fb) goto out; - hdisplay = crtc->mode.hdisplay; - vdisplay = crtc->mode.vdisplay; - -if (crtc->invert_dimensions) -swap (hdisplay, vdisplay); - -if (hdisplay > fb->width || - vdisplay > fb->height || - crtc->x > fb->width - hdisplay || - crtc->y > fb->height - vdisplay) { -DRM_DEBUG_KMS ("Invalid fb size %ux%u for CRTC viewport %ux%u+%d+%d%s.\n" , - fb->width, fb->height, hdisplay, vdisplay, crtc->x, crtc->y, - crtc->invert_dimensions ?" (inverted)" :"" ); - ret = -ENOSPC ; + ret =drm_crtc_check_viewport (crtc, crtc->x, crtc->y, &crtc->mode, fb); +if (ret) goto out; - }if (crtc->fb->pixel_format != fb->pixel_format) {DRM_DEBUG_KMS ("Page flip is not allowed to change frame buffer format.\n" );
Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 13/22 drm: Check the fb size against the adjusted v/hdisplay for stereo modes
In reply to Damien LespiauSome stereo modes, like frame packing, need a larger CRTC viewport than the "natural" underlying 2D mode and thus drm_crtc_check_viewport() needs to query the adjusted mode to use the correct h/vdisplay.
--- drivers/gpu/drm/drm_crtc.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/drm_crtc.c +8 -0
@@ -2078,6 +2078,14 @@ static int drm_crtc_check_viewport(const struct drm_crtc *crtc, hdisplay = mode->hdisplay; vdisplay = mode->vdisplay; +if (drm_mode_is_stereo (mode)) { +struct drm_display_mode adjusted = *mode; + +drm_mode_set_crtcinfo (&adjusted,CRTC_STEREO_DOUBLE ); + hdisplay = adjusted.crtc_hdisplay; + vdisplay = adjusted.crtc_vdisplay; + } +if (crtc->invert_dimensions)swap (hdisplay, vdisplay);
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 14/22 drm: Remove clock_index from struct drm_display_mode
In reply to Damien LespiauThis field was only accessed by the nouveau driver, but never set. So concluded we can rid of this one.
--- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 2 -- include/drm/drm_crtc.h | 1 - 2 files changed, 3 deletions(-)
drivers/gpu/drm/nouveau/dispnv04/crtc.c +0 -2
@@ -326,8 +326,6 @@ nv_crtc_mode_set_vga(struct drm_crtc *crtc, struct drm_display_mode *mode) regp->MiscOutReg =0x23 ;/* +hsync +vsync */ } - regp->MiscOutReg |= (mode->clock_index &0x03 ) <<2 ; -/* * Time Sequencer */
include/drm/drm_crtc.h +0 -1
@@ -156,7 +156,6 @@ struct drm_display_mode {int height_mm;/* Actual mode we give to hw */ -int clock_index;int synth_clock;int crtc_hdisplay;int crtc_hblank_start;
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 15/22 drm: Remove synth_clock from struct drm_display_mode
In reply to Damien LespiauThis field is unused. Garbage collect it.
--- include/drm/drm_crtc.h | 1 - 1 file changed, 1 deletion(-)
include/drm/drm_crtc.h +0 -1
@@ -156,7 +156,6 @@ struct drm_display_mode {int height_mm;/* Actual mode we give to hw */ -int synth_clock;int crtc_hdisplay;int crtc_hblank_start;int crtc_hblank_end;
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 16/22 drm: Introduce a crtc_clock for struct drm_display_mode
In reply to Damien LespiauJust like the various timings, make it possible to have a clock field what we can tweak before giving it to hardware.
--- drivers/gpu/drm/drm_modes.c | 1 + include/drm/drm_crtc.h | 1 + 2 files changed, 2 insertions(+)
drivers/gpu/drm/drm_modes.c +1 -0
@@ -719,6 +719,7 @@ void drm_mode_set_crtcinfo(struct drm_display_mode *p, int adjust_flags)if ((p ==NULL ) || ((p->type &DRM_MODE_TYPE_CRTC_C ) ==DRM_MODE_TYPE_BUILTIN ))return ; + p->crtc_clock = p->clock; p->crtc_hdisplay = p->hdisplay; p->crtc_hsync_start = p->hsync_start; p->crtc_hsync_end = p->hsync_end;
include/drm/drm_crtc.h +1 -0
@@ -156,6 +156,7 @@ struct drm_display_mode {int height_mm;/* Actual mode we give to hw */ +int crtc_clock;/* in KHz */ int crtc_hdisplay;int crtc_hblank_start;int crtc_hblank_end;
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 17/22 drm: Implement timings adjustments for frame packing
In reply to Damien LespiauWhen using the frame packing and a single big framebuffer, some hardware requires that we do everything like if we were scanning out the big buffer itself. Let's instrument drm_mode_set_crtcinfo() to be able to do this adjustement if the driver is asking for it.
v2: Use crtc_vtotal and multiply the clock by 2 instead of
reconstructing it (Ville Syrjälä)
--- drivers/gpu/drm/drm_modes.c | 22 +++++++++++++++++++++- include/drm/drm_crtc.h | 3 ++- 2 files changed, 23 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_modes.c +21 -1
@@ -707,12 +707,18 @@ EXPORT_SYMBOL(drm_mode_vrefresh);/** * drm_mode_set_crtcinfo - set CRTC modesetting parameters * @p: mode -* @adjust_flags: unused? (FIXME) +* @adjust_flags: a combination of adjustment flags * * LOCKING: * None. * * Setup the CRTC modesetting parameters for @p, adjusting if necessary. +* +* - The CRTC_INTERLACE_HALVE_V flag can be used to halve vertical timings of +* interlaced modes. +* - The CRTC_STEREO_DOUBLE flag can be used to compute the timings for +* buffers containing two eyes (only adjust the timings when needed, eg. for +* "frame packing" or "side by side full"). */ void drm_mode_set_crtcinfo (struct drm_display_mode *p,int adjust_flags) {
@@ -753,6 +759,20 @@ void drm_mode_set_crtcinfo(struct drm_display_mode *p, int adjust_flags) p->crtc_vtotal *= p->vscan; } +if (adjust_flags &CRTC_STEREO_DOUBLE ) { +unsigned int layout = p->flags &DRM_MODE_FLAG_3D_MASK ; + +switch (layout) { +case DRM_MODE_FLAG_3D_FRAME_PACKING : + p->crtc_clock *=2 ; + p->crtc_vdisplay += p->crtc_vtotal; + p->crtc_vsync_start += p->crtc_vtotal; + p->crtc_vsync_end += p->crtc_vtotal; + p->crtc_vtotal += p->crtc_vtotal; +break ; + } + } + p->crtc_vblank_start =min (p->crtc_vsync_start, p->crtc_vdisplay); p->crtc_vblank_end =max (p->crtc_vsync_end, p->crtc_vtotal); p->crtc_hblank_start =min (p->crtc_hsync_start, p->crtc_hdisplay);
include/drm/drm_crtc.h +2 -1
@@ -125,7 +125,8 @@ enum drm_mode_status { .vscan = (vs), .flags = (f), \ .base.type = DRM_MODE_OBJECT_MODE -#define CRTC_INTERLACE_HALVE_V 0x1/* halve V values for interlacing */ +#define CRTC_INTERLACE_HALVE_V (1 << 0)/* halve V values for interlacing */ +#define CRTC_STEREO_DOUBLE (1 << 1)/* adjust timings for stereo modes */ struct drm_display_mode {/* Header */
Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 18/22 drm/i915: Use crtc_clock in intel_dump_crtc_timings()
In reply to Damien LespiauWe want to dump the parameters given to the hardware, so let's use crtc_clock here.
--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -8310,7 +8310,7 @@ static void intel_dump_crtc_timings(const struct drm_display_mode *mode) { DRM_DEBUG_KMS("crtc timings: %d %d %d %d %d %d %d %d %d, " "type: 0x%x flags: 0x%x\n", - mode->clock, + mode->crtc_clock, mode->crtc_hdisplay, mode->crtc_hsync_start, mode->crtc_hsync_end, mode->crtc_htotal, mode->crtc_vdisplay, mode->crtc_vsync_start,
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 19/22 drm/i915: Use crtc_clock with the adjusted mode
In reply to Damien Lespiaustruct drm_mode_display now has a separate crtc_ version of the clock to be used when we're talking about the timings given to the harwadre (was far as the mode is concerned).
This commit is really the result of a git grep adjusted_mode.*clock and replacing those by adjusted_mode.crtc_clock. No functional change.
v2: Rebased on drm-intel-queued-next
--- drivers/gpu/drm/i915/intel_crt.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 34 +++++++++++++++++----------------- drivers/gpu/drm/i915/intel_dp.c | 11 +++++++---- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_dvo.c | 2 +- drivers/gpu/drm/i915/intel_hdmi.c | 6 +++--- drivers/gpu/drm/i915/intel_lvds.c | 2 +- drivers/gpu/drm/i915/intel_pm.c | 36 +++++++++++++++++++++++------------- drivers/gpu/drm/i915/intel_sdvo.c | 2 +- drivers/gpu/drm/i915/intel_tv.c | 2 +- 10 files changed, 56 insertions(+), 43 deletions(-)
drivers/gpu/drm/i915/intel_crt.c +1 -1
@@ -117,7 +117,7 @@ static void intel_crt_get_config(struct intel_encoder *encoder,if (HAS_PCH_SPLIT (dev))ironlake_check_encoder_dotclock (pipe_config, dotclock); - pipe_config->adjusted_mode.clock = dotclock; + pipe_config->adjusted_mode.crtc_clock = dotclock; } static void hsw_crt_get_config(struct intel_encoder *encoder,
drivers/gpu/drm/i915/intel_display.c +17 -17
@@ -739,14 +739,14 @@ bool intel_crtc_active(struct drm_crtc *crtc)/* Be paranoid as we can arrive here with only partial * state retrieved from the hardware during setup. * -* We can ditch the adjusted_mode.clock check as soon +* We can ditch the adjusted_mode.crtc_clock check as soon * as Haswell has gained clock readout/fastboot support. * * We can ditch the crtc->fb check as soon as we can * properly reconstruct framebuffers. */ return intel_crtc->active && crtc->fb && - intel_crtc->config.adjusted_mode.clock; + intel_crtc->config.adjusted_mode.crtc_clock; } enum transcoder intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv,
@@ -2913,7 +2913,7 @@ static void lpt_program_iclkip(struct drm_crtc *crtc) {struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv = dev->dev_private; -int clock =to_intel_crtc (crtc)->config.adjusted_mode.clock; +int clock =to_intel_crtc (crtc)->config.adjusted_mode.crtc_clock;u32 divsel, phaseinc, auxdiv, phasedir =0 ;u32 temp;
@@ -2937,8 +2937,8 @@ static void lpt_program_iclkip(struct drm_crtc *crtc) phaseinc =0x20 ; }else {/* The iCLK virtual clock root frequency is in MHz, -* but the adjusted_mode->clock in in KHz. To get the divisors, -* it is necessary to divide one by another, so we +* but the adjusted_mode->crtc_clock in in KHz. To get the +* divisors, it is necessary to divide one by another, so we * convert the virtual clock precision to KHz here for higher * precision. */
@@ -4148,7 +4148,7 @@ retry:*/ link_bw =intel_fdi_link_freq (dev) *MHz (100 )/KHz (1 )/10 ; - fdi_dotclock = adjusted_mode->clock; + fdi_dotclock = adjusted_mode->crtc_clock; lane =ironlake_get_lanes_required (fdi_dotclock, link_bw, pipe_config->pipe_bpp);
@@ -4204,12 +4204,12 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* otherwise pipe A only. */ if ((crtc->pipe ==PIPE_A ||IS_I915G (dev)) && - adjusted_mode->clock > clock_limit *9 /10 ) { + adjusted_mode->crtc_clock > clock_limit *9 /10 ) { clock_limit *=2 ; pipe_config->double_wide = true; } -if (adjusted_mode->clock > clock_limit *9 /10 ) +if (adjusted_mode->crtc_clock > clock_limit *9 /10 )return -EINVAL ; }
@@ -4869,7 +4869,7 @@ static void intel_crtc_mode_from_pipe_config(struct intel_crtc *intel_crtc, crtc->mode.flags = pipe_config->adjusted_mode.flags; - crtc->mode.clock = pipe_config->adjusted_mode.clock; + crtc->mode.clock = pipe_config->adjusted_mode.crtc_clock; crtc->mode.flags |= pipe_config->adjusted_mode.flags; }
@@ -7440,7 +7440,7 @@ static void i9xx_crtc_clock_get(struct intel_crtc *crtc,/* * This value includes pixel_multiplier. We will use -* port_clock to compute adjusted_mode.clock in the +* port_clock to compute adjusted_mode.crtc_clock in the * encoder's get_config() function. */ pipe_config->port_clock = clock.dot;
@@ -7475,11 +7475,11 @@ static void ironlake_pch_clock_get(struct intel_crtc *crtc,/* * This value does not include pixel_multiplier. -* We will check that port_clock and adjusted_mode.clock +* We will check that port_clock and adjusted_mode.crtc_clock * agree once we know their relationship in the encoder's * get_config() function. */ - pipe_config->adjusted_mode.clock = + pipe_config->adjusted_mode.crtc_clock =intel_dotclock_calculate (intel_fdi_link_freq (dev) *10000 , &pipe_config->fdi_m_n); }
@@ -8456,8 +8456,8 @@ encoder_retry:/* Set default port clock if not overwritten by the encoder. Needs to be * done afterwards in case the encoder adjusts the mode. */ if (!pipe_config->port_clock) - pipe_config->port_clock = pipe_config->adjusted_mode.clock * - pipe_config->pixel_multiplier; + pipe_config->port_clock = pipe_config->adjusted_mode.crtc_clock + * pipe_config->pixel_multiplier; ret =intel_crtc_compute_config (to_intel_crtc (crtc), pipe_config);if (ret <0 ) {
@@ -8787,7 +8787,7 @@ intel_pipe_config_compare(struct drm_device *dev,PIPE_CONF_CHECK_I (pipe_bpp);if (!IS_HASWELL (dev)) { -PIPE_CONF_CHECK_CLOCK_FUZZY (adjusted_mode.clock); +PIPE_CONF_CHECK_CLOCK_FUZZY (adjusted_mode.crtc_clock);PIPE_CONF_CHECK_CLOCK_FUZZY (port_clock); }
@@ -9009,9 +9009,9 @@ void ironlake_check_encoder_dotclock(const struct intel_crtc_config *pipe_config* FDI already provided one idea for the dotclock. * Yell if the encoder disagrees. */ -WARN (!intel_fuzzy_clock_check (pipe_config->adjusted_mode.clock, dotclock), +WARN (!intel_fuzzy_clock_check (pipe_config->adjusted_mode.crtc_clock, dotclock),"FDI dotclock and encoder dotclock mismatch, fdi: %i, encoder: %i\n" , - pipe_config->adjusted_mode.clock, dotclock); + pipe_config->adjusted_mode.crtc_clock, dotclock); } static int __intel_set_mode(struct drm_crtc *crtc,
drivers/gpu/drm/i915/intel_dp.c +7 -4
@@ -800,7 +800,8 @@ intel_dp_compute_config(struct intel_encoder *encoder,DRM_DEBUG_KMS ("DP link computation with max lane count %i " "max bw %02x pixel clock %iKHz\n" , - max_lane_count, bws[max_clock], adjusted_mode->clock); + max_lane_count, bws[max_clock], + adjusted_mode->crtc_clock);/* Walk through all bpp values. Luckily they're all nicely spaced with 2 * bpc in between. */
@@ -812,7 +813,8 @@ intel_dp_compute_config(struct intel_encoder *encoder, }for (; bpp >=6 *3 ; bpp -=2 *3 ) { - mode_rate =intel_dp_link_required (adjusted_mode->clock, bpp); + mode_rate =intel_dp_link_required (adjusted_mode->crtc_clock, + bpp);for (clock =0 ; clock <= max_clock; clock++) {for (lane_count =1 ; lane_count <= max_lane_count; lane_count <<=1 ) {
@@ -857,7 +859,8 @@ found: mode_rate, link_avail);intel_link_compute_m_n (bpp, lane_count, - adjusted_mode->clock, pipe_config->port_clock, + adjusted_mode->crtc_clock, + pipe_config->port_clock, &pipe_config->dp_m_n);intel_dp_set_clock (encoder, pipe_config, intel_dp->link_bw);
@@ -1472,7 +1475,7 @@ static void intel_dp_get_config(struct intel_encoder *encoder,if (HAS_PCH_SPLIT (dev_priv->dev) && port !=PORT_A )ironlake_check_encoder_dotclock (pipe_config, dotclock); - pipe_config->adjusted_mode.clock = dotclock; + pipe_config->adjusted_mode.crtc_clock = dotclock; }static bool is_edp_psr (struct intel_dp *intel_dp)
drivers/gpu/drm/i915/intel_drv.h +1 -1
@@ -217,7 +217,7 @@ struct intel_crtc_config {* preferred input timings. */ struct drm_display_mode requested_mode;/* Actual pipe timings ie. what we program into the pipe timing -* registers. adjusted_mode.clock is the pipe pixel clock. */ +* registers. adjusted_mode.crtc_clock is the pipe pixel clock. */ struct drm_display_mode adjusted_mode;/* Pipe source size (ie. panel fitter input size)
drivers/gpu/drm/i915/intel_dvo.c +1 -1
@@ -154,7 +154,7 @@ static void intel_dvo_get_config(struct intel_encoder *encoder, pipe_config->adjusted_mode.flags |= flags; - pipe_config->adjusted_mode.clock = pipe_config->port_clock; + pipe_config->adjusted_mode.crtc_clock = pipe_config->port_clock; }static void intel_disable_dvo (struct intel_encoder *encoder)
drivers/gpu/drm/i915/intel_hdmi.c +3 -3
@@ -737,7 +737,7 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder,if (HAS_PCH_SPLIT (dev_priv->dev))ironlake_check_encoder_dotclock (pipe_config, dotclock); - pipe_config->adjusted_mode.clock = dotclock; + pipe_config->adjusted_mode.crtc_clock = dotclock; }static void intel_enable_hdmi (struct intel_encoder *encoder)
@@ -873,7 +873,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base);struct drm_device *dev = encoder->base.dev;struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode; -int clock_12bpc = pipe_config->adjusted_mode.clock *3 /2 ; +int clock_12bpc = pipe_config->adjusted_mode.crtc_clock *3 /2 ;int portclock_limit =hdmi_portclock_limit (intel_hdmi);int desired_bpp;
@@ -915,7 +915,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder, pipe_config->pipe_bpp = desired_bpp; } -if (adjusted_mode->clock > portclock_limit) { +if (adjusted_mode->crtc_clock > portclock_limit) {DRM_DEBUG_KMS ("too high HDMI clock, rejecting mode\n" );return false; }
drivers/gpu/drm/i915/intel_lvds.c +1 -1
@@ -123,7 +123,7 @@ static void intel_lvds_get_config(struct intel_encoder *encoder,if (HAS_PCH_SPLIT (dev_priv->dev))ironlake_check_encoder_dotclock (pipe_config, dotclock); - pipe_config->adjusted_mode.clock = dotclock; + pipe_config->adjusted_mode.crtc_clock = dotclock; }/* The LVDS pin pair needs to be on before the DPLLs are enabled.
drivers/gpu/drm/i915/intel_pm.c +23 -13
@@ -1100,8 +1100,12 @@ static void pineview_update_wm(struct drm_crtc *unused_crtc) crtc =single_enabled_crtc (dev);if (crtc) { -int clock =to_intel_crtc (crtc)->config.adjusted_mode.clock; +const struct drm_display_mode *adjusted_mode;int pixel_size = crtc->fb->bits_per_pixel /8 ; +int clock; + + adjusted_mode = &to_intel_crtc (crtc)->config.adjusted_mode; + clock = adjusted_mode->crtc_clock;/* Display SR */ wm = intel_calculate_wm(clock, &pineview_display_wm,
@@ -1174,7 +1178,7 @@ static bool g4x_compute_wm0(struct drm_device *dev, } adjusted_mode = &to_intel_crtc (crtc)->config.adjusted_mode; - clock = adjusted_mode->clock; + clock = adjusted_mode->crtc_clock; htotal = adjusted_mode->htotal; hdisplay =to_intel_crtc (crtc)->config.pipe_src_w; pixel_size = crtc->fb->bits_per_pixel /8 ;
@@ -1261,7 +1265,7 @@ static bool g4x_compute_srwm(struct drm_device *dev, crtc =intel_get_crtc_for_plane (dev, plane); adjusted_mode = &to_intel_crtc (crtc)->config.adjusted_mode; - clock = adjusted_mode->clock; + clock = adjusted_mode->crtc_clock; htotal = adjusted_mode->htotal; hdisplay =to_intel_crtc (crtc)->config.pipe_src_w; pixel_size = crtc->fb->bits_per_pixel /8 ;
@@ -1302,7 +1306,7 @@ static bool vlv_compute_drain_latency(struct drm_device *dev,if (!intel_crtc_active (crtc))return false; - clock =to_intel_crtc (crtc)->config.adjusted_mode.clock; + clock =to_intel_crtc (crtc)->config.adjusted_mode.crtc_clock; pixel_size = crtc->fb->bits_per_pixel /8 ;/* BPP */ entries = (clock /1000 ) * pixel_size;
@@ -1492,7 +1496,7 @@ static void i965_update_wm(struct drm_crtc *unused_crtc)static const int sr_latency_ns =12000 ;const struct drm_display_mode *adjusted_mode = &to_intel_crtc (crtc)->config.adjusted_mode; -int clock = adjusted_mode->clock; +int clock = adjusted_mode->crtc_clock;int htotal = adjusted_mode->htotal;int hdisplay =to_intel_crtc (crtc)->config.pipe_src_w;int pixel_size = crtc->fb->bits_per_pixel /8 ;
@@ -1567,11 +1571,13 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc) fifo_size = dev_priv->display.get_fifo_size (dev,0 ); crtc =intel_get_crtc_for_plane (dev,0 );if (intel_crtc_active (crtc)) { +const struct drm_display_mode *adjusted_mode;int cpp = crtc->fb->bits_per_pixel /8 ;if (IS_GEN2 (dev)) cpp =4 ; - planea_wm =intel_calculate_wm (to_intel_crtc (crtc)->config.adjusted_mode.clock, + adjusted_mode = &to_intel_crtc (crtc)->config.adjusted_mode; + planea_wm =intel_calculate_wm (adjusted_mode->crtc_clock, wm_info, fifo_size, cpp, latency_ns); enabled = crtc;
@@ -1581,11 +1587,13 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc) fifo_size = dev_priv->display.get_fifo_size (dev,1 ); crtc =intel_get_crtc_for_plane (dev,1 );if (intel_crtc_active (crtc)) { +const struct drm_display_mode *adjusted_mode;int cpp = crtc->fb->bits_per_pixel /8 ;if (IS_GEN2 (dev)) cpp =4 ; - planeb_wm =intel_calculate_wm (to_intel_crtc (crtc)->config.adjusted_mode.clock, + adjusted_mode = &to_intel_crtc (crtc)->config.adjusted_mode; + planeb_wm =intel_calculate_wm (adjusted_mode->crtc_clock, wm_info, fifo_size, cpp, latency_ns);if (enabled ==NULL )
@@ -1614,7 +1622,7 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc)static const int sr_latency_ns =6000 ;const struct drm_display_mode *adjusted_mode = &to_intel_crtc (enabled)->config.adjusted_mode; -int clock = adjusted_mode->clock; +int clock = adjusted_mode->crtc_clock;int htotal = adjusted_mode->htotal;int hdisplay =to_intel_crtc (crtc)->config.pipe_src_w;int pixel_size = enabled->fb->bits_per_pixel /8 ;
@@ -1670,6 +1678,7 @@ static void i830_update_wm(struct drm_crtc *unused_crtc)struct drm_device *dev = unused_crtc->dev;struct drm_i915_private *dev_priv = dev->dev_private;struct drm_crtc *crtc; +const struct drm_display_mode *adjusted_mode;uint32_t fwater_lo;int planea_wm;
@@ -1677,7 +1686,8 @@ static void i830_update_wm(struct drm_crtc *unused_crtc)if (crtc ==NULL )return ; - planea_wm =intel_calculate_wm (to_intel_crtc (crtc)->config.adjusted_mode.clock, + adjusted_mode = &to_intel_crtc (crtc)->config.adjusted_mode; + planea_wm =intel_calculate_wm (adjusted_mode->crtc_clock, &i830_wm_info, dev_priv->display.get_fifo_size (dev,0 ),4 , latency_ns);
@@ -1764,7 +1774,7 @@ static bool ironlake_compute_srwm(struct drm_device *dev, int level, int plane, crtc =intel_get_crtc_for_plane (dev, plane); adjusted_mode = &to_intel_crtc (crtc)->config.adjusted_mode; - clock = adjusted_mode->clock; + clock = adjusted_mode->crtc_clock; htotal = adjusted_mode->htotal; hdisplay =to_intel_crtc (crtc)->config.pipe_src_w; pixel_size = crtc->fb->bits_per_pixel /8 ;
@@ -2112,7 +2122,7 @@ static uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,struct intel_crtc *intel_crtc =to_intel_crtc (crtc);uint32_t pixel_rate; - pixel_rate = intel_crtc->config.adjusted_mode.clock; + pixel_rate = intel_crtc->config.adjusted_mode.crtc_clock;/* We only use IF-ID interlacing. If we ever use PF-ID we'll need to * adjust the pixel_rate here. */
@@ -2913,7 +2923,7 @@ sandybridge_compute_sprite_wm(struct drm_device *dev, int plane,return false; } - clock =to_intel_crtc (crtc)->config.adjusted_mode.clock; + clock =to_intel_crtc (crtc)->config.adjusted_mode.crtc_clock;/* Use the small buffer method to calculate the sprite watermark */ entries = ((clock * pixel_size /1000 ) * display_latency_ns) /1000 ;
@@ -2948,7 +2958,7 @@ sandybridge_compute_sprite_srwm(struct drm_device *dev, int plane, } crtc =intel_get_crtc_for_plane (dev, plane); - clock =to_intel_crtc (crtc)->config.adjusted_mode.clock; + clock =to_intel_crtc (crtc)->config.adjusted_mode.crtc_clock;if (!clock) { *sprite_wm =0 ;return false;
drivers/gpu/drm/i915/intel_sdvo.c +1 -1
@@ -1369,7 +1369,7 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder,if (HAS_PCH_SPLIT (dev))ironlake_check_encoder_dotclock (pipe_config, dotclock); - pipe_config->adjusted_mode.clock = dotclock; + pipe_config->adjusted_mode.crtc_clock = dotclock;/* Cross check the port pixel multiplier with the sdvo encoder state. */ if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_CLOCK_RATE_MULT,
drivers/gpu/drm/i915/intel_tv.c +1 -1
@@ -912,7 +912,7 @@ intel_tv_compute_config(struct intel_encoder *encoder,if (!tv_mode)return false; - pipe_config->adjusted_mode.clock = tv_mode->clock; + pipe_config->adjusted_mode.crtc_clock = tv_mode->clock;DRM_DEBUG_KMS ("forcing bpc to 8 for TV\n" ); pipe_config->pipe_bpp =8 *3 ;
Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 20/22 drm/i915: Ask the DRM core do make stereo timings adjustements
In reply to Damien LespiauWhen scanning out big stereo buffers that are actually bigger that their natural 2D counterpart, we need to blow up the crtc timings as well.
Not that this is only done for frame packing as this is the only stereo mode currently exposed needing this kind of ajdustements.
--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -8435,7 +8435,7 @@ encoder_retry: pipe_config->pixel_multiplier =1 ;/* Fill in default crtc timings, allow encoders to overwrite them. */ -drm_mode_set_crtcinfo (&pipe_config->adjusted_mode,0 ); +drm_mode_set_crtcinfo (&pipe_config->adjusted_mode,CRTC_STEREO_DOUBLE );/* Pass our mode to the connectors and the CRTC to give them a chance to * adjust it according to limitations or connector properties, and also
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 21/22 drm/i915: Prefer crtc_{h|v}display for pipe src dimensions
In reply to Damien LespiauNow that we ask to adjust the crtc timings for stereo modes, the correct pipe_src_w and pipe_src_h can be found in crtc_vdisplay and crtc_hdisplay.
v2: Add comment about why pipe_src_w/h need to be set afert
set_crtcinfo() (Daniel Vetter)
--- drivers/gpu/drm/i915/intel_display.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +4 -3
@@ -8400,9 +8400,6 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,drm_mode_copy (&pipe_config->adjusted_mode, mode);drm_mode_copy (&pipe_config->requested_mode, mode); - pipe_config->pipe_src_w = mode->hdisplay; - pipe_config->pipe_src_h = mode->vdisplay; - pipe_config->cpu_transcoder = (enum transcoder )to_intel_crtc (crtc)->pipe; pipe_config->shared_dpll =DPLL_ID_PRIVATE ;
@@ -8437,6 +8434,10 @@ encoder_retry:/* Fill in default crtc timings, allow encoders to overwrite them. */ drm_mode_set_crtcinfo (&pipe_config->adjusted_mode,CRTC_STEREO_DOUBLE ); +/* set_crtcinfo() may have adjusted hdisplay/vdisplay */ + pipe_config->pipe_src_w = pipe_config->adjusted_mode.crtc_hdisplay; + pipe_config->pipe_src_h = pipe_config->adjusted_mode.crtc_vdisplay; +/* Pass our mode to the connectors and the CRTC to give them a chance to * adjust it according to limitations or connector properties, and also * a chance to reject the mode entirely.
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 22/22 drm/i915: Allow stereo modes on HDMI
In reply to Damien Lespiau--- drivers/gpu/drm/i915/intel_hdmi.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/intel_hdmi.c +1 -0
@@ -1228,6 +1228,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, connector->interlace_allowed =1 ; connector->doublescan_allowed =0 ; + connector->stereo_allowed =1 ;switch (port) {case PORT_B :
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Upstreaming the stereo v6 series
In reply to Damien LespiauHi,
So this series looks like a good candidate to be merged in one tree.
Beside the new 3d flags added to the mode structure, the other new API is the SET_CLIENT_CAP ioctl. It seems that this new ioctl could already be potentially useful for user space to tell us they want the "primary" plane explosed as a DRM plane.
The i915 bits depend on the lastest drm-intel(-next-queued) so it'd be simpler to merge this series in drm-intel rather than drm-next. Options are:
- merge it through drm-intel (yey!)
- merge it through drm-next once the current drm-intel has been merged (will probably need a rebase because of the crtc_clock addition)
- merge the drm patches through drm-next and the drm/i915 ones through drm-intel, but that'll likely need me to rebase the i915 patches as well.
All in all, it'd be much easier to merge it through drm-intel (if people are happy with the current state of the series, of course).
Signature · 1 line
Damien
Re: Upstreaming the stereo v6 series
Quoted 18 lines · Damien Lespiau
Hi,
So this series looks like a good candidate to be merged in one tree.
Beside the new 3d flags added to the mode structure, the other new API is the
SET_CLIENT_CAPioctl. It seems that this new ioctl could already be potentially useful for user space to tell us they want the "primary" plane explosed as a DRM plane.The i915 bits depend on the lastest drm-intel(-next-queued) so it'd be simpler to merge this series in drm-intel rather than drm-next. Options are:
- merge it through drm-intel (yey!)
- merge it through drm-next once the current drm-intel has been merged (will probably need a rebase because of the
crtc_clockaddition)
Quoted 6 lines
- merge the drm patches through drm-next and the drm/i915 ones through drm-intel, but that'll likely need me to rebase the i915 patches as well.
All in all, it'd be much easier to merge it through drm-intel (if people are happy with the current state of the series, of course).
As quickly discussed with Dave on irc I've merged the entire patch pile into drm-intel. Thanks for the patches and review.
One thing I've noticed is that using flags to enumerate the 3d modes is a bit error-prone - we've already had tons of fun with the sync flags where two bits each represent one logical bool. I think we should fix this up while we still can like this:
include/uapi/drm/drm_mode.h +9 -7
@@ -58,14 +58,16 @@#define DRM_MODE_FLAG_PIXMUX (1<<11)#define DRM_MODE_FLAG_DBLCLK (1<<12)#define DRM_MODE_FLAG_CLKDIV2 (1<<13) +#define DRM_MODE_FLAG_3D_NONE (0<<14)#define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14) -#define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (1<<15) -#define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (1<<16) -#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL (1<<17) -#define DRM_MODE_FLAG_3D_L_DEPTH (1<<18) -#define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (1<<19) -#define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (1<<20) -#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (1<<21) +#define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14) +#define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14) +#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL (4<<14) +#define DRM_MODE_FLAG_3D_L_DEPTH (5<<14) +#define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (6<<14) +#define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14) +#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14) +#define DRM_MODE_FLAG_3D_MAX (9<<14)/* DPMS flags */ /* bit compatible with the xorg definitions. */
Care to supply this little fixup (plus adjusted _MASK and userspace input checks ofc).
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch