From: Shobhit Kumar <shobhit.kumar@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>, Jani Nikula <jani.nikula@intel.com>
Cc: vijayakumar.balakrishnan@intel.com,
intel-gfx <intel-gfx@lists.freedesktop.org>,
yogesh.mohan.marimuthu@intel.com
Subject: Re: [PATCH v2 5/7] drm/i915: Reorganize the DSI enable/disable sequence
Date: Fri, 06 Dec 2013 16:50:21 +0530 [thread overview]
Message-ID: <52A1B2F5.8060303@intel.com> (raw)
In-Reply-To: <528C12B4.2080002@intel.com>
On Wednesday 20 November 2013 07:09 AM, Shobhit Kumar wrote:
> On Friday 15 November 2013 02:25 PM, Daniel Vetter wrote:
>> On Fri, Nov 15, 2013 at 10:27:25AM +0200, Jani Nikula wrote:
>>> On Sat, 09 Nov 2013, Shobhit Kumar <shobhit.kumar@intel.com> wrote:
>>>> Basically ULPS handling during enable/disable has been moved to
>>>> pre_enable and post_disable phases. PLL and panel power disable
>>>> also has been moved to post_disable phase. The ULPS entry/exit
>>>> sequneces as suggested by HW team is as follows -
>>>>
>>>> During enable time -
>>>> set DEVICE_READY --> Clear DEVICE_READY --> set DEVICE_READY
>>>>
>>>> And during disable time to flush all FIFOs -
>>>> set ENTER_SLEEP --> EXIT_SLEEP --> ENTER_SLEEP
>>>>
>>>> Also during disbale sequnece sub-encoder disable is moved to the end
>>>> after port is disabled.
>>>>
>>>> v2: Based on comments from Ville
>>>> - Detailed epxlaination in the commit messgae
>>>> - Moved parameter changes out into another patch
>>>> - Backlight enabling will be a new patch
>>>>
>>>> Signed-off-by: Yogesh Mohan Marimuthu
>>>> <yogesh.mohan.marimuthu@intel.com>
>>>> Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
>>>> ---
>>>> drivers/gpu/drm/i915/i915_drv.h | 11 ++++
>>>> drivers/gpu/drm/i915/intel_dsi.c | 111
>>>> ++++++++++++++++++++++++++------------
>>>> drivers/gpu/drm/i915/intel_dsi.h | 2 +
>>>> 3 files changed, 91 insertions(+), 33 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/i915/i915_drv.h
>>>> b/drivers/gpu/drm/i915/i915_drv.h
>>>> index a2bbff9..55c16cb 100644
>>>> --- a/drivers/gpu/drm/i915/i915_drv.h
>>>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>>>> @@ -2433,6 +2433,17 @@ int vlv_freq_opcode(int ddr_freq, int val);
>>>> #define POSTING_READ(reg) (void)I915_READ_NOTRACE(reg)
>>>> #define POSTING_READ16(reg) (void)I915_READ16_NOTRACE(reg)
>>>>
>>>> +#define I915_WRITE_BITS(reg, val, mask) \
>>>> +do { \
>>>> + u32 tmp, data; \
>>>> + tmp = I915_READ((reg)); \
>>>> + tmp &= ~(mask); \
>>>> + data = (val) & (mask); \
>>>> + data = data | tmp; \
>>>> + I915_WRITE((reg), data); \
>>>> +} while(0)
>>>
>>> I would still prefer the explicit read, modify, and write in the code
>>> instead of this, but it's a matter of taste I'll leave for Daniel to
>>> call the shots on.
>>
>> Yeah, this looks a bit funny. We could compute the tmp value once (where
>> the mask is mutliple times the same thing) and then just or in the right
>> bits. That should make the I915_WRITE calls fit ont on line, too, which
>> helps readability.
>>
>> Also we put POSTING_READs before any waits to ensure the write has
>> actually landed. It's mostly documentation.
>>
>> And while I'm at it: We generally frown upon readbacks of register value
>> and prefer to just keep track of things in software well enough. The
>> reason for that is that register readbacks allows us too much flexibility
>> in adding subtile state-depencies. Which long-term makes the code a real
>> pain to maintain.
>
> Ok. Will work on updating the patch accordingly and take care of other
> comments as well in next patch set update soon.
Sorry took me more time than I anticipated to rework on this due to
other critical stuff. Looking at the code and doing more testing I now
confirmed that there is no READ/Modify/WRITE needed for ULPS and hence I
will convert I915_WRITE_BITS to normal I915_WRITE. Will be sending
updated patches on Monday
Regards
Shobhit
next prev parent reply other threads:[~2013-12-06 11:20 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-09 9:49 [PATCH v2 0/7] drm/i915: Baytrail MIPI DSI support Updated Shobhit Kumar
2013-11-09 9:49 ` [PATCH v2 1/7] drm/i915: Add more dev ops for MIPI sub encoder Shobhit Kumar
2013-11-15 8:29 ` Jani Nikula
2013-11-09 9:49 ` [PATCH v2 2/7] drm/i915: Use FLISDSI interface for band gap reset Shobhit Kumar
2013-11-15 9:10 ` Jani Nikula
2013-11-09 9:49 ` [PATCH v2 3/7] drm/i915: Compute dsi_clk from pixel clock Shobhit Kumar
2013-11-15 7:22 ` Jani Nikula
2013-11-15 8:40 ` Jani Nikula
2013-11-09 9:49 ` [PATCH v2 4/7] drm/i915: Try harder to get best m, n, p values with minimal error Shobhit Kumar
2013-11-15 7:19 ` Jani Nikula
2013-11-09 9:49 ` [PATCH v2 5/7] drm/i915: Reorganize the DSI enable/disable sequence Shobhit Kumar
2013-11-15 8:27 ` Jani Nikula
2013-11-15 8:55 ` Daniel Vetter
2013-11-20 1:39 ` Shobhit Kumar
2013-12-06 11:20 ` Shobhit Kumar [this message]
2013-12-06 11:25 ` Shobhit Kumar
2013-11-09 9:49 ` [PATCH v2 6/7] drm/i915: Remove redundant DSI PLL enabling Shobhit Kumar
2013-11-15 8:41 ` Jani Nikula
2013-11-09 9:49 ` [PATCH v2 7/7] drm/i915: Parametrize the dphy and other spec specific parameters Shobhit Kumar
2013-11-15 7:52 ` Jani Nikula
2013-11-15 8:42 ` Jani Nikula
2013-11-09 10:28 ` [PATCH v2 0/7] drm/i915: Baytrail MIPI DSI support Updated Daniel Vetter
2013-11-11 8:50 ` [Intel-gfx] " Thierry Reding
2013-11-11 10:28 ` Shobhit Kumar
[not found] ` <52A7F4A0.6050902@intel.com>
[not found] ` <CAKMK7uGU=R3j1TDgLZzUKtztrY6P_akzHHeWEQy_Jw7DdQpiTg@mail.gmail.com>
[not found] ` <87r49j60ym.fsf@intel.com>
[not found] ` <52A86FF2.5050200@intel.com>
[not found] ` <CAKMK7uGA-ENZRQySGVrDkBy7dTOigkKpwpTn63rfGM+UAGvPZA@mail.gmail.com>
2013-12-11 14:25 ` Daniel Vetter
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=52A1B2F5.8060303@intel.com \
--to=shobhit.kumar@intel.com \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=vijayakumar.balakrishnan@intel.com \
--cc=yogesh.mohan.marimuthu@intel.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