From: Tomasz Figa <t.figa@samsung.com>
To: Shirish S <s.shirish@samsung.com>,
dri-devel@lists.freedesktop.org, inki.dae@samsung.com
Cc: shirish@chromium.org
Subject: Re: [PATCH] drm/exynos: set the active aspect ratio as per mode
Date: Wed, 12 Mar 2014 16:19:10 +0100 [thread overview]
Message-ID: <53207AEE.7030202@samsung.com> (raw)
In-Reply-To: <1394423086-21383-1-git-send-email-s.shirish@samsung.com>
Hi Shirish,
On 10.03.2014 04:44, Shirish S wrote:
> now that the drm_display_mode also provides aspect
> ratio for all resolutions, this patch adds its usage
> to set the active aspect ratio of AVI info frame
> packets as per CEA-861-D standard's Table 9.
>
> This is also needed to abide by the 7-27
> compliance test of HDMI.
>
> Signed-off-by: Shirish S <s.shirish@samsung.com>
> ---
> drivers/gpu/drm/exynos/exynos_hdmi.c | 33 +++++++++++++++++++++++++++------
> 1 file changed, 27 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index c021ddc..8aca52a 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -53,8 +53,6 @@
> /* AVI header and aspect ratio */
> #define HDMI_AVI_VERSION 0x02
> #define HDMI_AVI_LENGTH 0x0D
> -#define AVI_PIC_ASPECT_RATIO_16_9 (2 << 4)
> -#define AVI_SAME_AS_PIC_ASPECT_RATIO 8
>
> /* AUI header info */
> #define HDMI_AUI_VERSION 0x01
> @@ -65,6 +63,12 @@ enum hdmi_type {
> HDMI_TYPE14,
> };
>
> +enum active_aspect_ratio {
> + AVI_SAME_AS_PIC_ASPECT_RATIO = 8,
> + AVI_4_3_Center_RATIO,
> + AVI_16_9_Center_RATIO,
> +};
> +
CodingStyle: Please define these using preprocessor macros, since they
are bitfield values. Also coding style implies using uppercase for
constants.
> struct hdmi_resources {
> struct clk *hdmi;
> struct clk *sclk_hdmi;
> @@ -162,6 +166,7 @@ struct hdmi_v14_conf {
> struct hdmi_conf_regs {
> int pixel_clock;
> int cea_video_id;
> + enum hdmi_picture_aspect aspect_ratio;
> union {
> struct hdmi_v13_conf v13_conf;
> struct hdmi_v14_conf v14_conf;
> @@ -668,7 +673,6 @@ static void hdmi_reg_infoframe(struct hdmi_context *hdata,
> {
> u32 hdr_sum;
> u8 chksum;
> - u32 aspect_ratio;
> u32 mod;
> u32 vic;
>
> @@ -697,10 +701,25 @@ static void hdmi_reg_infoframe(struct hdmi_context *hdata,
> AVI_ACTIVE_FORMAT_VALID |
> AVI_UNDERSCANNED_DISPLAY_VALID);
>
> - aspect_ratio = AVI_PIC_ASPECT_RATIO_16_9;
> -
> - hdmi_reg_writeb(hdata, HDMI_AVI_BYTE(2), aspect_ratio |
> + /*
> + * Set the aspect ratio as per the mode, mentioned in
> + * Table 9 AVI InfoFrame Data Byte 2 of CEA-861-D Standard
> + */
> + switch (hdata->mode_conf.aspect_ratio) {
> + case HDMI_PICTURE_ASPECT_4_3:
> + hdmi_reg_writeb(hdata, HDMI_AVI_BYTE(2), aspect_ratio |
> + AVI_4_3_Center_RATIO);
CodingStyle: Please keep wrapped function calls aligned using tabs at
least to the opening parenthesis.
> + break;
> + case HDMI_PICTURE_ASPECT_16_9:
> + hdmi_reg_writeb(hdata, HDMI_AVI_BYTE(2), aspect_ratio |
> + AVI_16_9_Center_RATIO);
Ditto.
> + break;
> + case HDMI_PICTURE_ASPECT_NONE:
> + default:
> + hdmi_reg_writeb(hdata, HDMI_AVI_BYTE(2), aspect_ratio |
> AVI_SAME_AS_PIC_ASPECT_RATIO);
Ditto.
Best regards,
Tomasz
next prev parent reply other threads:[~2014-03-12 15:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-10 3:44 [PATCH] drm/exynos: set the active aspect ratio as per mode Shirish S
2014-03-12 15:19 ` Tomasz Figa [this message]
2014-03-13 3:15 ` Shirish S
-- strict thread matches above, loose matches on Subject: below --
2014-03-11 9:00 Shirish S
2014-03-13 5:28 [PATCH] drm/exynos: add phy settings for RB resolutions Shirish S
2014-03-13 5:28 ` [PATCH] drm/exynos: set the active aspect ratio as per mode Shirish S
2014-03-18 13:04 ` Tomasz Figa
2014-03-19 8:25 ` Inki Dae
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=53207AEE.7030202@samsung.com \
--to=t.figa@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=inki.dae@samsung.com \
--cc=s.shirish@samsung.com \
--cc=shirish@chromium.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.