diff mbox

[2/2,RFC] video: display: Adding frame related ops to MIPI DSI video source struct

Message ID 1357132642-24588-3-git-send-email-vikas.sajjan@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Vikas C Sajjan Jan. 2, 2013, 1:17 p.m. UTC
From: Vikas Sajjan <vikas.sajjan@linaro.org>

Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
---
 include/video/display.h |    6 ++++++
 1 file changed, 6 insertions(+)

Comments

Tomasz Figa Jan. 3, 2013, 10:59 a.m. UTC | #1
Hi Vikas,

On Wednesday 02 of January 2013 18:47:22 Vikas C Sajjan wrote:
> From: Vikas Sajjan <vikas.sajjan@linaro.org>
> 
> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
> ---
>  include/video/display.h |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/include/video/display.h b/include/video/display.h
> index b639fd0..fb2f437 100644
> --- a/include/video/display.h
> +++ b/include/video/display.h
> @@ -117,6 +117,12 @@ struct dsi_video_source_ops {
> 
>  	void (*enable_hs)(struct video_source *src, bool enable);
> 
> +	/* frame related */
> +	int (*get_frame_done)(struct video_source *src);
> +	int (*clear_frame_done)(struct video_source *src);
> +	int (*set_early_blank_mode)(struct video_source *src, int power);
> +	int (*set_blank_mode)(struct video_source *src, int power);
> +

I'm not sure if all those extra ops are needed in any way.

Looking and Exynos MIPI DSIM driver, set_blank_mode is handling only 
FB_BLANK_UNBLANK status, which basically equals to the already existing 
enable operation, while set_early_blank mode handles only 
FB_BLANK_POWERDOWN, being equal to disable callback.

Both get_frame_done and clear_frame_done do not look at anything used at 
the moment and if frame done status monitoring will be ever needed, I 
think a better way should be implemented.

Best regards,
Vikas C Sajjan Jan. 4, 2013, 4:54 a.m. UTC | #2
Hi Mr. Figa,

Thanks for reviewing.

On 3 January 2013 16:29, Tomasz Figa <t.figa@samsung.com> wrote:
> Hi Vikas,
>
> On Wednesday 02 of January 2013 18:47:22 Vikas C Sajjan wrote:
>> From: Vikas Sajjan <vikas.sajjan@linaro.org>
>>
>> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
>> ---
>>  include/video/display.h |    6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/include/video/display.h b/include/video/display.h
>> index b639fd0..fb2f437 100644
>> --- a/include/video/display.h
>> +++ b/include/video/display.h
>> @@ -117,6 +117,12 @@ struct dsi_video_source_ops {
>>
>>       void (*enable_hs)(struct video_source *src, bool enable);
>>
>> +     /* frame related */
>> +     int (*get_frame_done)(struct video_source *src);
>> +     int (*clear_frame_done)(struct video_source *src);
>> +     int (*set_early_blank_mode)(struct video_source *src, int power);
>> +     int (*set_blank_mode)(struct video_source *src, int power);
>> +
>
> I'm not sure if all those extra ops are needed in any way.
>
> Looking and Exynos MIPI DSIM driver, set_blank_mode is handling only
> FB_BLANK_UNBLANK status, which basically equals to the already existing
> enable operation, while set_early_blank mode handles only
> FB_BLANK_POWERDOWN, being equal to disable callback.
>

Right, exynos_mipi_dsi_blank_mode() only supports FB_BLANK_UNBLANK as
of now, but FB_BLANK_NORMAL will be supported in future.
If not for Exynos, i think it will be need for other SoCs which
support  FB_BLANK_UNBLANK and FB_BLANK_NORMAL.

> Both get_frame_done and clear_frame_done do not look at anything used at
> the moment and if frame done status monitoring will be ever needed, I
> think a better way should be implemented.
>
You are right, as of now Exynos MIPI DSI Panels are NOT using these
callbacks, but as you mentioned we will need frame done status
monitoring anyways, so i included these callbacks here. Will check, if
we can implement any better method.

> Best regards,
> --
> Tomasz Figa
> Samsung Poland R&D Center
> SW Solution Development, Linux Platform
>
Laurent Pinchart Jan. 9, 2013, 11:35 p.m. UTC | #3
Hi Vikas,

Thank you for the patch.

On Friday 04 January 2013 10:24:04 Vikas Sajjan wrote:
> On 3 January 2013 16:29, Tomasz Figa <t.figa@samsung.com> wrote:
> > On Wednesday 02 of January 2013 18:47:22 Vikas C Sajjan wrote:
> >> From: Vikas Sajjan <vikas.sajjan@linaro.org>
> >> 
> >> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
> >> ---
> >> 
> >>  include/video/display.h |    6 ++++++
> >>  1 file changed, 6 insertions(+)
> >> 
> >> diff --git a/include/video/display.h b/include/video/display.h
> >> index b639fd0..fb2f437 100644
> >> --- a/include/video/display.h
> >> +++ b/include/video/display.h
> >> @@ -117,6 +117,12 @@ struct dsi_video_source_ops {
> >> 
> >>       void (*enable_hs)(struct video_source *src, bool enable);
> >> 
> >> +     /* frame related */
> >> +     int (*get_frame_done)(struct video_source *src);
> >> +     int (*clear_frame_done)(struct video_source *src);
> >> +     int (*set_early_blank_mode)(struct video_source *src, int power);
> >> +     int (*set_blank_mode)(struct video_source *src, int power);
> >> +
> > 
> > I'm not sure if all those extra ops are needed in any way.
> > 
> > Looking and Exynos MIPI DSIM driver, set_blank_mode is handling only
> > FB_BLANK_UNBLANK status, which basically equals to the already existing
> > enable operation, while set_early_blank mode handles only
> > FB_BLANK_POWERDOWN, being equal to disable callback.
> 
> Right, exynos_mipi_dsi_blank_mode() only supports FB_BLANK_UNBLANK as
> of now, but FB_BLANK_NORMAL will be supported in future.
> If not for Exynos, i think it will be need for other SoCs which
> support FB_BLANK_UNBLANK and FB_BLANK_NORMAL.

Could you please explain in a bit more details what the set_early_blank_mode 
and set_blank_mode operations do ?

> > Both get_frame_done and clear_frame_done do not look at anything used at
> > the moment and if frame done status monitoring will be ever needed, I
> > think a better way should be implemented.
> 
> You are right, as of now Exynos MIPI DSI Panels are NOT using these
> callbacks, but as you mentioned we will need frame done status monitoring
> anyways, so i included these callbacks here. Will check, if we can implement
> any better method.

Do you expect the entity drivers (and in particular the panel drivers) to 
require frame done notification ? If so, could you explain your use case(s) ?
Vikas C Sajjan Jan. 10, 2013, 5:37 a.m. UTC | #4
Hi Laurent,

On 10 January 2013 05:05, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Vikas,
>
> Thank you for the patch.
>
> On Friday 04 January 2013 10:24:04 Vikas Sajjan wrote:
>> On 3 January 2013 16:29, Tomasz Figa <t.figa@samsung.com> wrote:
>> > On Wednesday 02 of January 2013 18:47:22 Vikas C Sajjan wrote:
>> >> From: Vikas Sajjan <vikas.sajjan@linaro.org>
>> >>
>> >> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
>> >> ---
>> >>
>> >>  include/video/display.h |    6 ++++++
>> >>  1 file changed, 6 insertions(+)
>> >>
>> >> diff --git a/include/video/display.h b/include/video/display.h
>> >> index b639fd0..fb2f437 100644
>> >> --- a/include/video/display.h
>> >> +++ b/include/video/display.h
>> >> @@ -117,6 +117,12 @@ struct dsi_video_source_ops {
>> >>
>> >>       void (*enable_hs)(struct video_source *src, bool enable);
>> >>
>> >> +     /* frame related */
>> >> +     int (*get_frame_done)(struct video_source *src);
>> >> +     int (*clear_frame_done)(struct video_source *src);
>> >> +     int (*set_early_blank_mode)(struct video_source *src, int power);
>> >> +     int (*set_blank_mode)(struct video_source *src, int power);
>> >> +
>> >
>> > I'm not sure if all those extra ops are needed in any way.
>> >
>> > Looking and Exynos MIPI DSIM driver, set_blank_mode is handling only
>> > FB_BLANK_UNBLANK status, which basically equals to the already existing
>> > enable operation, while set_early_blank mode handles only
>> > FB_BLANK_POWERDOWN, being equal to disable callback.
>>
>> Right, exynos_mipi_dsi_blank_mode() only supports FB_BLANK_UNBLANK as
>> of now, but FB_BLANK_NORMAL will be supported in future.
>> If not for Exynos, i think it will be need for other SoCs which
>> support FB_BLANK_UNBLANK and FB_BLANK_NORMAL.
>
> Could you please explain in a bit more details what the set_early_blank_mode
> and set_blank_mode operations do ?
>

with reference to Mr. Inki Dae's patch and discussion
http://lkml.indiana.edu/hypermail/linux/kernel/1109.1/00413.html
http://lkml.indiana.edu/hypermail/linux/kernel/1109.1/02247.html

set_early_blank_mode:
  - sets the framebuffer blank mode.
  - this callback should be called prior to fb_blank() by a client
driver only if needed
set_blank_mode:
  - sets framebuffer blank mode
  -  this callback should be called after fb_blank() by a client
driver only if needed.

In case of MIPI-DSI based video mode LCD Panel, for lcd power off, the
power off commands should be transferred to lcd panel with display and
mipi-dsi controller enabled, because the commands is set to lcd panel
at vsync porch period, hence set_early_blank_mode() was introduced and
should be called prior to fb_blank() as mentioned in the above 2
links.

I think Mr. Inki Dae can throw more light on this.

>> > Both get_frame_done and clear_frame_done do not look at anything used at
>> > the moment and if frame done status monitoring will be ever needed, I
>> > think a better way should be implemented.
>>
>> You are right, as of now Exynos MIPI DSI Panels are NOT using these
>> callbacks, but as you mentioned we will need frame done status monitoring
>> anyways, so i included these callbacks here. Will check, if we can implement
>> any better method.
>
> Do you expect the entity drivers (and in particular the panel drivers) to
> require frame done notification ? If so, could you explain your use case(s) ?
>
In our Exynos MIPI DSIM H/W, once MIPI DSIM transfers whole image
frame, interrupt will raised to indicate the same.
as part of the mipi_dsim_master_ops() we have get_dsim_frame_done()
and clear_dsim_frame_done() ops. But as of now we are also _NOT_ using
these ops in any particular use case. So i guess as of now we can park
it, later if we find any need for the same we can add it.

> --
> Regards,
>
> Laurent Pinchart
>

--
Thanks and Regards
 Vikas Sajjan
 SAMSUNG Research India - Banglore.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
대인기/Tizen Platform Lab(SR)/삼성전자 Jan. 10, 2013, 7:43 a.m. UTC | #5
2013/1/10 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
> Hi Vikas,
>
> Thank you for the patch.
>
> On Friday 04 January 2013 10:24:04 Vikas Sajjan wrote:
>> On 3 January 2013 16:29, Tomasz Figa <t.figa@samsung.com> wrote:
>> > On Wednesday 02 of January 2013 18:47:22 Vikas C Sajjan wrote:
>> >> From: Vikas Sajjan <vikas.sajjan@linaro.org>
>> >>
>> >> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
>> >> ---
>> >>
>> >>  include/video/display.h |    6 ++++++
>> >>  1 file changed, 6 insertions(+)
>> >>
>> >> diff --git a/include/video/display.h b/include/video/display.h
>> >> index b639fd0..fb2f437 100644
>> >> --- a/include/video/display.h
>> >> +++ b/include/video/display.h
>> >> @@ -117,6 +117,12 @@ struct dsi_video_source_ops {
>> >>
>> >>       void (*enable_hs)(struct video_source *src, bool enable);
>> >>
>> >> +     /* frame related */
>> >> +     int (*get_frame_done)(struct video_source *src);
>> >> +     int (*clear_frame_done)(struct video_source *src);
>> >> +     int (*set_early_blank_mode)(struct video_source *src, int power);
>> >> +     int (*set_blank_mode)(struct video_source *src, int power);
>> >> +
>> >
>> > I'm not sure if all those extra ops are needed in any way.
>> >
>> > Looking and Exynos MIPI DSIM driver, set_blank_mode is handling only
>> > FB_BLANK_UNBLANK status, which basically equals to the already existing
>> > enable operation, while set_early_blank mode handles only
>> > FB_BLANK_POWERDOWN, being equal to disable callback.
>>
>> Right, exynos_mipi_dsi_blank_mode() only supports FB_BLANK_UNBLANK as
>> of now, but FB_BLANK_NORMAL will be supported in future.
>> If not for Exynos, i think it will be need for other SoCs which
>> support FB_BLANK_UNBLANK and FB_BLANK_NORMAL.
>
> Could you please explain in a bit more details what the set_early_blank_mode
> and set_blank_mode operations do ?
>
>> > Both get_frame_done and clear_frame_done do not look at anything used at
>> > the moment and if frame done status monitoring will be ever needed, I
>> > think a better way should be implemented.
>>
>> You are right, as of now Exynos MIPI DSI Panels are NOT using these
>> callbacks, but as you mentioned we will need frame done status monitoring
>> anyways, so i included these callbacks here. Will check, if we can implement
>> any better method.
>
> Do you expect the entity drivers (and in particular the panel drivers) to
> require frame done notification ? If so, could you explain your use case(s) ?
>

Hi Laurent,

As you know, there are two types of MIPI-DSI based lcd panels, RGB and
CPU mode. In case of CPU mode lcd panel, it has its own framebuffer
internally and the image in the framebuffer is transferred on lcd
panel in 60Hz itself. But for this, there is something we should
consider. The display controller with CPU mode doens't transfer image
data to MIPI-DSI controller itself. So we should set trigger bit of
the display controller to 1 to do it and also check whether the data
transmission in the framebuffer is done on lcd panel to avoid tearing
issue and some confliction issue(A) between read and write operations
like below,

lcd_panel_frame_done_interrrupt_handler()
{
        ...
        if (mipi-dsi frame done)
                trigger display controller;
        ...
}

A. the issue that LCD panel can access its own framebuffer while some
new data from MIPI-DSI controller is being written in the framebuffer.

But I think there might be better way to avoid such thing.

Thanks,
Inki Dae

> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jani Nikula Jan. 10, 2013, 11:33 a.m. UTC | #6
On Thu, 10 Jan 2013, Inki Dae <inki.dae@samsung.com> wrote:
> 2013/1/10 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
>> Hi Vikas,
>>
>> Thank you for the patch.
>>
>> On Friday 04 January 2013 10:24:04 Vikas Sajjan wrote:
>>> On 3 January 2013 16:29, Tomasz Figa <t.figa@samsung.com> wrote:
>>> > On Wednesday 02 of January 2013 18:47:22 Vikas C Sajjan wrote:
>>> >> From: Vikas Sajjan <vikas.sajjan@linaro.org>
>>> >>
>>> >> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
>>> >> ---
>>> >>
>>> >>  include/video/display.h |    6 ++++++
>>> >>  1 file changed, 6 insertions(+)
>>> >>
>>> >> diff --git a/include/video/display.h b/include/video/display.h
>>> >> index b639fd0..fb2f437 100644
>>> >> --- a/include/video/display.h
>>> >> +++ b/include/video/display.h
>>> >> @@ -117,6 +117,12 @@ struct dsi_video_source_ops {
>>> >>
>>> >>       void (*enable_hs)(struct video_source *src, bool enable);
>>> >>
>>> >> +     /* frame related */
>>> >> +     int (*get_frame_done)(struct video_source *src);
>>> >> +     int (*clear_frame_done)(struct video_source *src);
>>> >> +     int (*set_early_blank_mode)(struct video_source *src, int power);
>>> >> +     int (*set_blank_mode)(struct video_source *src, int power);
>>> >> +
>>> >
>>> > I'm not sure if all those extra ops are needed in any way.
>>> >
>>> > Looking and Exynos MIPI DSIM driver, set_blank_mode is handling only
>>> > FB_BLANK_UNBLANK status, which basically equals to the already existing
>>> > enable operation, while set_early_blank mode handles only
>>> > FB_BLANK_POWERDOWN, being equal to disable callback.
>>>
>>> Right, exynos_mipi_dsi_blank_mode() only supports FB_BLANK_UNBLANK as
>>> of now, but FB_BLANK_NORMAL will be supported in future.
>>> If not for Exynos, i think it will be need for other SoCs which
>>> support FB_BLANK_UNBLANK and FB_BLANK_NORMAL.
>>
>> Could you please explain in a bit more details what the set_early_blank_mode
>> and set_blank_mode operations do ?
>>
>>> > Both get_frame_done and clear_frame_done do not look at anything used at
>>> > the moment and if frame done status monitoring will be ever needed, I
>>> > think a better way should be implemented.
>>>
>>> You are right, as of now Exynos MIPI DSI Panels are NOT using these
>>> callbacks, but as you mentioned we will need frame done status monitoring
>>> anyways, so i included these callbacks here. Will check, if we can implement
>>> any better method.
>>
>> Do you expect the entity drivers (and in particular the panel drivers) to
>> require frame done notification ? If so, could you explain your use case(s) ?
>>
>
> Hi Laurent,
>
> As you know, there are two types of MIPI-DSI based lcd panels, RGB and
> CPU mode. In case of CPU mode lcd panel, it has its own framebuffer
> internally and the image in the framebuffer is transferred on lcd
> panel in 60Hz itself. But for this, there is something we should
> consider. The display controller with CPU mode doens't transfer image
> data to MIPI-DSI controller itself. So we should set trigger bit of
> the display controller to 1 to do it and also check whether the data
> transmission in the framebuffer is done on lcd panel to avoid tearing
> issue and some confliction issue(A) between read and write operations
> like below,

Quite right. Just to elaborate, in the MIPI DSI spec the two types are
called Video Mode and Command Mode display modules, of which the latter
has a framebuffer of its own. Update of the display module framebuffer
has to dodge the scanning of the buffer by the display module's
controller to avoid tearing. For that, info about the controller's
scanline is required. There are basically three ways for this:

1) polling the scanline using DCS get_scan_line command

2) enabling tearing effect reporting, and turning over bus ownership to
the display module for subsequent tearing effect signal (vertical
blanking) reporting by the module at the specified scanline

3) external GPIO line (outside of DSI PHY spec) to report tearing effect
signal

For an example, drivers/video/omap2/displays/panel-taal.c supports
option #2 via OMAP DSI and option #3 independently.


BR,
Jani.


>
> lcd_panel_frame_done_interrrupt_handler()
> {
>         ...
>         if (mipi-dsi frame done)
>                 trigger display controller;
>         ...
> }
>
> A. the issue that LCD panel can access its own framebuffer while some
> new data from MIPI-DSI controller is being written in the framebuffer.
>
> But I think there might be better way to avoid such thing.
>
> Thanks,
> Inki Dae
>
>> --
>> Regards,
>>
>> Laurent Pinchart
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/video/display.h b/include/video/display.h
index b639fd0..fb2f437 100644
--- a/include/video/display.h
+++ b/include/video/display.h
@@ -117,6 +117,12 @@  struct dsi_video_source_ops {
 
 	void (*enable_hs)(struct video_source *src, bool enable);
 
+	/* frame related */
+	int (*get_frame_done)(struct video_source *src);
+	int (*clear_frame_done)(struct video_source *src);
+	int (*set_early_blank_mode)(struct video_source *src, int power);
+	int (*set_blank_mode)(struct video_source *src, int power);
+
 	/* data transfer */
 	int (*dcs_write)(struct video_source *src, int channel,
 			u8 *data, size_t len);