linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Chandrabhanu Mahapatra <cmahapatra@ti.com>
Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 2/7] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields to dispc_features
Date: Tue, 04 Dec 2012 08:16:28 +0000	[thread overview]
Message-ID: <50BDB15C.9040406@ti.com> (raw)
In-Reply-To: <50BC46C6.3050707@ti.com>

[-- Attachment #1: Type: text/plain, Size: 3273 bytes --]

On 2012-12-03 08:29, Chandrabhanu Mahapatra wrote:
> On Thursday 29 November 2012 05:48 PM, Tomi Valkeinen wrote:
>> On 2012-11-28 12:41, Chandrabhanu Mahapatra wrote:
>>> The register fields in dss_reg_fields specific to DISPC are moved from struct
>>> omap_dss_features to corresponding dispc_reg_fields, initialized in struct
>>> dispc_features, thereby enabling local access.
>>>
>>> Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
>>> ---
>>>  drivers/video/omap2/dss/dispc.c        |   87 ++++++++++++++++++++++++++++----
>>>  drivers/video/omap2/dss/dss.h          |    4 ++
>>>  drivers/video/omap2/dss/dss_features.c |   28 ----------
>>>  drivers/video/omap2/dss/dss_features.h |    7 ---
>>>  4 files changed, 80 insertions(+), 46 deletions(-)
>>>
>>> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
>>> index 9f259ba..21fc522 100644
>>> --- a/drivers/video/omap2/dss/dispc.c
>>> +++ b/drivers/video/omap2/dss/dispc.c
>>> @@ -80,6 +80,16 @@ struct dispc_irq_stats {
>>>  	unsigned irqs[32];
>>>  };
>>>  
>>> +enum dispc_feat_reg_field {
>>> +	FEAT_REG_FIRHINC,
>>> +	FEAT_REG_FIRVINC,
>>> +	FEAT_REG_FIFOLOWTHRESHOLD,
>>> +	FEAT_REG_FIFOHIGHTHRESHOLD,
>>> +	FEAT_REG_FIFOSIZE,
>>> +	FEAT_REG_HORIZONTALACCU,
>>> +	FEAT_REG_VERTICALACCU,
>>> +};
>>> +
>>>  struct dispc_features {
>>>  	u8 sw_start;
>>>  	u8 fp_start;
>>> @@ -107,6 +117,8 @@ struct dispc_features {
>>>  
>>>  	u32 buffer_size_unit;
>>>  	u32 burst_size_unit;
>>> +
>>> +	struct register_field *reg_fields;
>>>  };
>>
>> Hmm, would it be simpler to have an explicit struct for the reg fields.
>> I mean something like:
>>
>> struct dispc_reg_fields {
>> 	struct register_field firhinc;
>> 	struct register_field firvinc;
>> 	struct register_field fifo_low_threshold;
>> 	...
>> };
>>
>> Then accessing it would be
>>
>> dispc.feat->reg_fields.firhinc.start;
>>
>> instead of
>>
>> dispc.feat->reg_fields[FEAT_REG_FIFOSIZE].start;
>>
>> Not a big difference, but I don't see any benefit in having an array of
>> reg fields here.
>>
>>  Tomi
>>
>>
> 
> I was thinking to move reg_fields into the dispc_feats structure as
> 
> 	.burst_size_unit	=	8,
> 	.reg_fields		=	{
> 		.firhinc			= { 12,  0 },
> 		.firvinc			= { 28, 16 },
> 		.fifo_low_thresh		= { 11,  0 },
> 		.fifo_high_thresh		= { 27, 16 },
> 		.fifosize			= { 10,  0 },
> 		.hori_accu			= {  9,  0 },
> 		.vert_accu			= { 25, 16 },
> 	},
> 
> This would give us dispc.feat->reg_fields.firhinc.start;
> but at the same time would create duplicate information for
> omap34xx_rev1_0_dispc_feats and omap34xx_rev3_0_dispc_feats. However,
> this duplication never occurs anywhere else in dss.c or dsi.c.
> 
> If we still go with the older approach of having dispc_reg_fields
> outside dispc_feats the only way  it works is
> 
> .reg_fields		=	&omap2_dispc_reg_fields
> 
> which changes as dispc.feat->reg_fields->firhinc.start;
> 
> but avoids duplicate information. Both approaches seem good enough to me.

I would keep the pointer approach. We may add support for new DSS
versions, for AM3xxx or AM4xxx SoCs, which possibly may have the same
register fields as some other DSS versions.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

  reply	other threads:[~2012-12-04  8:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-28 10:53 [PATCH 0/7] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
2012-11-28 10:53 ` [PATCH 1/7] OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features Chandrabhanu Mahapatra
2012-11-29 12:01   ` Tomi Valkeinen
2012-11-28 10:53 ` [PATCH 2/7] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields " Chandrabhanu Mahapatra
2012-11-29 12:05   ` Tomi Valkeinen
2012-11-30 10:14     ` Chandrabhanu Mahapatra
2012-11-30 10:25       ` Tomi Valkeinen
2012-11-29 12:18   ` Tomi Valkeinen
2012-12-03  6:41     ` Chandrabhanu Mahapatra
2012-12-04  8:16       ` Tomi Valkeinen [this message]
2012-11-28 10:53 ` [PATCH 3/7] OMAPDSS: DISPC: Move DISPC specific dss_params " Chandrabhanu Mahapatra
2012-11-29 12:08   ` Tomi Valkeinen
2012-11-28 10:53 ` [PATCH 4/7] OMAPDSS: DSI: Move DSI specific reg_fields to dsi_feats Chandrabhanu Mahapatra
2012-11-28 10:53 ` [PATCH 5/7] OMAPDSS: DSI: Move DSI specific dss_params " Chandrabhanu Mahapatra
2012-11-28 10:53 ` [PATCH 6/7] OMAPDSS: DSS: Add members fld_dispc_clk_switch and dss_fck_max Chandrabhanu Mahapatra
2012-11-28 10:53 ` [PATCH 7/7] OMAPDSS: DSI: Add FEAT_PARAM_DSS_FCK Chandrabhanu Mahapatra
2012-12-05 10:28 ` [PATCH V2 0/6] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
2012-12-05 10:28   ` [PATCH V2 1/6] OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features Chandrabhanu Mahapatra
2012-12-05 10:28   ` [PATCH V2 2/6] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields " Chandrabhanu Mahapatra
2012-12-17 12:37     ` Tomi Valkeinen
2012-12-19  9:39       ` Chandrabhanu Mahapatra
2012-12-05 10:28   ` [PATCH V2 3/6] OMAPDSS: DISPC: Move DISPC specific dss_params " Chandrabhanu Mahapatra
2012-12-05 10:28   ` [PATCH V2 4/6] OMAPDSS: DSI: Move DSI specific reg_fields to dsi_feats Chandrabhanu Mahapatra
2012-12-17 12:23     ` Tomi Valkeinen
2012-12-19  9:10       ` Chandrabhanu Mahapatra
2012-12-05 10:28   ` [PATCH V2 5/6] OMAPDSS: DSI: Move DSI specific dss_params " Chandrabhanu Mahapatra
2012-12-05 10:28   ` [PATCH V2 6/6] OMAPDSS: DSS: Add members fld_dispc_clk_switch and dss_fck_max Chandrabhanu Mahapatra

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=50BDB15C.9040406@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=cmahapatra@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@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).