All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@avionic-design.de>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [RFC v2 3/5] drm: Add HDMI infoframe helpers
Date: Thu, 6 Dec 2012 15:28:03 +0100	[thread overview]
Message-ID: <20121206142803.GB15982@avionic-0098.adnet.avionic-design.de> (raw)
In-Reply-To: <20121206140900.GT11556@phenom.ffwll.local>


[-- Attachment #1.1: Type: text/plain, Size: 3207 bytes --]

On Thu, Dec 06, 2012 at 03:09:00PM +0100, Daniel Vetter wrote:
> On Wed, Dec 05, 2012 at 05:45:42PM +0100, Thierry Reding wrote:
[...]
> > diff --git a/drivers/gpu/drm/drm_hdmi.c b/drivers/gpu/drm/drm_hdmi.c
> > new file mode 100644
> > index 0000000..821ca56
> > --- /dev/null
> > +++ b/drivers/gpu/drm/drm_hdmi.c
> > @@ -0,0 +1,71 @@
> > +/*
> > + * Copyright (C) 2012 Avionic Design GmbH
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + */
> > +
> > +#include <linux/hdmi.h>
> > +
> > +#include <drm/drm_crtc.h>
> > +#include <drm/drm_hdmi.h>
> > +
> > +#include "drm_edid_modes.h"
> 
> This creates a 2nd copy of that massive table. Imo we could just shovel
> the infoframe helpers into the drm_edid.c file - allowing different
> helpers to be disabled isn't that useful, since most drivers will want
> them pretty much all anyway. Or at least most of them.

I can move this helper to drm_edid.c. But maybe it might be worth moving
the table from the header into a source file and just export it from
there.

> > +
> > +static inline unsigned int
> > +drm_mode_cea_vic(const struct drm_display_mode *mode)
> > +{
> > +	unsigned int i;
> > +
> > +	for (i = 0; i < drm_num_cea_modes; i++)
> > +		if (drm_mode_equal(mode, &edid_cea_modes[i]))
> > +			return i + 1;
> > +
> > +	return 0;
> > +}
> 
> Same function in drm_edid will land through drm-intel tree in drm-next
> rsn. I'll send that pull request somewhen next week probably.
> 
> http://cgit.freedesktop.org/~danvet/drm-intel/commit/?id=374a868a726eb8a1cb28ba88805e51ce34222f8d

Yes, I'm aware of that patch (I reviewed it =) and I was planning on
dropping the implementation in this patch once the above patch makes
it into linux-next.

> > +/**
> > + * drm_hdmi_avi_infoframe_from_display_mode() - fill an HDMI AVI infoframe with
> > + *                                              data from a DRM display mode
> > + * @frame: HDMI AVI infoframe
> > + * @mode: DRM display mode
> > + *
> > + * Returns 0 on success or a negative error code on failure.
> > + */
> > +int
> > +drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
> > +					 const struct drm_display_mode *mode)
> > +{
> > +	int err;
> > +
> > +	if (!frame || !mode)
> > +		return -EINVAL;
> > +
> > +	err = hdmi_avi_infoframe_init(frame);
> > +	if (err < 0)
> > +		return err;
> > +
> > +	frame->video_code = drm_mode_cea_vic(mode);
> > +	if (!frame->video_code)
> > +		return 0;
> > +
> > +	frame->picture_aspect = drm_display_mode_get_aspect(mode);
> > +	frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE;
> 
> Note that the intel avi infoframe in intel_hdmi_set_avi_infoframe also
> sets the pixel repeat for double clocked modes with:
> 
> 	if (adjusted_mode->flags & DRM_MODE_FLAG_DBLCLK)
> 		avi_if.body.avi.YQ_CN_PR |= DIP_AVI_PR_2;

I left that in place in the Intel driver, but I suppose we can just as
well move it to the infoframe helpers since it should be a generic
option.

Thierry

[-- Attachment #1.2: Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

  reply	other threads:[~2012-12-06 14:28 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-05 16:45 [RFC v2 0/5] Add HDMI infoframe helpers Thierry Reding
2012-12-05 16:45 ` [RFC v2 1/5] drm: Add some missing forward declarations Thierry Reding
2012-12-05 16:45 ` [RFC v2 2/5] video: Add generic HDMI infoframe helpers Thierry Reding
2012-12-07 14:32   ` Paulo Zanoni
2012-12-11  7:58     ` Thierry Reding
2012-12-05 16:45 ` [RFC v2 3/5] drm: Add " Thierry Reding
2012-12-05 17:51   ` Lars-Peter Clausen
2012-12-06  7:28     ` Thierry Reding
2012-12-06  8:28       ` Lars-Peter Clausen
2012-12-06 14:09   ` Daniel Vetter
2012-12-06 14:28     ` Thierry Reding [this message]
2012-12-06 15:44       ` Daniel Vetter
2012-12-06 16:02         ` Thierry Reding
2012-12-07 19:00   ` Daniel Vetter
2012-12-05 16:45 ` [RFC v2 4/5] drm: tegra: Use generic " Thierry Reding
2012-12-05 16:45 ` [RFC v2 5/5] drm/i915: " Thierry Reding
2012-12-06 14:16   ` Daniel Vetter
2012-12-06 14:23     ` Thierry Reding
2012-12-06 15:57       ` Daniel Vetter
2012-12-06 16:02         ` Thierry Reding
2012-12-06 16:11   ` Paulo Zanoni
2012-12-06 16:55     ` Paulo Zanoni
2012-12-07  7:28       ` Thierry Reding
2012-12-07  8:30         ` Daniel Vetter
2012-12-07  8:49           ` Thierry Reding
2012-12-07  7:22     ` Thierry Reding
2012-12-07 15:11   ` [RFC] " Paulo Zanoni
2012-12-07 15:32     ` Daniel Vetter
2012-12-11 10:39       ` Daniel Vetter
2012-12-11  8:35     ` Thierry Reding

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=20121206142803.GB15982@avionic-0098.adnet.avionic-design.de \
    --to=thierry.reding@avionic-design.de \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    /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.