<p dir="ltr"><br>
On 07-Jun-2016 2:32 PM, "Jani Nikula" <<a href="mailto:jani.nikula@linux.intel.com">jani.nikula@linux.intel.com</a>> wrote:<br>
><br>
> On Tue, 07 Jun 2016, Vinay Simha BN <<a href="mailto:simhavcs@gmail.com">simhavcs@gmail.com</a>> wrote:<br>
> > Provide a small convenience wrapper that transmits<br>
> > a set_tear_scanline command.<br>
> ><br>
> > Cc: Archit Taneja <<a href="mailto:archit.taneja@gmail.com">archit.taneja@gmail.com</a>><br>
> > Cc: John Stultz <<a href="mailto:john.stultz@linaro.org">john.stultz@linaro.org</a>><br>
> > Cc: Thierry Reding <<a href="mailto:thierry.reding@gmail.com">thierry.reding@gmail.com</a>><br>
> > Cc: Sumit Semwal <<a href="mailto:sumit.semwal@linaro.org">sumit.semwal@linaro.org</a>><br>
> > Cc: Jani Nikula <<a href="mailto:jani.nikula@linux.intel.com">jani.nikula@linux.intel.com</a>><br>
> > Signed-off-by: Vinay Simha BN <<a href="mailto:simhavcs@gmail.com">simhavcs@gmail.com</a>><br>
><br>
> Reviewed-by: Jani Nikula <<a href="mailto:jani.nikula@intel.com">jani.nikula@intel.com</a>><br>
><br>
><br>
Reviewed-by: Sumit Semwal <<a href="mailto:sumit.semwal@linaro.org">sumit.semwal@linaro.org</a>><br>
> ><br>
> > --<br>
> > v1:<br>
> > * helper function suggested by Thierry<br>
> > for set_tear_scanline<br>
> > * Also includes small build fixes from Sumit Semwal.<br>
> ><br>
> > v2:<br>
> > * one scanline parameter suggested by jani<br>
> ><br>
> > v3:<br>
> > * passing the payload properly as suggested by jani<br>
> > --<br>
> > ---<br>
> > drivers/gpu/drm/drm_mipi_dsi.c | 22 ++++++++++++++++++++++<br>
> > include/drm/drm_mipi_dsi.h | 1 +<br>
> > 2 files changed, 23 insertions(+)<br>
> ><br>
> > diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c<br>
> > index f5d8083..7938ce7 100644<br>
> > --- a/drivers/gpu/drm/drm_mipi_dsi.c<br>
> > +++ b/drivers/gpu/drm/drm_mipi_dsi.c<br>
> > @@ -983,6 +983,28 @@ int mipi_dsi_dcs_set_tear_on(struct mipi_dsi_device *dsi,<br>
> > EXPORT_SYMBOL(mipi_dsi_dcs_set_tear_on);<br>
> ><br>
> > /**<br>
> > + * mipi_dsi_set_tear_scanline() - turn on the display module's Tearing Effect<br>
> > + * output signal on the TE signal line when display module reaches line N<br>
> > + * defined by STS[n:0].<br>
> > + * @dsi: DSI peripheral device<br>
> > + * @param: STS[10:0]<br>
> > + * Return: 0 on success or a negative error code on failure<br>
> > + */<br>
> > +int mipi_dsi_set_tear_scanline(struct mipi_dsi_device *dsi, u16 param)<br>
> > +{<br>
> > + u8 payload[3] = { MIPI_DCS_SET_TEAR_SCANLINE, param >> 8,<br>
> > + param & 0xff };<br>
> > + ssize_t err;<br>
> > +<br>
> > + err = mipi_dsi_generic_write(dsi, payload, sizeof(payload));<br>
> > + if (err < 0)<br>
> > + return err;<br>
> > +<br>
> > + return 0;<br>
> > +}<br>
> > +EXPORT_SYMBOL(mipi_dsi_set_tear_scanline);<br>
> > +<br>
> > +/**<br>
> > * mipi_dsi_dcs_set_pixel_format() - sets the pixel format for the RGB image<br>
> > * data used by the interface<br>
> > * @dsi: DSI peripheral device<br>
> > diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h<br>
> > index 7a9840f..ec55285 100644<br>
> > --- a/include/drm/drm_mipi_dsi.h<br>
> > +++ b/include/drm/drm_mipi_dsi.h<br>
> > @@ -263,6 +263,7 @@ int mipi_dsi_dcs_set_column_address(struct mipi_dsi_device *dsi, u16 start,<br>
> > u16 end);<br>
> > int mipi_dsi_dcs_set_page_address(struct mipi_dsi_device *dsi, u16 start,<br>
> > u16 end);<br>
> > +int mipi_dsi_set_tear_scanline(struct mipi_dsi_device *dsi, u16 param);<br>
> > int mipi_dsi_dcs_set_tear_off(struct mipi_dsi_device *dsi);<br>
> > int mipi_dsi_dcs_set_tear_on(struct mipi_dsi_device *dsi,<br>
> > enum mipi_dsi_dcs_tear_mode mode);<br>
><br>
> --<br>
> Jani Nikula, Intel Open Source Technology Center<br>
</p>