All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel@daenzer.net>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: "Christian König" <deathsimple@vodafone.de>,
	dri-devel@lists.freedesktop.org
Subject: Re: [RFC][PATCH] drm/radeon/hdmi: define struct for AVI infoframe
Date: Mon, 07 May 2012 09:38:29 +0200	[thread overview]
Message-ID: <1336376309.17679.202.camel@thor.local> (raw)
In-Reply-To: <CACna6rwfbQyMNc-mjYj1F8LHSVecQqW=L_5eaawWjmqrWd5YMg@mail.gmail.com>

On Son, 2012-05-06 at 18:29 +0200, Rafał Miłecki wrote: 
> 2012/5/6 Dave Airlie <airlied@gmail.com>:
> > On Sun, May 6, 2012 at 5:19 PM, Rafał Miłecki <zajec5@gmail.com> wrote:
> >> 2012/5/6 Rafał Miłecki <zajec5@gmail.com>:
> >>> diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c
> >>> index c308432..b14c90a 100644
> >>> --- a/drivers/gpu/drm/radeon/r600_hdmi.c
> >>> +++ b/drivers/gpu/drm/radeon/r600_hdmi.c
> >>> @@ -134,78 +134,22 @@ static void r600_hdmi_infoframe_checksum(uint8_t packetType,
> >>>  }
> >>>
> >>>  /*
> >>> - * build a HDMI Video Info Frame
> >>> + * Upload a HDMI AVI Infoframe
> >>>  */
> >>> -static void r600_hdmi_videoinfoframe(
> >>> -       struct drm_encoder *encoder,
> >>> -       enum r600_hdmi_color_format color_format,
> >>> -       int active_information_present,
> >>> -       uint8_t active_format_aspect_ratio,
> >>> -       uint8_t scan_information,
> >>> -       uint8_t colorimetry,
> >>> -       uint8_t ex_colorimetry,
> >>> -       uint8_t quantization,
> >>> -       int ITC,
> >>> -       uint8_t picture_aspect_ratio,
> >>> -       uint8_t video_format_identification,
> >>> -       uint8_t pixel_repetition,
> >>> -       uint8_t non_uniform_picture_scaling,
> >>> -       uint8_t bar_info_data_valid,
> >>> -       uint16_t top_bar,
> >>> -       uint16_t bottom_bar,
> >>> -       uint16_t left_bar,
> >>> -       uint16_t right_bar
> >>> -)
> >>
> >> In case someone wonders about the reason: I think it's really ugly to
> >> have a function taking 18 arguments, 17 of them related to the
> >> infoframe. It makes much more sense for me to use struct for that.
> >> While working on that I though it's reasonable to prepare nice
> >> bitfield __packed struct ready-to-be-written to the GPU registers.
> >
> > won't this screw up on other endian machines?
> 
> Hm, maybe it can. Is there some easy to handle it correctly? Some trick like
> __le8 foo: 3
> __le8 bar: 1
> maybe?

Not really. The memory layout of bitfields is basically completely up to
the C implementation, so IMHO they're just inadequate for describing
fixed memory layouts.


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2012-05-07  7:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-06 15:31 [RFC][PATCH] drm/radeon/hdmi: define struct for AVI infoframe Rafał Miłecki
2012-05-06 16:19 ` Rafał Miłecki
2012-05-06 16:22   ` Dave Airlie
2012-05-06 16:28     ` Daniel Vetter
2012-05-06 16:33       ` Rafał Miłecki
2012-05-06 16:29     ` Rafał Miłecki
2012-05-07  7:38       ` Michel Dänzer [this message]
2012-05-07 18:14         ` Jerome Glisse

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=1336376309.17679.202.camel@thor.local \
    --to=michel@daenzer.net \
    --cc=deathsimple@vodafone.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=zajec5@gmail.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.