public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ian Campbell <ijc+uboot@hellion.org.uk>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/5] sunxi: display: Add support for interlaced modes
Date: Wed, 05 Aug 2015 09:05:56 +0100	[thread overview]
Message-ID: <1438761956.18644.55.camel@hellion.org.uk> (raw)
In-Reply-To: <1438638870-3728-4-git-send-email-hdegoede@redhat.com>

On Mon, 2015-08-03 at 23:54 +0200, Hans de Goede wrote:
> @@ -775,13 +781,18 @@ static void sunxi_lcdc_tcon1_mode_set(const
> struct ctfb_res_modes *mode,
>  
>  	clk_delay = sunxi_lcdc_get_clk_delay(mode, 1);
>  	writel(SUNXI_LCDC_TCON1_CTRL_ENABLE |
> +	       SUNXI_LCDC_TCON1_CTRL_INTERLACE(
> +			mode->vmode == FB_VMODE_INTERLACED) |

I think this would be clearer if SUNXI_LCDC_TCON1_CTRL_INTERLACE was
actually the enable bit (perhaps with _ENABLE on the name), rather than
a macro which takes a boolean and returns 0 or the single bit, so you
could just write
	mode->vmode == FB_VMODE_INTERLACED ? 
		SUNXI_LCDC_TCON1_CTRL_INTERLACE : 0
(in whichever wrapping style you prefer).

I think the macro is the bit style is more common in this code for
boolean options too, we mainly use the macro-with-argument style for
fields with more than 1 bit to them.

But ultimately the code is correct as you have it so either way as you
prefer:

Acked-by: Ian Campbell <ijc@hellion.org.uk>

Although if you want to keep it the way it is then perhaps the macro sh
ould have !!n instead of just n, to prevent surprises if someone uses a
bitop rather than a full boolean op as an argument?

@@ -1240,6 +1245,9 @@ void *video_hw_init(void)
>  		return NULL;
>  	}
>  
> +> 	> printf("Setting up a %dx%d %s console\n", mode->xres,
> +> 	>        mode->yres, sunxi_get_mon_desc(sunxi_display.monitor));

Is it worth including the string "interlaced" here when appropriate?
(Ack stands either way)

Ian.

  reply	other threads:[~2015-08-05  8:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 21:54 [U-Boot] [PATCH 1/5] sunxi: display: Replace #ifdef-ery with helper functions Hans de Goede
2015-08-03 21:54 ` [U-Boot] [PATCH 2/5] sunxi: display: Correct clk_delay calculations for lcd displays Hans de Goede
2015-08-05  7:54   ` Ian Campbell
2015-08-03 21:54 ` [U-Boot] [PATCH 3/5] sunxi: display: Add a few extra register and constant defines Hans de Goede
2015-08-05  7:57   ` Ian Campbell
2015-08-05 15:09     ` Hans de Goede
2015-08-03 21:54 ` [U-Boot] [PATCH 4/5] sunxi: display: Add support for interlaced modes Hans de Goede
2015-08-05  8:05   ` Ian Campbell [this message]
2015-08-05 15:13     ` Hans de Goede
2015-08-03 21:54 ` [U-Boot] [PATCH 5/5] sunxi: display: Add composite video out support Hans de Goede
2015-08-05  8:07   ` Ian Campbell
2015-08-05  7:53 ` [U-Boot] [PATCH 1/5] sunxi: display: Replace #ifdef-ery with helper functions Ian Campbell

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=1438761956.18644.55.camel@hellion.org.uk \
    --to=ijc+uboot@hellion.org.uk \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox