All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: InKi Dae <daeinki@gmail.com>
Cc: Tomi Valkeinen <tomi.valkeinen@nokia.com>, linux-omap@vger.kernel.org
Subject: Re: [PATCH] enabled alpha blender for OMAP2/3 DSS2 driver.
Date: Fri, 24 Apr 2009 06:46:36 -0700	[thread overview]
Message-ID: <87skjyxiyr.fsf@deeprootsystems.com> (raw)
In-Reply-To: <90b950fc0904240213x70f66891j7dc587f09445e2f3@mail.gmail.com> (InKi Dae's message of "Fri\, 24 Apr 2009 18\:13\:22 +0900")

InKi Dae <daeinki@gmail.com> writes:

> - Added global alpha value for GFX and VIDEO2 layer.
> - Modified dispc_alpha_blending_enabled function.
>   -> for OMAP_DSS_CHANNEL_DIGIT, it has to get DISPC_CONFIG[19], not 18.
>
> For alpha channel, dispc_enable_alpha_blending() is called by
> omapfb_fb_init() in case of only XXX_ARGB16, RGBA32 or ARGB32
>
> Signed-off-by: InKi Dae <inki.dae@samsung.com>
> --
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index 9bab6cf..c5335e5 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -1846,8 +1846,10 @@ void dispc_enable_trans_key(enum omap_channel
> ch, bool enable)
>           enable_clocks(1);
>           if (ch == OMAP_DSS_CHANNEL_LCD)
>                      REG_FLD_MOD(DISPC_CONFIG, enable, 10, 10);
> -          else /* OMAP_DSS_CHANNEL_DIGIT */
> +         else if (ch == OMAP_DSS_CHANNEL_DIGIT)
>                      REG_FLD_MOD(DISPC_CONFIG, enable, 12, 12);
> +         else
> +                   BUG();

BUG() will halt the whole kernel.  I don't think you want to do that
for this issue.  I think WARN() is more appropriate here and the other
cases in this patch as well.

Kevin

>           enable_clocks(0);
>  }
>  void dispc_enable_alpha_blending(enum omap_channel ch, bool enable)
> @@ -1855,8 +1857,10 @@ void dispc_enable_alpha_blending(enum
> omap_channel ch, bool enable)
>           enable_clocks(1);
>           if (ch == OMAP_DSS_CHANNEL_LCD)
>                      REG_FLD_MOD(DISPC_CONFIG, enable, 18, 18);
> -          else /* OMAP_DSS_CHANNEL_DIGIT */
> +         else if (ch == OMAP_DSS_CHANNEL_DIGIT)
>                      REG_FLD_MOD(DISPC_CONFIG, enable, 19, 19);
> +         else
> +                   BUG();
>           enable_clocks(0);
>  }
>  bool dispc_alpha_blending_enabled(enum omap_channel ch)
> @@ -1867,7 +1871,7 @@ bool dispc_alpha_blending_enabled(enum omap_channel ch)
>           if (ch == OMAP_DSS_CHANNEL_LCD)
>                      enabled = REG_GET(DISPC_CONFIG, 18, 18);
>           else if (ch == OMAP_DSS_CHANNEL_DIGIT)
> -                    enabled = REG_GET(DISPC_CONFIG, 18, 18);
> +                   enabled = REG_GET(DISPC_CONFIG, 19, 19);
>           else
>                      BUG();
>           enable_clocks(0);
> @@ -1876,6 +1880,18 @@ bool dispc_alpha_blending_enabled(enum omap_channel ch)
>
>  }
>
> +void dispc_set_global_alpha(int layer, int alpha)
> +{
> +         enable_clocks(1);
> +         if (layer == 0)
> +                   REG_FLD_MOD(DISPC_GLOBAL_ALPHA, alpha, 7, 0);
> +         else if (layer == 2)
> +                   REG_FLD_MOD(DISPC_GLOBAL_ALPHA, alpha, 23, 16);
> +         else
> +                   BUG();
> +
> +         enable_clocks(0);
> +}
>
>  bool dispc_trans_key_enabled(enum omap_channel ch)
>  {
> diff --git a/drivers/video/omap2/omapfb/omapfb-main.c
> b/drivers/video/omap2/omapfb/omapfb-main.c
> index 76e7c6c..98cad35 100644
> --- a/drivers/video/omap2/omapfb/omapfb-main.c
> +++ b/drivers/video/omap2/omapfb/omapfb-main.c
> @@ -1583,6 +1583,17 @@ int omapfb_fb_init(struct omapfb2_device
> *fbdev, struct fb_info *fbi)
>                                           r = mode;
>                                           goto err;
>                                 }
> +
> +                              if (mode == OMAP_DSS_COLOR_ARGB16 ||
> +                                                   mode ==
> OMAP_DSS_COLOR_RGBA32 ||
> +                                                   mode ==
> OMAP_DSS_COLOR_ARGB32) {
> +
> +
> dispc_enable_alpha_blending(OMAP_DSS_CHANNEL_LCD, 1);
> +
> +                                         /* Set global alpha value to
> fully apaque */
> +                                         dispc_set_global_alpha(id, 255);
> +                              }
> +
>                                 r = dss_mode_to_fb_mode(mode, var);
>                                 if (r < 0)
>                                           goto err;
> diff --git a/drivers/video/omap2/omapfb/omapfb.h
> b/drivers/video/omap2/omapfb/omapfb.h
> index 43f6922..56c303e 100644
> --- a/drivers/video/omap2/omapfb/omapfb.h
> +++ b/drivers/video/omap2/omapfb/omapfb.h
> @@ -147,4 +147,8 @@ static inline int omapfb_overlay_enable(struct
> omap_overlay *ovl,
>           return ovl->set_overlay_info(ovl, &info);
>  }
>
> +extern void dispc_enable_alpha_blending(enum omap_channel ch,
> +                   int enable);
> +extern void dispc_set_global_alpha(int layer, int alpha);
> +
>  #endif
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap"
> in the body of a message to majordomo@vger.kernel.org More majordomo
> info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-04-24 13:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-24  9:13 [PATCH] enabled alpha blender for OMAP2/3 DSS2 driver InKi Dae
2009-04-24 13:46 ` Kevin Hilman [this message]
2009-04-25 16:00   ` InKi Dae
2009-04-26 10:22     ` 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=87skjyxiyr.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=daeinki@gmail.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tomi.valkeinen@nokia.com \
    /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.