linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damian Hobson-Garcia <dhobsong@igel.co.jp>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 47/57] fbdev: sh_mobile_meram: Use genalloc to manage
Date: Thu, 15 Dec 2011 02:43:06 +0000	[thread overview]
Message-ID: <4EE95EBA.8030702@igel.co.jp> (raw)
In-Reply-To: <1323784972-24205-48-git-send-email-laurent.pinchart@ideasonboard.com>

On 2011/12/13 23:02, Laurent Pinchart wrote:
> @@ -195,43 +196,40 @@ static int meram_check_overlap(struct sh_mobile_meram_priv *priv,
>  	    test_bit(new->cache_icb,  &priv->used_icb))
>  		return  1;
>  
> -	for (i = 0; i < MERAM_ICB_NUM; i++) {
> -		if (!test_bit(i, &priv->used_icb))
> -			continue;
> -
> -		used_start = MERAM_CACHE_START(priv->icbs[i].region);
> -		used_end   = MERAM_CACHE_END(priv->icbs[i].region);
> -		meram_start = new->meram_offset;
> -		meram_end   = new->meram_offset + new->meram_size;
> -
> -		if ((meram_start >= used_start && meram_start < used_end) ||
> -		    (meram_end > used_start && meram_end < used_end))
> -			return 1;
> -	}
> -
>  	return 0;
>  }
>  
> -/* Mark the specified ICB as used. */
> -static void meram_mark(struct sh_mobile_meram_priv *priv,
> +/* Allocate memory for the ICBs and mark them as used. */
> +static int meram_alloc(struct sh_mobile_meram_priv *priv,
>  		       const struct sh_mobile_meram_icb_cfg *new,
>  		       int pixelformat)
>  {
> +	struct sh_mobile_meram_icb *marker = &priv->icbs[new->marker_icb];
> +	unsigned long mem;
> +
> +	mem = gen_pool_alloc(priv->pool, new->meram_size * 1024);
> +	if (mem = 0)
> +		return -ENOMEM;
> +
>  	__set_bit(new->marker_icb, &priv->used_icb);
>  	__set_bit(new->cache_icb, &priv->used_icb);
>  
> -	priv->icbs[new->marker_icb].region = MERAM_CACHE_SET(new->meram_offset,
> -							     new->meram_size);
> -	priv->icbs[new->cache_icb].region = MERAM_CACHE_SET(new->meram_offset,
> -							    new->meram_size);
> -	priv->icbs[new->marker_icb].current_reg = 1;
> -	priv->icbs[new->marker_icb].pixelformat = pixelformat;
> +	marker->offset = mem - priv->meram;
I might have missed this somewhere, but it doesn't look like priv->meram
is assigned anywhere.

Damian
-- 
Damian Hobson-Garcia
IGEL Co.,Ltd
http://www.igel.co.jp

  reply	other threads:[~2011-12-15  2:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13 14:02 [PATCH 47/57] fbdev: sh_mobile_meram: Use genalloc to manage MERAM allocation Laurent Pinchart
2011-12-15  2:43 ` Damian Hobson-Garcia [this message]
2011-12-15 11:37 ` Laurent Pinchart

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=4EE95EBA.8030702@igel.co.jp \
    --to=dhobsong@igel.co.jp \
    --cc=linux-fbdev@vger.kernel.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).