linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 09/20] video: msm: Split out MDP2.2 HW specific code.
Date: Sun, 20 Mar 2011 09:22:15 +0000	[thread overview]
Message-ID: <20110320092215.GA16646@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1300485423-27281-1-git-send-email-carlv@codeaurora.org>

On Fri, Mar 18, 2011 at 02:57:03PM -0700, Carl Vanderlip wrote:
> +int mdp_ppp_cfg_edge_cond(struct mdp_blit_req *req, struct ppp_regs *regs)
> +{
> +	int32_t luma_interp[4];
> +	int32_t luma_repeat[4];
> +	int32_t chroma_interp[4];
> +	int32_t chroma_bound[4];
> +	int32_t chroma_repeat[4];
> +	uint32_t dst_w, dst_h;
> +
> +	memset(&luma_interp, 0, sizeof(int32_t) * 4);
> +	memset(&luma_repeat, 0, sizeof(int32_t) * 4);
> +	memset(&chroma_interp, 0, sizeof(int32_t) * 4);
> +	memset(&chroma_bound, 0, sizeof(int32_t) * 4);
> +	memset(&chroma_repeat, 0, sizeof(int32_t) * 4);
> +	regs->edge = 0;
> +
> +	if (req->flags & MDP_ROT_90) {
> +		dst_w = req->dst_rect.h;
> +		dst_h = req->dst_rect.w;
> +	} else {
> +		dst_w = req->dst_rect.w;
> +		dst_h = req->dst_rect.h;
> +	}
> +
> +	if (regs->op & (PPP_OP_SCALE_Y_ON | PPP_OP_SCALE_X_ON)) {
> +		get_edge_info(req->src_rect.h, req->src_rect.y, dst_h,
> +			      &luma_interp[IMG_TOP], &luma_interp[IMG_BOTTOM],
> +			      &luma_repeat[IMG_TOP], &luma_repeat[IMG_BOTTOM]);
> +		get_edge_info(req->src_rect.w, req->src_rect.x, dst_w,
> +			      &luma_interp[IMG_LEFT], &luma_interp[IMG_RIGHT],
> +			      &luma_repeat[IMG_LEFT], &luma_repeat[IMG_RIGHT]);
> +	} else {
> +		luma_interp[IMG_LEFT] = req->src_rect.x;
> +		luma_interp[IMG_RIGHT] = req->src_rect.x + req->src_rect.w - 1;
> +		luma_interp[IMG_TOP] = req->src_rect.y;
> +		luma_interp[IMG_BOTTOM] = req->src_rect.y + req->src_rect.h - 1;
> +		luma_repeat[IMG_LEFT] = 0;
> +		luma_repeat[IMG_TOP] = 0;
> +		luma_repeat[IMG_RIGHT] = 0;
> +		luma_repeat[IMG_BOTTOM] = 0;
> +	}
> +
> +	chroma_interp[IMG_LEFT] = luma_interp[IMG_LEFT];
> +	chroma_interp[IMG_RIGHT] = luma_interp[IMG_RIGHT];
> +	chroma_interp[IMG_TOP] = luma_interp[IMG_TOP];
> +	chroma_interp[IMG_BOTTOM] = luma_interp[IMG_BOTTOM];
> +
> +	chroma_bound[IMG_LEFT] = req->src_rect.x;
> +	chroma_bound[IMG_RIGHT] = req->src_rect.x + req->src_rect.w - 1;
> +	chroma_bound[IMG_TOP] = req->src_rect.y;
> +	chroma_bound[IMG_BOTTOM] = req->src_rect.y + req->src_rect.h - 1;
> +
> +	if (IS_YCRCB(req->src.format)) {
> +		chroma_interp[IMG_LEFT] = chroma_interp[IMG_LEFT] >> 1;
> +		chroma_interp[IMG_RIGHT] = (chroma_interp[IMG_RIGHT] + 1) >> 1;
> +
> +		chroma_bound[IMG_LEFT] = chroma_bound[IMG_LEFT] >> 1;
> +		chroma_bound[IMG_RIGHT] = chroma_bound[IMG_RIGHT] >> 1;
> +	}
> +
> +	if (req->src.format = MDP_Y_CBCR_H2V2 ||
> +	    req->src.format = MDP_Y_CRCB_H2V2) {
> +		chroma_interp[IMG_TOP] = (chroma_interp[IMG_TOP] - 1) >> 1;
> +		chroma_interp[IMG_BOTTOM] = (chroma_interp[IMG_BOTTOM] + 1)
> +					    >> 1;
> +		chroma_bound[IMG_TOP] = (chroma_bound[IMG_TOP] + 1) >> 1;
> +		chroma_bound[IMG_BOTTOM] = chroma_bound[IMG_BOTTOM] >> 1;
> +	}
> +
> +	chroma_repeat[IMG_LEFT] = chroma_bound[IMG_LEFT] -
> +				  chroma_interp[IMG_LEFT];
> +	chroma_repeat[IMG_RIGHT] = chroma_interp[IMG_RIGHT] -
> +				  chroma_bound[IMG_RIGHT];
> +	chroma_repeat[IMG_TOP] = chroma_bound[IMG_TOP] -
> +				  chroma_interp[IMG_TOP];
> +	chroma_repeat[IMG_BOTTOM] = chroma_interp[IMG_BOTTOM] -
> +				  chroma_bound[IMG_BOTTOM];
> +
> +	if (chroma_repeat[IMG_LEFT] < 0 || chroma_repeat[IMG_LEFT] > 3 ||
> +	    chroma_repeat[IMG_RIGHT] < 0 || chroma_repeat[IMG_RIGHT] > 3 ||
> +	    chroma_repeat[IMG_TOP] < 0 || chroma_repeat[IMG_TOP] > 3 ||
> +	    chroma_repeat[IMG_BOTTOM] < 0 || chroma_repeat[IMG_BOTTOM] > 3 ||
> +	    luma_repeat[IMG_LEFT] < 0 || luma_repeat[IMG_LEFT] > 3 ||
> +	    luma_repeat[IMG_RIGHT] < 0 || luma_repeat[IMG_RIGHT] > 3 ||
> +	    luma_repeat[IMG_TOP] < 0 || luma_repeat[IMG_TOP] > 3 ||
> +	    luma_repeat[IMG_BOTTOM] < 0 || luma_repeat[IMG_BOTTOM] > 3)
> +		return -1;

Lazy programming strikes again.  Public functions really should not
return things that look like errno codes, rather they should return
real errno codes.

Secondly, why is this stuff, which looks very driver like, under arch/arm
and not in drivers/ somewhere?

  reply	other threads:[~2011-03-20  9:22 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18 21:47 [PATCH 00/20] video: msm: Adding Support for MDP3.1 Carl Vanderlip
2011-03-18 21:51 ` [PATCH 01/20] video: msm: Fix typo 'mpd'->'mdp' Carl Vanderlip
2011-03-21  4:36   ` Janorkar, Mayuresh
2011-03-22  0:08     ` Carl Vanderlip
2011-03-18 21:53 ` [PATCH 02/20] video: msm: add spinlock to mdp_info struct Carl Vanderlip
2011-03-18 21:53 ` [PATCH 03/20] video: msm: add locked_enable_mdp_irq function Carl Vanderlip
2011-03-18 21:54 ` [PATCH 04/20] video: msm: Move clk to mdp_info struct Carl Vanderlip
2011-03-18 21:54 ` [PATCH 05/20] video: msm: Setup framework for multiple output interfaces Carl Vanderlip
2011-03-18 21:55 ` [PATCH 06/20] video: msm: Simplify mdp_blit function Carl Vanderlip
2011-03-18 21:56 ` [PATCH 07/20] video: msm: Allow users to request a larger x and y virtual fb Carl Vanderlip
2011-03-21  4:52   ` [PATCH 07/20] video: msm: Allow users to request a larger x and Janorkar, Mayuresh
2011-03-21 16:41     ` [PATCH 07/20] video: msm: Allow users to request a larger x Russell King - ARM Linux
2011-03-22  0:21     ` Carl Vanderlip
2011-03-18 21:56 ` [PATCH 08/20] video: msm: Refactor mdp_regs Carl Vanderlip
2011-03-21  5:29   ` Janorkar, Mayuresh
2011-03-21 17:23     ` Bryan Huntsman
2011-03-21 17:28       ` Brian Swetland
2011-03-18 21:57 ` [PATCH 09/20] video: msm: Split out MDP2.2 HW specific code Carl Vanderlip
2011-03-20  9:22   ` Russell King - ARM Linux [this message]
2011-03-22  0:26     ` Carl Vanderlip
2011-03-21  5:27   ` Janorkar, Mayuresh
2011-03-23 13:11   ` Daniel Walker
2011-03-23 19:18     ` Dima Zavin
     [not found]     ` <4D8A5B44.9050306@codeaurora.org>
2011-03-23 22:47       ` David Brown
2011-03-18 21:57 ` [PATCH 10/20] video: msm: Separate more MDP " Carl Vanderlip
2011-03-18 21:57 ` [PATCH 11/20] video: msm: Add MDP FB DMA configuration Carl Vanderlip
2011-03-21  5:30   ` Janorkar, Mayuresh
2011-03-18 21:58 ` [PATCH 12/20] video: msm: Add IRQ callback for MDP interface Carl Vanderlip
2011-03-18 21:58 ` [PATCH 13/20] video: msm: Debugging for send_blit Carl Vanderlip
2011-03-21  5:32   ` Janorkar, Mayuresh
2011-03-18 21:58 ` [PATCH 14/20] video: msm: Write IRQ mask to MDP registers Carl Vanderlip
2011-03-18 21:59 ` [PATCH 15/20] video: msm: convert printk to pr_* Carl Vanderlip
2011-03-21  5:34   ` Janorkar, Mayuresh
2011-03-21 13:33   ` Sergei Shtylyov
2011-03-18 21:59 ` [PATCH 16/20] video: msm: Set the EBI1 clock to 128MHz when performing blits Carl Vanderlip
2011-03-21 20:31   ` [PATCH 16/20] video: msm: Set the EBI1 clock to 128MHz when performing Stephen Boyd
2011-03-18 21:59 ` [PATCH 17/20] video: msm: Prevent framebuffer glitch during initialization Carl Vanderlip
2011-03-21 13:39   ` Sergei Shtylyov
2011-03-21 23:49     ` [PATCH 17/20] video: msm: Prevent framebuffer glitch Carl Vanderlip
2011-03-18 21:59 ` [PATCH 18/20] video: msm: Prevent DMA lockups when switching bit depths Carl Vanderlip
2011-03-21 13:42   ` [PATCH 18/20] video: msm: Prevent DMA lockups when switching Sergei Shtylyov
2011-03-18 21:59 ` [PATCH 19/20] video: msm: Separate calculation of base and offset Carl Vanderlip
2011-03-18 22:00 ` [PATCH 20/20] video: msm: Add support for MDP 3.1 (qsd8k) Carl Vanderlip

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=20110320092215.GA16646@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).