linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Mahapatra, Chandrabhanu" <cmahapatra@ti.com>
To: Archit Taneja <archit@ti.com>
Cc: tomi.valkeinen@ti.com, rohitkc@ti.com,
	linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Subject: Re: [RFC PATCH 22/29] OMAPDSS: DISPC: Setup writeback go, enable and channel_in functions
Date: Thu, 02 Aug 2012 10:07:35 +0000	[thread overview]
Message-ID: <CAF0AtAvnvko_8dkN1aho05JPAEHTi11kak2paJXFODHDC=ifyg@mail.gmail.com> (raw)
In-Reply-To: <1324989432-3625-23-git-send-email-archit@ti.com>

On Tue, Dec 27, 2011 at 6:07 PM, Archit Taneja <archit@ti.com> wrote:
> Fill up dispc_wb_go(), dispc_wb_go_busy(), dispc_wb_enable() and
> dispc_wb_get_channel_in()/set_channel_in() with writeback register writes. Make
> a minor modification in dss_wb_write_regs_extra() to pass the plane_id instead
> of the writeback id when calling dispc_wb_set_channel_in().
>
> Setup dispc_wb_enable() as dispc_enable_lcd_out() function and wait for the
> FRAMEDONEWB interrupt while disabling writeback.
>
> Signed-off-by: Archit Taneja <archit@ti.com>
> ---
>  drivers/video/omap2/dss/apply.c |    2 +-
>  drivers/video/omap2/dss/dispc.c |   68 +++++++++++++++++++++++++++++++++++----
>  drivers/video/omap2/dss/dss.h   |    2 +-
>  3 files changed, 63 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
> index dd1fd419..57b061f 100644
> --- a/drivers/video/omap2/dss/apply.c
> +++ b/drivers/video/omap2/dss/apply.c
> @@ -690,7 +690,7 @@ static void dss_wb_write_regs_extra(struct omap_dss_writeback *wb)
>         if (!wp->extra_info_dirty)
>                 return;
>
> -       dispc_wb_set_channel_in(wb->id, wp->channel_in);
> +       dispc_wb_set_channel_in(wb->plane_id, wp->channel_in);
>         dispc_ovl_set_fifo_threshold(wb->plane_id, wp->fifo_low, wp->fifo_high);
>
>         wp->extra_info_dirty = false;
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index c7de56d..cbce120 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -510,12 +510,26 @@ void dispc_mgr_go(enum omap_channel channel)
>
>  bool dispc_wb_go_busy(int id)
>  {
> -       return false;
> +       return REG_GET(DISPC_CONTROL2, 6, 6) = 1;
>  }
>
>  void dispc_wb_go(int id)
>  {
> -       return;
> +       struct omap_dss_writeback *wb = omap_dss_get_writeback(id);
> +       bool enable, go;
> +
> +       enable = REG_GET(DISPC_OVL_ATTRIBUTES(wb->plane_id), 0, 0) = 1;
> +
> +       if (!enable)
> +               return;
> +
> +       go = REG_GET(DISPC_CONTROL2, 6, 6) = 1;
> +       if (go) {
> +               DSSERR("GO bit not down for WB\n");
> +               return;
> +       }
> +
> +       REG_FLD_MOD(DISPC_CONTROL2, 1, 6, 6);
>  }
>
>  static void dispc_ovl_write_firh_reg(enum omap_plane plane, int reg, u32 value)
> @@ -903,16 +917,24 @@ static enum omap_channel dispc_ovl_get_channel_out(enum omap_plane plane)
>         return channel;
>  }
>
> -void dispc_wb_set_channel_in(int id, enum dss_writeback_channel_in ch_in)
> +void dispc_wb_set_channel_in(int plane, enum dss_writeback_channel_in ch_in)
>  {
> -       return;
> +       REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), ch_in, 18, 16);
>  }
>
>  static enum omap_channel dispc_wb_get_channel_in(int plane)
>  {
> -       /* Return LCD channel for now */
> +       int channel_in = REG_GET(DISPC_OVL_ATTRIBUTES(plane), 18, 16);
>
> -       return OMAP_DSS_CHANNEL_LCD;
> +       switch (channel_in) {
> +       case OMAP_DSS_WB_LCD2_MGR:
> +               return OMAP_DSS_CHANNEL_LCD2;
> +       case OMAP_DSS_WB_TV_MGR:
> +               return OMAP_DSS_CHANNEL_DIGIT;
> +       case OMAP_DSS_WB_LCD1_MGR:
> +       default:
> +               return OMAP_DSS_CHANNEL_LCD;
> +       };
>  }
>

What about other cases of pipelines and overlays here? You have
considered only overlays and that too ignored OMAP_DSS_CHANNEL_LCD3.

The channel_in parameter of DISPC_WB_ATTRIBUTES does handle the
following cases as well:
0x0: Primary LCD overlay output
0x1: Secondary LCD output
0x2: TV overlay output
0x7: Third LCD output

0x3: Graphics pipeline output
0x4: Video1 pipeline output
0x5: Video2 pipeline output
0x6: Video3 pipeline output

>  static void dispc_ovl_set_burst_size(enum omap_plane plane,
> @@ -2138,7 +2160,39 @@ void dispc_mgr_enable(enum omap_channel channel, bool enable)
>
>  void dispc_wb_enable(int id, bool enable)
>  {
> -       return;
> +       struct omap_dss_writeback *wb = omap_dss_get_writeback(id);
> +       enum omap_plane plane = wb->plane_id;
> +       struct completion frame_done_completion;
> +       bool is_on;
> +       int r;
> +       u32 irq;
> +
> +       is_on = REG_GET(DISPC_OVL_ATTRIBUTES(plane), 0, 0);
> +       irq = DISPC_IRQ_FRAMEDONEWB;
> +
> +       if (!enable && is_on) {
> +               init_completion(&frame_done_completion);
> +
> +               r = omap_dispc_register_isr(dispc_disable_isr,
> +                               &frame_done_completion, irq);
> +
> +               if (r)
> +                       DSSERR("failed to register FRAMEDONEWB isr\n");
> +       }
> +
> +       REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), enable ? 1 : 0, 0, 0);
> +
> +       if (!enable && is_on) {
> +               if (!wait_for_completion_timeout(&frame_done_completion,
> +                                       msecs_to_jiffies(100)))
> +                       DSSERR("timeout waiting for FRAMEDONEWB\n");
> +
> +               r = omap_dispc_unregister_isr(dispc_disable_isr,
> +                               &frame_done_completion, irq);
> +
> +               if (r)
> +                       DSSERR("failed to unregister FRAMEDONEWB isr\n");
> +       }
>  }
>
>  void dispc_lcd_enable_signal_polarity(bool act_high)
> diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
> index 69b4793..c05658b 100644
> --- a/drivers/video/omap2/dss/dss.h
> +++ b/drivers/video/omap2/dss/dss.h
> @@ -498,7 +498,7 @@ void dispc_wb_go(int id);
>  int dispc_wb_setup(int id, struct omap_dss_writeback_info *wi,
>                 u16 in_width, u16 in_height);
>  void dispc_wb_enable(int id, bool enable);
> -void dispc_wb_set_channel_in(int id, enum dss_writeback_channel_in ch_in);
> +void dispc_wb_set_channel_in(int plane, enum dss_writeback_channel_in ch_in);
>
>  /* VENC */
>  #ifdef CONFIG_OMAP2_DSS_VENC
> --
> 1.7.4.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Chandrabhanu Mahapatra
Texas Instruments India Pvt. Ltd.

  reply	other threads:[~2012-08-02 10:07 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-27 12:48 [RFC PATCH 00/29] OMAPDSS: Initial Writeback Capture mode support Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 01/29] omapdss/omapfb/omap_vout: Introduce manager output struct Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 02/29] OMAPDSS: Add writeback to omap_dss_mgr_output Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 03/29] OMAPDSS: Writeback: Add writeback interface and panel driver Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 04/29] OMAPDSS: APPLY/Writeback: Add writeback_info Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 05/29] OMAPDSS: APPLY/Writeback: Apply writeback configurations Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 06/29] OMAPDSS: APPLY: Add writeback enable/disable functions Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 07/29] OMAPDSS: APPLY: Add extra_info for writeback Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 08/29] OMAPDSS: APPLY: Modify manager unset device op Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 09/29] OMAPDSS: APPLY: Allow manager set/unset_device ops to set/unset writeback Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 10/29] OMAPDSS: APPLY: Calculate channel_in for writeback Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 11/29] OMAPDSS: DISPC: Add writeback as a new plane Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 12/29] OMAPDSS: Writeback: Add check for color_mode in dss_wb_simple_check() Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 13/29] OMAPDSS: APPLY: Configure writeback FIFOs Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 14/29] OMAPDSS: DISPC: Allow both upscaling and downscaling of chroma Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 15/29] OMAPDSS: DISPC: Pass overlay caps as a parameter to DISPC overlay related function Archit Taneja
2011-12-27 12:48 ` [RFC PATCH 16/29] OMAPDSS: OVERLAY: Add position and replication as overlay caps Archit Taneja
2011-12-27 12:49 ` [RFC PATCH 17/29] OMAPDSS: DISPC: Make dispc_ovl_setup call dispc_plane_setup Archit Taneja
2011-12-27 12:49 ` [RFC PATCH 18/29] OMAPDSS: DISPC: Make chroma_upscale an argument to dispc_plane_setup Archit Taneja
2011-12-27 12:49 ` [RFC PATCH 19/29] OMAPDSS: DISPC: Don't set chroma resampling bit for writeback Archit Taneja
2011-12-27 12:49 ` [RFC PATCH 20/29] OMAPDSS: Writeback: Add writeback capabilities Archit Taneja
2011-12-27 12:49 ` [RFC PATCH 21/29] OMAPDSS: DISPC: Configure overlay-like parameters in dispc_wb_setup Archit Taneja
2012-08-02 10:22   ` Chandrabhanu Mahapatra
2011-12-27 12:49 ` [RFC PATCH 22/29] OMAPDSS: DISPC: Setup writeback go, enable and channel_in functions Archit Taneja
2012-08-02 10:07   ` Mahapatra, Chandrabhanu [this message]
2011-12-27 12:49 ` [RFC PATCH 23/29] OMAPDSS: Writeback: Configure writeback specific parameters Archit Taneja
2011-12-27 12:49 ` [RFC PATCH 24/29] OMAPDSS: Writeback: Use panel driver ops to configure mirroring rotation and buffe Archit Taneja
2011-12-27 12:49 ` [RFC PATCH 25/29] OMAPDSS: Writeback: Add sysfs attributes to writeback panel Archit Taneja
2011-12-27 12:49 ` [RFC PATCH 26/29] OMAPDSS: DISPLAY: Add a manager apply to sysfs store attributes for writeback Archit Taneja
2011-12-27 12:49 ` [RFC PATCH 27/29] OMAPDSS: MANAGER: Split manager_display_store into smaller functions Archit Taneja
2011-12-27 12:49 ` [RFC PATCH 28/29] OMAPDSS: MANAGER: Add writeback as a sysfs attribute Archit Taneja
2011-12-27 12:49 ` [RFC PATCH 29/29] OMAPDSS: FEATURES: Allow WB panels to attach to managers Archit Taneja

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='CAF0AtAvnvko_8dkN1aho05JPAEHTi11kak2paJXFODHDC=ifyg@mail.gmail.com' \
    --to=cmahapatra@ti.com \
    --cc=archit@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rohitkc@ti.com \
    --cc=tomi.valkeinen@ti.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 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).