All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chandrabhanu Mahapatra <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 21/29] OMAPDSS: DISPC: Configure overlay-like parameters in dispc_wb_setup
Date: Thu, 02 Aug 2012 10:22:46 +0000	[thread overview]
Message-ID: <501A5226.50106@ti.com> (raw)
In-Reply-To: <1324989432-3625-22-git-send-email-archit@ti.com>

On Tuesday 27 December 2011 06:07 PM, Archit Taneja wrote:
> Call dispc_plane_setup() through dispc_wb_setup() to configure overlay-like
> parameters. Create a helper function in writeback.c called dss_wb_calc_params()
> which for now calculates the input width and height which goes to writeback.
> Create a dummy dispc function which returns the channel of the manager to which
> the writeback pipeline is connected.
>
> The parameters in dispc_plane_setup() which do not hold for writeback are filled
> passed as zeroes or false, dispc_plane_setup() takes care of not configuring
> them if the plane is writeback.
>
> Signed-off-by: Archit Taneja <archit@ti.com>
> ---
>  drivers/video/omap2/dss/apply.c     |    5 ++++-
>  drivers/video/omap2/dss/dispc.c     |   33 +++++++++++++++++++++++++++++++--
>  drivers/video/omap2/dss/dss.h       |    6 +++++-
>  drivers/video/omap2/dss/writeback.c |   17 +++++++++++++++++
>  4 files changed, 57 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
> index a17cc47..dd1fd419 100644
> --- a/drivers/video/omap2/dss/apply.c
> +++ b/drivers/video/omap2/dss/apply.c
> @@ -661,6 +661,7 @@ static void dss_wb_write_regs(struct omap_dss_writeback *wb)
>  {
>  	struct wb_priv_data *wp = get_wb_priv(wb);
>  	struct omap_dss_writeback_info *wi;
> +	u16 in_width, in_height;
>  	int r;
>  
>  	if (!wp->enabled || !wp->info_dirty)
> @@ -670,7 +671,9 @@ static void dss_wb_write_regs(struct omap_dss_writeback *wb)
>  
>  	wi = &wp->info;
>  
> -	r = dispc_wb_setup(wb->id, wi);
> +	dss_wb_calc_params(wb, wi, &in_width, &in_height);
> +
> +	r = dispc_wb_setup(wb->id, wi, in_width, in_height);
>  	if (r) {
>  		DSSERR("dispc_wb_setup failed\n");
>  		return;
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index 3a40f8e..c7de56d 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -908,6 +908,13 @@ void dispc_wb_set_channel_in(int id, enum dss_writeback_channel_in ch_in)
>  	return;
>  }
>  
> +static enum omap_channel dispc_wb_get_channel_in(int plane)
> +{
> +	/* Return LCD channel for now */
> +
> +	return OMAP_DSS_CHANNEL_LCD;
> +}
> +
>  static void dispc_ovl_set_burst_size(enum omap_plane plane,
>  		enum omap_burst_size burst_size)
>  {
> @@ -1935,9 +1942,31 @@ int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi,
>  	return r;
>  }
>  
> -int dispc_wb_setup(int id, struct omap_dss_writeback_info *wi)
> +int dispc_wb_setup(int id, struct omap_dss_writeback_info *wi,
> +		u16 in_width, u16 in_height)
>  {
> -	return 0;
> +	int r;
> +	struct omap_dss_writeback *wb = omap_dss_get_writeback(id);
> +	const int pos_x = 0, pos_y = 0;
> +	const u8 zorder = 0, global_alpha = 0;
> +	const bool chroma_upscale = false, ilace = false, replication = false;
> +	enum omap_channel channel;
> +
> +	channel = dispc_wb_get_channel_in(wb->plane_id);
> +
> +	DSSDBG("dispc_wb_setup %d, pa %x, pa_uv %x, %d,%d -> %dx%d, cmode %x, "
> +		"rot %d, mir %d, chan %d\n",
> +		wb->id, wi->paddr, wi->p_uv_addr, in_width, in_height,
> +		wi->buf_width, wi->buf_height, wi->color_mode, wi->rotation,
> +		wi->mirror, channel);
> +
> +	r = dispc_plane_setup(wb->plane_id, channel, wb->caps, wi->paddr,
> +		wi->p_uv_addr, in_width, pos_x, pos_y, in_width, in_height,
> +		wi->buf_width, wi->buf_height, wi->color_mode, wi->rotation,
> +		wi->mirror, zorder, wi->pre_mult_alpha, global_alpha,
> +		wi->rotation_type, chroma_upscale, ilace, replication);
The only note worthy difference here is use of omap_dss_writeback_info
*wi instead of omap_overlay_info *oi in dispc_ovl_setup(). If
omap_overlay_info can be used instead of omap_dss_writeback_info then
the same dispc_ovl_setup() would have been used to handle writeback as a
plane just like others but with extra checks for (plane = OMAP_DSS_WB).
I think this way it would have been much cleaner otherwise it looks good.
> +
> +	return r;
>  }
>  
>  int dispc_ovl_enable(enum omap_plane plane, bool enable)
> diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
> index 1b128f1..69b4793 100644
> --- a/drivers/video/omap2/dss/dss.h
> +++ b/drivers/video/omap2/dss/dss.h
> @@ -249,6 +249,9 @@ void dss_init_writeback(void);
>  void dss_uninit_writeback(void);
>  int writeback_init_display(struct omap_dss_device *dssdev);
>  enum dss_writeback_channel_in dss_wb_calc_channel_in(struct omap_dss_writeback *wb);
> +void dss_wb_calc_params(struct omap_dss_writeback *wb,
> +		struct omap_dss_writeback_info *wi, u16 *in_width,
> +		u16 *in_height);
>  int dss_wb_simple_check(struct omap_dss_writeback *wb,
>  		const struct omap_dss_writeback_info *info);
>  
> @@ -492,7 +495,8 @@ void dispc_mgr_setup(enum omap_channel channel,
>  
>  bool dispc_wb_go_busy(int id);
>  void dispc_wb_go(int id);
> -int dispc_wb_setup(int id, struct omap_dss_writeback_info *wi);
> +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);
>  
> diff --git a/drivers/video/omap2/dss/writeback.c b/drivers/video/omap2/dss/writeback.c
> index 14103bf..7c4e9c0 100644
> --- a/drivers/video/omap2/dss/writeback.c
> +++ b/drivers/video/omap2/dss/writeback.c
> @@ -141,6 +141,23 @@ enum dss_writeback_channel_in dss_wb_calc_channel_in(struct omap_dss_writeback *
>  	}
>  }
>  
> +void dss_wb_calc_params(struct omap_dss_writeback *wb,
> +		struct omap_dss_writeback_info *wi, u16 *in_width,
> +		u16 *in_height)
> +{
> +	struct omap_video_timings timings;
> +	struct omap_dss_device *dssdev;
> +	struct omap_overlay_manager *mgr;
> +
> +	mgr = wb->dssdev->manager;
> +	dssdev = mgr->get_display(mgr);
> +
> +	dssdev->driver->get_timings(dssdev, &timings);
> +
> +	*in_width = timings.x_res;
> +	*in_height = timings.y_res;
> +}
> +
>  int dss_wb_simple_check(struct omap_dss_writeback *wb,
>  		const struct omap_dss_writeback_info *info)
>  {


-- 
Chandrabhanu Mahapatra
Texas Instruments India Pvt. Ltd.


WARNING: multiple messages have this Message-ID (diff)
From: Chandrabhanu Mahapatra <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 21/29] OMAPDSS: DISPC: Configure overlay-like parameters in dispc_wb_setup
Date: Thu, 02 Aug 2012 15:40:46 +0530	[thread overview]
Message-ID: <501A5226.50106@ti.com> (raw)
In-Reply-To: <1324989432-3625-22-git-send-email-archit@ti.com>

On Tuesday 27 December 2011 06:07 PM, Archit Taneja wrote:
> Call dispc_plane_setup() through dispc_wb_setup() to configure overlay-like
> parameters. Create a helper function in writeback.c called dss_wb_calc_params()
> which for now calculates the input width and height which goes to writeback.
> Create a dummy dispc function which returns the channel of the manager to which
> the writeback pipeline is connected.
>
> The parameters in dispc_plane_setup() which do not hold for writeback are filled
> passed as zeroes or false, dispc_plane_setup() takes care of not configuring
> them if the plane is writeback.
>
> Signed-off-by: Archit Taneja <archit@ti.com>
> ---
>  drivers/video/omap2/dss/apply.c     |    5 ++++-
>  drivers/video/omap2/dss/dispc.c     |   33 +++++++++++++++++++++++++++++++--
>  drivers/video/omap2/dss/dss.h       |    6 +++++-
>  drivers/video/omap2/dss/writeback.c |   17 +++++++++++++++++
>  4 files changed, 57 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
> index a17cc47..dd1fd419 100644
> --- a/drivers/video/omap2/dss/apply.c
> +++ b/drivers/video/omap2/dss/apply.c
> @@ -661,6 +661,7 @@ static void dss_wb_write_regs(struct omap_dss_writeback *wb)
>  {
>  	struct wb_priv_data *wp = get_wb_priv(wb);
>  	struct omap_dss_writeback_info *wi;
> +	u16 in_width, in_height;
>  	int r;
>  
>  	if (!wp->enabled || !wp->info_dirty)
> @@ -670,7 +671,9 @@ static void dss_wb_write_regs(struct omap_dss_writeback *wb)
>  
>  	wi = &wp->info;
>  
> -	r = dispc_wb_setup(wb->id, wi);
> +	dss_wb_calc_params(wb, wi, &in_width, &in_height);
> +
> +	r = dispc_wb_setup(wb->id, wi, in_width, in_height);
>  	if (r) {
>  		DSSERR("dispc_wb_setup failed\n");
>  		return;
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index 3a40f8e..c7de56d 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -908,6 +908,13 @@ void dispc_wb_set_channel_in(int id, enum dss_writeback_channel_in ch_in)
>  	return;
>  }
>  
> +static enum omap_channel dispc_wb_get_channel_in(int plane)
> +{
> +	/* Return LCD channel for now */
> +
> +	return OMAP_DSS_CHANNEL_LCD;
> +}
> +
>  static void dispc_ovl_set_burst_size(enum omap_plane plane,
>  		enum omap_burst_size burst_size)
>  {
> @@ -1935,9 +1942,31 @@ int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi,
>  	return r;
>  }
>  
> -int dispc_wb_setup(int id, struct omap_dss_writeback_info *wi)
> +int dispc_wb_setup(int id, struct omap_dss_writeback_info *wi,
> +		u16 in_width, u16 in_height)
>  {
> -	return 0;
> +	int r;
> +	struct omap_dss_writeback *wb = omap_dss_get_writeback(id);
> +	const int pos_x = 0, pos_y = 0;
> +	const u8 zorder = 0, global_alpha = 0;
> +	const bool chroma_upscale = false, ilace = false, replication = false;
> +	enum omap_channel channel;
> +
> +	channel = dispc_wb_get_channel_in(wb->plane_id);
> +
> +	DSSDBG("dispc_wb_setup %d, pa %x, pa_uv %x, %d,%d -> %dx%d, cmode %x, "
> +		"rot %d, mir %d, chan %d\n",
> +		wb->id, wi->paddr, wi->p_uv_addr, in_width, in_height,
> +		wi->buf_width, wi->buf_height, wi->color_mode, wi->rotation,
> +		wi->mirror, channel);
> +
> +	r = dispc_plane_setup(wb->plane_id, channel, wb->caps, wi->paddr,
> +		wi->p_uv_addr, in_width, pos_x, pos_y, in_width, in_height,
> +		wi->buf_width, wi->buf_height, wi->color_mode, wi->rotation,
> +		wi->mirror, zorder, wi->pre_mult_alpha, global_alpha,
> +		wi->rotation_type, chroma_upscale, ilace, replication);
The only note worthy difference here is use of omap_dss_writeback_info
*wi instead of omap_overlay_info *oi in dispc_ovl_setup(). If
omap_overlay_info can be used instead of omap_dss_writeback_info then
the same dispc_ovl_setup() would have been used to handle writeback as a
plane just like others but with extra checks for (plane == OMAP_DSS_WB).
I think this way it would have been much cleaner otherwise it looks good.
> +
> +	return r;
>  }
>  
>  int dispc_ovl_enable(enum omap_plane plane, bool enable)
> diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
> index 1b128f1..69b4793 100644
> --- a/drivers/video/omap2/dss/dss.h
> +++ b/drivers/video/omap2/dss/dss.h
> @@ -249,6 +249,9 @@ void dss_init_writeback(void);
>  void dss_uninit_writeback(void);
>  int writeback_init_display(struct omap_dss_device *dssdev);
>  enum dss_writeback_channel_in dss_wb_calc_channel_in(struct omap_dss_writeback *wb);
> +void dss_wb_calc_params(struct omap_dss_writeback *wb,
> +		struct omap_dss_writeback_info *wi, u16 *in_width,
> +		u16 *in_height);
>  int dss_wb_simple_check(struct omap_dss_writeback *wb,
>  		const struct omap_dss_writeback_info *info);
>  
> @@ -492,7 +495,8 @@ void dispc_mgr_setup(enum omap_channel channel,
>  
>  bool dispc_wb_go_busy(int id);
>  void dispc_wb_go(int id);
> -int dispc_wb_setup(int id, struct omap_dss_writeback_info *wi);
> +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);
>  
> diff --git a/drivers/video/omap2/dss/writeback.c b/drivers/video/omap2/dss/writeback.c
> index 14103bf..7c4e9c0 100644
> --- a/drivers/video/omap2/dss/writeback.c
> +++ b/drivers/video/omap2/dss/writeback.c
> @@ -141,6 +141,23 @@ enum dss_writeback_channel_in dss_wb_calc_channel_in(struct omap_dss_writeback *
>  	}
>  }
>  
> +void dss_wb_calc_params(struct omap_dss_writeback *wb,
> +		struct omap_dss_writeback_info *wi, u16 *in_width,
> +		u16 *in_height)
> +{
> +	struct omap_video_timings timings;
> +	struct omap_dss_device *dssdev;
> +	struct omap_overlay_manager *mgr;
> +
> +	mgr = wb->dssdev->manager;
> +	dssdev = mgr->get_display(mgr);
> +
> +	dssdev->driver->get_timings(dssdev, &timings);
> +
> +	*in_width = timings.x_res;
> +	*in_height = timings.y_res;
> +}
> +
>  int dss_wb_simple_check(struct omap_dss_writeback *wb,
>  		const struct omap_dss_writeback_info *info)
>  {


-- 
Chandrabhanu Mahapatra
Texas Instruments India Pvt. Ltd.


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

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