All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Härdeman" <david@hardeman.nu>
To: intel-gfx@lists.freedesktop.org
Cc: jesse.barnes@intel.com
Subject: Re: [PATCH] i915: enable AVI infoframe for intel_hdmi.c [v2]
Date: Sat, 11 Sep 2010 00:04:06 +0200	[thread overview]
Message-ID: <20100910220406.GA16734@hardeman.nu> (raw)
In-Reply-To: <20100909210001.11985.1244.stgit@localhost.localdomain>

On Thu, Sep 09, 2010 at 11:00:01PM +0200, David Härdeman wrote:
> This is the second version which merges the infoframe code from
> intel_hdmi.c and intel_sdvo.c, I hope this is something along the lines
> Chris Wilson had in mind. Note that I'm assuming that the sdvo hardware
> also stores a header ECC byte in the MSB of the first dword (haven't found
> any documentation for the sdvo).

Just to clarify that last sentence a bit...

intel_sdvo.c currently defines this struct:

struct dip_infoframe {
	uint8_t type;
	uint8_t version;
	uint8_t len;
	uint8_t checksum;
	union {
		...
		uint8_t payload[28];
	] __attribute__ ((packed)) u;
} __attribute__((packed));

If the "checksum" member refers to the body checksum of the infoframe, 
then the payload size is incorrect. The checksum is the first byte of 
the body which is 28 bytes in total (HDMI spec 1.3a, table 5-15) so the 
payload array should be 27 bytes. If the payload size is corrected to 27 
bytes, then the size of the entire struct is 31 bytes and the writing 
(which is done in 8 byte chunks in intel_sdvo.c) needs to be fixed.

If, on the other hand, the checksum field refers to the header ecc 
checksum, then the payload member is correctly sized but the body 
checksum is missing.

My guess is that the sdvo hardware has the same setup as described in 
http://intellinuxgraphics.org/VOL_3_display_registers_updated.pdf, 
section 2.8.9, meaning that the correct struct would be:

struct dip_infoframe {
	uint8_t type;
	uint8_t version;
	uint8_t len;
	uint8_t ecc;
	uint8_t checksum;
	union {
		...
		uint8_t payload[27];
	] __attribute__ ((packed)) u;
} __attribute__((packed));

Which would give a 32 byte struct which can be written in 8-byte chunks 
and which has the correct body size.

However, I can't confirm that suspicion...see:
http://software.intel.com/en-us/forums/showannouncement.php?a=17

Could someone at Intel please clarify?

On a related note, the struct currently defined in intel_sdvo.c relies 
on bitfields and expect the bits to be encoded in a certain order (which 
is the reason a casual reader might get the impression that the order of 
the members of the struct is reversed when compared to the relevant 
specs). However, the order of the bits within a unit is 
implementation-defined (C99, 6.7.2.1, point 10), so it shouldn't be 
relied upon...which is why I didn't use bitfields in my patch.

-- 
David Härdeman

      parent reply	other threads:[~2010-09-10 22:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-09 21:00 [PATCH] i915: enable AVI infoframe for intel_hdmi.c [v2] David Härdeman
2010-09-09 21:58 ` Chris Wilson
2010-09-10  8:13   ` David Härdeman
2010-09-20 22:01   ` David Härdeman
2010-09-21  8:02     ` Chris Wilson
2010-09-10 22:04 ` David Härdeman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100910220406.GA16734@hardeman.nu \
    --to=david@hardeman.nu \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jesse.barnes@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.