From: Adam Jackson Subject: Re: [PATCH] drm: Enable reading 3D capabilities of 3D monitor Date: Tue, 13 Dec 2011 11:20:32 -0500 Message-ID: <1323793232.10572.15.camel@atropine> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1632768097==" Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id B65FF9E7A4 for ; Tue, 13 Dec 2011 08:20:34 -0800 (PST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: "Kavuri, Sateesh" Cc: "dri-devel@lists.freedesktop.org" List-Id: dri-devel@lists.freedesktop.org --===============1632768097== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-+JlLV9AHgIHS+pRAtxW6" --=-+JlLV9AHgIHS+pRAtxW6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2011-12-09 at 11:46 +0000, Kavuri, Sateesh wrote: > + if ((multi_val =3D=3D STRUCTURE_PRESENT) ||=20 > + (multi_val =3D=3D STRUCTURE_MASK_PRESENT) ) { > + if ((edid_ext[i+15+hdmi_vic_len] & 0x01) =3D=3D 0x01) > + caps->format |=3D 0x0; /* FRAME_PACKING */ > + if ((edid_ext[i+15+hdmi_vic_len] & 0x02) =3D=3D 0x02) > + caps->format |=3D 0x1; /*FIELD_ALTERNATIVE */ > + if ((edid_ext[i+15+hdmi_vic_len] & 0x04) =3D=3D 0x04) > + caps->format |=3D 0x2; /* LINE_ALTERNATIVE */ > + if ((edid_ext[i+15+hdmi_vic_len] & 0x08) =3D=3D 0x08) > + caps->format |=3D 0x3; /*SIDE_BY_SIDE_FULL */ > + if ((edid_ext[i+15+hdmi_vic_len] & 0x10) =3D=3D 0x10) > + caps->format |=3D 0x4; /* L_DEPTH */ > + if ((edid_ext[i+15+hdmi_vic_len] & 0x20) =3D=3D 0x20) > + caps->format |=3D 0x5; /* L_DEPTH_GFX_GFX_DEPTH */ > + if ((edid_ext[i+15+hdmi_vic_len] & 0x40) =3D=3D 0x40) > + caps->format |=3D 0x6; /* TOP_BOTTOM */ > + if ((edid_ext[i+14+hdmi_vic_len] & 0x01) =3D=3D 0x01) > + caps->format |=3D 0x7; /* S_BY_S_HALF */ > + if ((edid_ext[i+14+hdmi_vic_len] & 0x80) =3D=3D 0x80) > + caps->format |=3D 0x8; /* S_BY_S_HALF_QUINCUNX */ > + } This reads poorly, which makes me think it's wrong. Is format supposed to be a bitfield or an enum? > +EXPORT_SYMBOL(drm_detect_3D_monitor); I suspect this is poorly named. There exist 3D displays which are not HDMI. > +#define VSIF_RESET_INDEX 0xFFFFFFF8 > +#define VSIF_RESET_BIT_22 0xFFBFFFFF > +#define VSIF_SET_BIT_19 0x80000 > +#define VSIF_RESET_BIT_20 0xFFEFFFFF > +#define VSIF_RESET_BIT_17 0x10000 > +#define VSIF_SET_BIT_16 0xFFFDFFFF > +#define VSIF_SET_MASTER_BIT 0x400000 i915 style is usually to write these as (1 << 22) I think. More importantly, use semantic names for register contents. "Bit 17" doesn't mean anything. > diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h > index 8020798..5b4d09c 100644 > --- a/include/drm/drm_crtc.h > +++ b/include/drm/drm_crtc.h > @@ -798,6 +798,8 @@ extern int drm_mode_gamma_set_ioctl(struct drm_device= *dev, > extern u8 *drm_find_cea_extension(struct edid *edid); > extern bool drm_detect_hdmi_monitor(struct edid *edid); > extern bool drm_detect_monitor_audio(struct edid *edid); > +extern bool drm_detect_3D_monitor(struct edid *edid); > +//extern struct panel_3d_caps* drm_detect_3D_monitor(struct edid *edid); Well, which is it? > +enum s3d_formats { > + FRAME_PACKING =3D 0x0, > + FIELD_ALTERNATIVE =3D 0x1, > + LINE_ALTERNATIVE =3D 0x2, > + SIDE_BY_SIDE_FULL =3D 0x3, > + L_DEPTH =3D 0x4, > + L_DEPTH_GFX_GFX_DEPTH =3D 0x5, > + TOP_BOTTOM =3D 0x6, /* 0x7 is reserved for future */ > + SIDE_BY_SIDE_HALF =3D 0x8 /* 0x9 onwards is reserved for future */ > +}; If format is supposed to be an enum, why aren't you using these symbolic values? - ajax --=-+JlLV9AHgIHS+pRAtxW6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAk7ne1AACgkQW4otUKDs0NPpWQCgy2Ipnz2fnEzsqByprcF+wmXf gjEAoL3yomBoMT1fITLkCs6qywFYxfen =2YEO -----END PGP SIGNATURE----- --=-+JlLV9AHgIHS+pRAtxW6-- --===============1632768097== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1632768097==--