History log of /linux-master/drivers/gpu/drm/omapdrm/dss/dispc.c
Revision Date Author Comments
# e1704914 20-Oct-2023 Rob Herring <robh@kernel.org>

drm: Use device_get_match_data()

Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data in a single step. With this, adjust the
includes to explicitly include the correct headers. That also serves as
preparation to remove implicit includes within the DT headers
(of_device.h in particular).

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Link: https://lore.kernel.org/r/20231020125214.2930329-1-robh@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>


# c2807ecb 07-May-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

drm/omap: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert the omap drm driver from always returning zero in the
remove callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-35-u.kleine-koenig@pengutronix.de


# 88652d8a 13-Oct-2022 Yuan Can <yuancan@huawei.com>

drm/omapdrm: Remove unused struct csc_coef_rgb2yuv

After commit 64ff18911878, struct csc_coef_rgb2yuv is not used any more
and can be removed as well.

Fixes: 64ff18911878 ("drm/omap: Enable COLOR_ENCODING and COLOR_RANGE properties for planes")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221014024810.21675-1-yuancan@huawei.com


# e8523f53 16-May-2022 Guo Zhengkui <guozhengkui@vivo.com>

drm: omapdrm: dss: replace ternary operator with max()

Fix the following coccicheck warning:

drivers/gpu/drm/omapdrm/dss/dispc.c:2454:21-22: WARNING opportunity for max()

Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220517050208.121488-1-guozhengkui@vivo.com


# d6c75c29 05-Dec-2021 Arnd Bergmann <arnd@arndb.de>

omapdrm: dss: mark runtime PM functions __maybe_unused

Using the SET_RUNTIME_PM_OPS() macro causes a warning about the
referenced functions when they are marked static but not __maybe_unused:

drivers/gpu/drm/omapdrm/dss/dss.c:1572:12: error: unused function 'dss_runtime_suspend' [-Werror,-Wunused-function]
drivers/gpu/drm/omapdrm/dss/dss.c:1584:12: error: unused function 'dss_runtime_resume' [-Werror,-Wunused-function]
drivers/gpu/drm/omapdrm/dss/dispc.c:4845:12: error: unused function 'dispc_runtime_suspend' [-Werror,-Wunused-function]
drivers/gpu/drm/omapdrm/dss/dispc.c:4860:12: error: unused function 'dispc_runtime_resume' [-Werror,-Wunused-function]

Fixes: b92f7ea556f8 ("drm/omap: dss: Make use of the helper macro SET_RUNTIME_PM_OPS()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211205131612.3192652-1-arnd@kernel.org


# 0b0f7282 17-Nov-2021 Benoit Parrot <bparrot@ti.com>

drm/omap: Add ovl checking funcs to dispc_ops

In order to be able to dynamically assign overlays to planes we need to
be able to asses the overlay capabilities.

Add a helper function to be able to retrieve the supported capabilities
of an overlay.

And export the function to check if a fourcc is supported on a given
overlay.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211117141928.771082-4-narmstrong@baylibre.com


# d484c20d 17-Nov-2021 Benoit Parrot <bparrot@ti.com>

drm/omap: Add ability to check if requested plane modes can be supported

We currently assume that an overlay has the same maximum width and
maximum height as the overlay manager. This assumption is incorrect. On
some variants the overlay manager maximum width is twice the maximum
width that the overlay can handle. We need to add the appropriate data
per variant as well as export a helper function to retrieve the data so
check can be made dynamically in omap_plane_atomic_check().

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211117141928.771082-3-narmstrong@baylibre.com


# 1f366c68 12-Oct-2021 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: increase DSS5 max tv pclk to 192MHz

DSS5's maximum tv pclk rate (i.e. HDMI) is set to 186MHz, which comes
from the TRM (DPLL_HDMI_CLK1 frequency must be lower than 186 MHz). To
support DRA76's wide screen HDMI feature, we need to increase this
maximum rate.

Testing shows that the PLL seems to work fine even with ~240MHz clocks,
and even the HDMI output at that clock is stable enough for monitors to
show a picture. This holds true for all DRA7 and AM5 SoCs (and probably
also for OMAP5).

However, the highest we can go without big refactoring to the clocking
code is 192MHz, as that is the DSS func clock we get from the PRCM. So,
increase the max HDMI pixel clock to 192MHz for now, to allow some more
2k+ modes to work.

This patch never had a clear confirmation from HW people, but this
change stayed on production trees for multiple years without any report
on an eventual breakage.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211012133939.2145462-1-narmstrong@baylibre.com


# ed8414ab 31-Aug-2021 Cai Huoqing <caihuoqing@baidu.com>

drm/omap: Make use of the helper function devm_platform_ioremap_resourcexxx()

Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210831135707.4676-1-caihuoqing@baidu.com


# b92f7ea5 28-Aug-2021 Cai Huoqing <caihuoqing@baidu.com>

drm/omap: dss: Make use of the helper macro SET_RUNTIME_PM_OPS()

Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose
operators ".runtime_suspend/.runtime_resume", because the
SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought
in to make code a little clearer, a little more concise.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210828084811.104-1-caihuoqing@baidu.com


# 417fc612 22-Mar-2021 Arnd Bergmann <arnd@arndb.de>

drm/omap: fix misleading indentation in pixinc()

An old patch added a 'return' statement after each BUG() in this driver,
which was necessary at the time, but has become redundant after the BUG()
definition was updated to handle this properly.

gcc-11 now warns about one such instance, where the 'return' statement
was incorrectly indented:

drivers/gpu/drm/omapdrm/dss/dispc.c: In function ‘pixinc’:
drivers/gpu/drm/omapdrm/dss/dispc.c:2093:9: error: this ‘else’ clause does not guard... [-Werror=misleading-indentation]
2093 | else
| ^~~~
drivers/gpu/drm/omapdrm/dss/dispc.c:2095:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
2095 | return 0;
| ^~~~~~

Address this by removing the return again and changing the BUG()
to be unconditional to make this more intuitive.

Fixes: c6eee968d40d ("OMAPDSS: remove compiler warnings when CONFIG_BUG=n")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210322164203.827324-1-arnd@kernel.org


# dac62bca 14-Dec-2020 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: remove dispc_ops

dispc_ops was created to help with the multi-module architecture and
giving us the possibility of multiple dispc implementations. Neither of
these is valid anymore, and we can remove dispc_ops and use direct
calls to dispc.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-54-tomi.valkeinen@ti.com


# 64ff1891 03-Nov-2020 Jyri Sarha <jsarha@ti.com>

drm/omap: Enable COLOR_ENCODING and COLOR_RANGE properties for planes

Adds support for COLOR_ENCODING and COLOR_RANGE properties to
omap_plane.c and dispc.c. The supported encodings and ranges are
presets are:

For COLOR_ENCODING:
- YCbCr BT.601 (default)
- YCbCr BT.709

For COLOR_RANGE:
- YCbCr limited range
- YCbCr full range (default)

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201103080310.164453-6-tomi.valkeinen@ti.com


# a5d704d3 22-Aug-2020 Dinghao Liu <dinghao.liu@zju.edu.cn>

drm/omap: Fix runtime PM imbalance on error

pm_runtime_get_sync() increments the runtime PM usage counter
even when it returns an error code. However, users of its
direct wrappers in omapdrm assume that PM usage counter will
not change on error. Thus a pairing decrement is needed on
the error handling path for these wrappers to keep the counter
balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200822065743.13671-1-dinghao.liu@zju.edu.cn


# ecfdedd7 17-Jun-2020 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: force runtime PM suspend on system suspend

Use SET_LATE_SYSTEM_SLEEP_PM_OPS in DSS submodules to force runtime PM
suspend and resume.

We use suspend late version so that omapdrm's system suspend callback is
called first, as that will disable all the display outputs after which
it's safe to force DSS into suspend.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200618095153.611071-1-tomi.valkeinen@ti.com
Acked-by: Tony Lindgren <tony@atomide.com>
Fixes: cef766300353 ("drm/omap: Prepare DSS for probing without legacy platform data")
Cc: stable@vger.kernel.org # v5.7+
Tested-by: Tony Lindgren <tony@atomide.com>


# 9cd39de4 17-Apr-2020 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: change default signal polarities and drives

If the given videomode does not specify DISPLAY_FLAG_* for the specific
signal property, the driver used a default value. These defaults were
never thought through, as the expectation was that all the DISPLAY_FLAGS
are always set explicitly.

With DRM bridge and panel drivers this is not the case, and while that
issue should be resolved in the future, it's still good to have sane
signal defaults.

This patch changes the defaults to what the hardware has as reset
defaults. Also, based on my experience, I think they make sense and are
more likely correct than the defaults without this patch.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200417114151.25843-1-tomi.valkeinen@ti.com
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 8b185cf7 01-Jan-2020 Wambui Karuga <wambui.karugax@gmail.com>

drm/omapdrm: use BUG_ON macro for error debugging.

Since the if statement only checks for the value of the `id` variable,
it can be replaced by the more concise BUG_ON() macro for error
reporting.
Issue found using coccinelle.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200102095515.7106-1-wambui.karugax@gmail.com


# f5b1fae1 30-Sep-2019 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: fix missing scaler pixel fmt limitations

OMAP2 and OMAP3/AM4 have limitations with the scaler:
- OMAP2 can only scale XRGB8888
- OMAP3/AM4 can only scale XRGB8888, RGB565, YUYV and UYVY

The driver doesn't check these limitations, which leads to sync-lost
floods.

This patch adds a check for the pixel formats when scaling.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190930103840.18970-5-tomi.valkeinen@ti.com


# 6e366c28 30-Sep-2019 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: avoid copy in mgr_fld_read/write

Avoid unnecessary copy in mgr_fld_read/write by taking a pointer to the
reg_resc and using that.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190930103840.18970-3-tomi.valkeinen@ti.com
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# a9c4fbd5 30-Sep-2019 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: drop unneeded locking from mgr_fld_write()

Commit d49cd15550d9d4495f6187425318c245d58cb63f ("OMAPDSS: DISPC: lock
access to DISPC_CONTROL & DISPC_CONFIG") added locking to
mgr_fld_write(). This was needed in omapfb times due to lack of good
locking, especially in the case of both V4L2 and fbdev layers using the
DSS driver.

This is not needed for omapdrm, so we can remove the locking.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190930103840.18970-2-tomi.valkeinen@ti.com


# 212836a9 26-Jul-2019 Christoph Hellwig <hch@lst.de>

dma-mapping: remove dma_{alloc,free,mmap}_writecombine

We can already use DMA_ATTR_WRITE_COMBINE or the _wc prefixed version,
so remove the third way of doing things.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# caab277b 02-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation this program is
distributed in the hope that it will be useful but without any
warranty without even the implied warranty of merchantability or
fitness for a particular purpose see the gnu general public license
for more details you should have received a copy of the gnu general
public license along with this program if not see http www gnu org
licenses

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 503 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Enrico Weigelt <info@metux.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190602204653.811534538@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e58febe1 17-Jul-2018 Ayan Kumar Halder <ayan.halder@arm.com>

drm/omap: Substitute format_is_yuv() with format->is_yuv

drm_format_info table has a field 'is_yuv' to denote if the format
is yuv or not. The driver is expected to use this instead of
having a function for the same purpose.

Signed-off-by: Ayan Kumar halder <ayan.halder@arm.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 3a75010c 10-Sep-2018 YueHaibing <yuehaibing@huawei.com>

drm/omap: remove set but not used variable 'frame_height'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/omapdrm/dss/dispc.c: In function 'dispc_ovl_setup_common':
drivers/gpu/drm/omapdrm/dss/dispc.c:2627:19: warning:
variable 'frame_height' set but not used [-Wunused-but-set-variable]

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 7c27fa57 04-Jun-2018 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm/omap: Call dispc timings check operation directly

Instead of call the dispc timings check function dispc_mgr_timings_ok()
from the internal encoders .check_timings() operation, expose it through
the dispc ops (after renaming it to check_timings) and call it directly
from omapdrm. This allows removal of now empty omap_dss_device
.check_timings() operations.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# d25a7d67 06-Mar-2018 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm/omap: Remove supported output check in CRTC connect handler

The CRTC connect handler checks whether the DSS output supports the
DISPC channel assigned to it. As the channel is assigned to the output
by the output driver a failure there could only result from a driver
bug. All the output drivers have been verified and they are always
assigned a DISPC channel that is supported on the SoC they run on. The
check can thus be removed.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 6505d75c 24-May-2018 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: fix email address

Change tomi.valkeinen@nokia.com to tomi.valkeinen@ti.com.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 7f26eee5 01-May-2018 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: add missing linefeeds to prints

A bunch of debug and error prints are missing linefeeds. Add those.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180502091159.7071-4-tomi.valkeinen@ti.com
Reviewed-by: Benoit Parrot <bparrot@ti.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>


# e1cdab6e 01-May-2018 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: handle error if scale coefs are not found

If get_scale_coef functions fail, they return NULL, but we never check
the return value and could do a NULL deref. This should not happen as we
ought to validate the amount of scaling already earlier, but to be safe,
add the necessary check.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180502091159.7071-3-tomi.valkeinen@ti.com
Reviewed-by: Benoit Parrot <bparrot@ti.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>


# 4cba7071 12-Sep-2016 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: cleanup color space conversion

The setup code for color space conversion is a bit messy. This patch
cleans it up.

For some reason the TRM uses values in YCrCb order, which is also used
in the current driver, whereas everywhere else it's YCbCr (which also
matches YUV order). This patch changes the tables to use the common
order to avoid confusion.

The tables are split into separate lines, and comments added for
clarity.

WB color conversion registers are similar but different than non-WB, but
the same function was used to write both. It worked fine because the
coef table was adjusted accordingly, but that was rather confusing. This
patch adds a separate function to write the WB values so that the coef
table can be written in an understandable way.

Recalculation also showed that 'bcb' value in yuv-to-rgb conversion had
been rounded wrongly, and it should be 516 instead of 517.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 7c009851 10-Nov-2015 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: add writeback funcs to dispc_ops

Add writeback specific dispc functions to dispc_ops so that omapdrm can
use them. Also move 'enum dss_writeback_channel' to the public
omapdss.h for omapdrm.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 13bb1601 22-Dec-2015 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: fix scaling limits for WB

WB has additional scaling limits when the output color format is one of
the YUV formats. These limits are not handled at the moment, causing
bad scaling and/or NULL dereference crash.

This patchs adds the check so that dispc returns an error for bad
scaling request.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 1317ef21 26-Oct-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: fix WB height with interlace

When using WB capture from interlaced source, we need to halve the
picture heights correctly.

Unfortunately the current dispc_ovl_setup_common() doesn't deal with
interlace very neatly, so the end result is a bit messy.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Benoit Parrot <bparrot@ti.com>


# b994e53c 26-Oct-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: fix WBDELAYCOUNT with interlace

Vertical blanking needs to be halved on interlace modes. WBDELAYCOUNT
was calculated without such halving, resulting in WBUNCOMPLETE errors.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Benoit Parrot <bparrot@ti.com>


# 46a93041 03-Jun-2016 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: fix WBDELAYCOUNT for HDMI

For HDMI, WBDELAYCOUNT starts counting at the start of vsync, not at the
start of vfp.

This patch adjusts the wbdelay for HDMI accordingly.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 9f7853ae 09-Jan-2018 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: set WB channel-in in wb_setup()

We need to know the WB channel-in in wb_setup() to be able to configure
WB properly for capture mode. At the moment channel-in is set
separately.

This patch moves channel-in to wb_setup().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 9deb5ad3 16-May-2016 Benoit Parrot <bparrot@ti.com>

drm/omap: Add pclk setting case when channel is DSS_WB

In dispc_set_ovl_common() we need to initialize pclk to a valid
value when we use WB in capture mode (i.e. mem_2_mem is false).
Otherwise dispc_ovl_calc_scaling() fails.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# b5d025ef 21-Jun-2016 Benoit Parrot <bparrot@ti.com>

drm/omap: dispc: disp_wb_setup to check return code

When dispc_wb_setup() calls dispc_ovl_setup_common() it does not
check for failure but instead keeps on partially setting up WB.
This causes the WB H/W to be partially initialized and yield
unexpected behavior.

Make sure return code is successful before proceeding.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# fe6b5039 12-Feb-2018 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: reorganize locking in mgr_fld_write

Fix sparse warning:

drivers/gpu/drm/omapdrm/dss/dispc.c:387:9: warning: context imbalance in 'mgr_fld_write' - different lock contexts for basic block

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 1f6b6b62 13-Feb-2018 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: dispc: Allocate the dispc private data structure dynamically

The dispc private data structure is currently stored as a global
variable. While no platform with multiple DISPC currently exists
nor is planned, this doesn't comply with the kernel device model and
should thus be fixed.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>


# 8a7eda76 13-Feb-2018 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: dispc: Pass DISPC pointer to remaining dispc API functions

This removes the need to access the global DISPC private data in those
functions (both for the current accesses and the future ones that will
be introduced when allocating the DISPC private data dynamically).

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>


# 50638ae5 13-Feb-2018 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: dispc: Pass DISPC pointer to dispc_ops operations

This removes the need to access the global DISPC private data in those
functions (both for the current accesses and the future ones that will
be introduced when allocating the DISPC private data dynamically).

In order to allow the omapdrm side to call the dispc_ops with a DISPC
pointer, we also introduce a new function dss_get_dispc() to retrieve
the DISPC corresponding to the DSS.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>


# d3541ca8 13-Feb-2018 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: dss: Store dispc ops in dss_device structure

Remove the global dispc ops variable by storing it in the dss_device
structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>


# 1c4b92ee 13-Feb-2018 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: dss: Store the debugfs root directory in struct dss_device

As part of an effort to remove the usage of global variables in the
driver, store the debugfs root directory in the dss_device structure
instead of a global variable.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>


# 798957ae 13-Feb-2018 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: dss: Store the registered plls array in struct dss_device

As part of an effort to remove the usage of global variables in the
driver, store the registered plls array in the dss_device structure
instead of a global variable.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>


# f33656e1 13-Feb-2018 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: dss: Support passing private data to debugfs show handlers

To simplify implementation of debugfs seq_file show handlers, the driver
passes the pointer to the show function through the debugfs_create_file
data pointer. This prevents using the pointer to pass driver private
data to the show handler, and requires all handlers to use global
variables to access private data.

To prepare for the removal of global private data in the driver, rework
the debugfs infrastructure to allow passing a private data pointer to
show handlers.

The price to pay is explicit removal of debugfs files to free the
internally allocated memory. This is desirable anyway as debugfs entries
should be removed when a component driver is unbound, otherwise crashes
will occur due to access to freed memory when the components will be
dynamically allocated instead of stored in global variables.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>


# 1ef904e1 13-Feb-2018 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: dss: Pass DSS pointer to remaining dss functions

This removes the need to access the global DSS private data in those
functions (both for the current accesses and the future ones that will
be introduced when allocating the DSS device dynamically).

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>


# 60f9c59f 13-Feb-2018 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: dss: Pass DSS pointer to dss clock functions

This removes the need to access the global DSS private data in those
functions (both for the current accesses and the future ones that will
be introduced when allocating the DSS device dynamically).

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>


# 3cc62aad 13-Feb-2018 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: dss: Pass DSS pointer to dss_get_*_clk_source()

This removes the need to access the global DSS private data in those
functions (both for the current accesses and the future ones that will
be introduced when allocating the DSS device dynamically).

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>


# d11e5c82 11-Feb-2018 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: Use unsigned int type

The kernel favours 'unsigned int' over plain 'unsigned'. Replace all
occurences of the latter by the former. This avoid lots of checkpatch
complaints in patches that touch lines where a plain 'unsigned' is used.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# d66c36a3 05-Dec-2017 Andrew F. Davis <afd@ti.com>

drm: omapdrm: Simplify platform registration

Currently, calls into each file are used to register the various
platform drivers. Change this to a table of pointers to platform_driver
structs to allow using platform_register_drivers.

Signed-off-by: Andrew F. Davis <afd@ti.com>


# bb5cdf8d 05-Dec-2017 Andrew F. Davis <afd@ti.com>

drm: omapdrm: Remove filename from header and fix copyright tag

Having the filename in the header serves little purpose and is
often wrong after renames as it is here in several places, just
drop it from all omapdrm files.

While we are here unify the copyright tags to the TI recommended style.

Signed-off-by: Andrew F. Davis <afd@ti.com>


# 867d7e02 30-Nov-2017 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: dss: Add support for reporting memory bandwidth limitation

The get_memory_bandwidth_limit() in dispc_ops can be used to query the
memory bandwidth limit of dispc by upper layers.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# d874b3a7 04-Aug-2017 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: Remove dss_features.h

The header file only contains four macros, two of which are never used.
Move the other two to dss.h and remove dss_features.h.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 51919572 04-Aug-2017 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: Move supported outputs feature to dss driver

The supported outputs feature is specific to the DSS, move it from the
omap_dss_features structure to the dss driver.

The omap_dss_features structure is now empty and can be removed.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 9f0fbaea 04-Aug-2017 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: Move DSS_FCK feature to dss driver

The FEAT_PARAM_DSS_FCK feature is specific to the DSS, move it from the
omap_dss_features structure to the dss driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# c4ff6ea6 04-Aug-2017 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: Move PCD, LINEWIDTH and DOWNSCALE features to dispc driver

The FEAT_PARAM_DSS_PCD, FEAT_PARAM_LINEWIDTH and FEAT_PARAM_DOWNSCALE
features are specific to the DISPC, move them from the omap_dss_features
structure to the dispc driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 1ac0c894 04-Aug-2017 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: Move FEAT_* features to dispc driver

All the remaining FEAT_* features are specific to the DISPC, move them
from the omap_dss_features structure to the dispc driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 38dc0703 04-Aug-2017 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: Move reg_fields to dispc_features structure

The reg_fields feature describes DISPC registers only. Move it from the
omap_dss_features structure to the dispc_features structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# acf591c6 04-Aug-2017 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: Move num_ovls and num_mgrs to dispc_features structure

The num_ovls and num_mgrs are dispc features. Move them from the
omap_dss_features structure to the dispc_features structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# fcd41888 04-Aug-2017 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: Move overlay caps features to dispc_features structure

The overlay_caps is a dispc feature. Move it from the omap_dss_features
structure to the dispc_features structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 94f96ad7 04-Aug-2017 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: Move color modes feature to dispc_features structure

The supported_color_modes is a dispc feature. Move it from the
omap_dss_features structure to the dispc_features structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 28550474 04-Aug-2017 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: Move size unit features to dispc_features structure

The buffer_size_unit and burst_size_unit are dispc features. Move them
from the omap_dss_features structure to the dispc_features structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 7a143a4b 04-Aug-2017 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: dispc: Select features based on compatible string

Use the compatible string instead of the OMAP SoC revision to determine
device features. On OMAP34xx the features depend on the ES revision that
can not be determined from the compatible string. Use soc_device_match()
in that case.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 2add8d13 16-May-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: fix YUV422 90/270 rotation with mirroring

When rotating 90/270 + mirroring with YUV422, the end result will have
adjacent pixels swapped. The problem is that
dispc_ovl_set_rotation_attrs() has wrong rotation values for these
cases.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# c4df6e42 15-May-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: fix YUV422 rotation with TILER

TILER rotation with YUV422 pixelformats does not work at the moment. All
other pixel formats work, because the pixelformat's pixel size is equal
to tiler unit size (e.g. XR24's pixel size is 32 bits, and the TILER
unit size that has to be used is 32 bits).

For YUV422 formats this is not the case, as the TILER unit size has to
be 32 bits, but the pixel size is 16 bits. The end result is OCP errors
and sync losts.

This patch adds the code to adjust the variables for YUV422 formats.

We could make the code more generic by passing around the pixel format,
rotation type, angle and the tiler unit size, which would allow us to do
calculations without special case for YUV422. However, this would make
the code more complex, and at least for now this is much more easier to
handle with these two special cases for YUV422.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 4eebb80e 15-May-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: DRM_MODE_REFLECT_* instead of mirror boolean

Change dispc driver to use the DRM_MODE_REFLECT flags instead of a mirror
boolean.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 0bd97c42 16-May-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: use DRM_MODE_ROTATE_* instead of OMAP_DSS_ROT_*

At the moment the dispc driver uses a custom enum for rotation. Change
it to use the DRM's DRM_MODE_ROTATE_*.

Note that mirroring is at the moment handled as a separate boolean in
the dispc driver, so we only use the DRM_MODE_ROTATE_* values.

Note, DSS HW uses clockwise rotation, DRM counter-clockwise.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 41aff42a 04-May-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: rename color_mode to fourcc

Now that we use fourccs, we can also rename the 'color_mode' variables
to 'fourcc'.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 3e1d65cd 04-May-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: use DRM_FORMAT_* instead of OMAP_DSS_COLOR_*

This patch changes omapdrm to use DRM_FORMAT_* values instead of
OMAP_DSS_COLOR_* enum.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 9c39d17e 04-May-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: use u32 instead of enum omap_color_mode

In this step we drop 'enum omap_color_mode', and use u32 instead.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 18c0d621 04-May-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: change supported_modes to an array

enum omap_color_mode is a bitmask, so at the moment we present the
supported color modes as mask. To be able to move to fourccs, we need to
use an array to present the supported color modes.

As a first step towards fourccs, this patch changes the code to use an
array to store the enums.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 5edec14c 04-May-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: add format_is_yuv() helper

In a few places the dispc driver needs to know whether the pixel format
is an YUV format. Add a helper to figure that out.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 185e23e1 03-May-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: cleanup offset calculation

The code to calculate offset in dispc's calc_offset() is overly complex.
Simplify it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 517a8a95 03-May-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: remove dma & vrfb rotation

We have three rotation methods supported by the SoCs with DSS: DMA,
VRFB and TILER.

DMA rotation works in theory on all DSS platforms, but in practice it's
unusable due to the huge amount of memory bandwidth it uses, and has
never really been used.

VRFB is available on OMAP3, but is not supported by omapdrm, even though
we have some code for it in the dispc driver.

TILER is supported on OMAP4/OMAP5/DRA7/AM5 platforms, but has some
driver bugs.

To clean up the driver to help fixing the TILER issues, this patch drops
the DMA and VRFB rotation support, leaving only TILER rotation.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 4b9cdd96 10-Mar-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: remove CLUT

DSS IP versions 2 and 3 support CLUT modes (color lookup table), but the
driver has never supported those. We still have had some code for CLUT
modes. As the newer DSS IP versions have dropped CLUT support, we might
as well clean up the driver by removing the CLUT related code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 6d86278c 29-Aug-2016 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: fix setting & clearing DOUBLESTRIDE

The code that sets and clears DOUBLESTRIDE is only ran when using NV12.
This is not correct, as we might first set the bith when using NV12, but
never clear it when using other formats.

Fix it so that when the bit is available (when the HW supports NV12) we
always either set or clear the bit.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 2e953d83 20-Feb-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: remove read_irqenable()

We only use read_irqenable() to flush posted write. Instead of having a
separate function for this, do the flush implicitly in write_irqenable().
Thus we can remove read_irqenable().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 49a3057a 16-Feb-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: remove ovl_set_channel_out

At the moment we have ovl_set_channel_out() to configure the output
channel of an overlay. It makes sense to have this configuration as part
of the rest of overlay configuration, and in DSS6+ we need the output
channel when doing the other overlay configuration.

This patch adds a 'channel' parameter to ovl_setup(), so that all
overlay configuration is done via the same function, and removes the
ovl_set_channel_out().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 5806bce1 16-Feb-2017 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: remove unused ovl_enabled()

ovl_enabled() is not used anywhere, so remove it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# b22622f0 06-May-2017 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: Remove duplicate error messages when mapping memory

The devm_ioremap_resource() call can handle being given a NULL resource,
and prints an error message when mapping fails. Switch the remaining
devm_ioremap() calls to devm_ioremap_resource() and remove all
extraneous resource NULL checks and error messages printed manually by
the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 273ffeaf 24-Mar-2017 Jyri Sarha <jsarha@ti.com>

drm/omap: Fix one ugly indentation style break left by coccinelle

Fix one ugly indentation style break left by the previous coccilnelle
patch.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 864050c7 24-Mar-2017 Jyri Sarha <jsarha@ti.com>

drm/omap: Rename enum omap_plane to enum omap_plane_id

The enum omap_plane conflicted with the same struct name for omapdrm
plane private data. This rename should solve the conflict.

The rename was implement with this very simple coccinelle patch:
------------------------
@@
@@
enum
-omap_plane
+omap_plane_id
------------------------
The patch was applied like this:
spatch --sp-file <cocci_file> --all-includes --in-place --dir drivers/gpu/drm/omapdrm

The above patch did not rename the actual enum definition. That was
added manually on top of the spatch changes.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 956d4f93 23-Nov-2016 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: dispc: improve debug print of display flags

Instead of printing 0/1 for display flags like vsync high/low, use a
tri-state print (-1/0/1) to indicate the "undefined" state.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# be2d68c6 29-Aug-2016 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: fix replication logic

DSS uses "replication logic" to convert color components from smaller
bit widths to bigger bit widths. Without replication logic, the color
component would be shifted and the least significant bits would be left
at 0, whereas with replication logic, the least significat bits will be
filled with the most significant bit.

For some reason omapdrm leaves replication logic always to off, which,
in the most common case, means that showing 16-bit RGB colors on 24-bit
display gives a bit darker colors than expected.

The reset value of the replication logic bit is enabled, and it should
always be set, as there's no practical reason to disable it. This patch
removes the option to disable it from omapdrm, and always sets it to
enabled in dispc.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# b8480cab 10-Nov-2015 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: remove unused dispc_wb_enable & dispc_wb_is_enabled

Remove two unused WB functions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 5034b1fa 05-Nov-2015 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: remove all EXPORT_SYMBOLs from dispc.c

omapdrm now uses dispc_ops instead of direct function calls so we can
remove all EXPORT_SYMBOLs from dispc. Most of the functions can also be
made static, but a few are used outside dispc.c.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# a1a37647 05-Nov-2015 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: fill dispc_ops

This patch changes the current omapdss driver to fill a dispc_ops struct
and set it to omapdss-base.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# c283400a 05-Nov-2015 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: move dispc related dss-feat funcs to dispc

omapdrm still uses a few non-dispc functions: dss_feat_get_num_mgrs(),
dss_feat_get_num_ovls() and dss_feat_get_supported_color_modes(). We
want to provide omapdrm a single dispc_ops function pointer struct so
that omapdrm will use either the current omapdss or the new omapdss6
driver depending on the platform.

Those three functions are really dispc functions, but are located in the
dss_features.c for legacy reasons.

This patch adds similar functionss to the dispc, and changes omapdrm to
use those new functions. Underneath the functions still call the
functions from dss_feature.c.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 1b30ab0c 08-Feb-2017 Jyri Sarha <jsarha@ti.com>

drm/omapdrm: dispc: Refuse x-decimation above 4 for all but 8-bit formats

Let's disable all scaling that requires horizontal decimation with
higher factor than 4, until we have better estimates of what we can
and can not do. However, NV12 color format appears to work Ok with
all decimation factors.

When decimating horizontally by more that 4 the dss is not able to
fetch the data in burst mode. When this happens it is hard to tell if
there enough bandwidth. Despite what theory says this appears to be
true also for 16-bit color formats.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 03af8157 17-Apr-2016 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

drm: omapdrm: Check the CRTC software state at enable/disable time

The omapdrm DSS manager enable/disable operations check the DSS manager
state to avoid double enabling/disabling. Check the CRTC software state
instead to decrease the dependency of the DRM layer to the DSS layer.
The dispc_mgr_is_enabled() function then be turned into a static
function, but needs to be moved up in its compilation unit to avoid a
forward declaration.

Add a WARN_ON to catch double enable or disable that should be prevented
by the DRM core and would be a clear sign of a bug. The warning should
eventually be removed.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# da11bbbb 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: Use consistent name for struct videomode

Use 'vm' to refer to a struct videomode instead of 'p', 't', 'timings' or
something else.

The code will be easier to follow if we use consistent names.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 4520ff28 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: Replace struct omap_video_timings with videomode

omap_video_timings can be replaced with the generic videomode in omapdrm
and the omap_video_timings can be removed.

This patch will replace the omap_video_timings with videomode.
With the change we no longer need the functions to convert to/from
videomode and drm_display_mode to omap_video_timings, these can be removed
as well.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 7aa91e76 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: Change the types of struct omap_video_timings members

omap_video_timings struct have the same members as struct videomode, but
their types are different. As first step change the types of the
omap_video_timings struct members to match their counterpart in
struct videomode to catch any type cast related issues.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# d34afb73 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: omap_display_timings: Use display_flags for sync edge

In preparation to move the stack to use the generic videmode struct for
display timing information use display_flags for sync edge.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# f149e17a 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: omap_display_timings: Use display_flags for pixel data edge

In preparation to move the stack to use the generic videmode struct for
display timing information use display_flags for pixel data edge.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 531efb38 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: omap_display_timings: Use display_flags for double_pixel mode

In preparation to move the stack to use the generic videmode struct for
display timing information use display_flags for double_pixel mode.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 3fa3ab4a 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: omap_display_timings: Use display_flags for DE level

In preparation to move the stack to use the generic videmode struct for
display timing information use display_flags for DE level.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 6b44cd27 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: omap_display_timings: Use display_flags for h/vsync level

In preparation to move the stack to use the generic videmode struct for
display timing information use display_flags for h/vsync level.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 3b592939 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: dispc: Simplify _dispc_mgr_set_lcd_timings() parameters

Instead of passing the omap_video_timings structure's members individually,
use the pointer to the struct.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 53058299 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: omap_display_timings: Use display_flags for interlace mode

Remove the interlace member and add display_flags to omap_video_timings to
configure the interlace mode.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 458540c6 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: omap_display_timings: rename vbp to vback_porch

In preparation to move the stack to use the generic videmode struct for
display timing information rename the vbp member to vback_porch.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 0996c68e 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: omap_display_timings: rename vfp to vfront_porch

In preparation to move the stack to use the generic videmode struct for
display timing information rename the vfp member to vfront_porch.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# d5bcf0aa 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: omap_display_timings: rename vsw to vsync_len

In preparation to move the stack to use the generic videmode struct for
display timing information rename the vsw member to vsync_len.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# a85f4a80 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: omap_display_timings: rename hbp to hback_porch

In preparation to move the stack to use the generic videmode struct for
display timing information rename the hbp member to hback_porch.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 0a30e150 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: omap_display_timings: rename hfp to hfront_porch

In preparation to move the stack to use the generic videmode struct for
display timing information rename the hfp member to hfront_porch.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 4dc2250d 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: omap_display_timings: rename hsw to hsync_len

In preparation to move the stack to use the generic videmode struct for
display timing information rename the hsw member to hsync_len.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# fb7f3c43 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: omap_display_timings: rename y_res to vactive

In preparation to move the stack to use the generic videmode struct for
display timing information rename the y_res member to vactive.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 81899060 22-Sep-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: omap_display_timings: rename x_res to hactive

In preparation to move the stack to use the generic videmode struct for
display timing information rename the x_res member to hactive.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 0cac5b61 01-Jul-2016 Andrew F. Davis <afd@ti.com>

drm/omap: remove unneeded conversions to bool

Found with scripts/coccinelle/misc/boolconv.cocci.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# fbff010b 07-Jun-2016 Jyri Sarha <jsarha@ti.com>

drm/omapdrm: Workaround for errata i734 (LCD1 Gamma) in DSS dispc

Workaround for errata i734 in DSS dispc
- LCD1 Gamma Correction Is Not Working When GFX Pipe Is Disabled

For gamma tables to work on LCD1 the GFX plane has to be used at least
once after DSS HW has come out of reset. The workaround sets up a
minimal LCD setup with GFX plane and waits for one vertical sync irq
before disabling the setup and continuing with the context
restore. The physical outputs are gated during the operation.

For details see:
OMAP543x Multimedia Device Silicon Revision 2.0 Silicon Errata
Literature Number: SWPZ037E
Or some other relevant errata document for the DSS IP version.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# acc3a231 07-Jun-2016 Jyri Sarha <jsarha@ti.com>

drm/omapdrm: Add gamma table support to DSS dispc

Add gamma table support to DSS dispc.

DSS driver initializes the default gamma table at component bind time
and holds a copy of all gamma tables in its internal data structure.

Each call to dispc_mgr_set_gamma() updates the internal table and
triggers write to the HW, if it is enabled. The tables are restored to
HW in PM resume callback. The drivers internal data structure match
the HW tables in size and in number of significant bits per color
component. The dispc_mgr_set_gamma() converts the size of any given
table for the internal data structure using linear interpolation.
Default gamma table is restored if NULL is given in place of gamma
lut.

dispc_mgr_gamma_size() gives HW gamma table size for the channel and
returns 0 if gamma table is not supported by the HW or the DSS driver.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 32043da7 27-May-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

drm/omap: Do not include video/omapdss.h directly in drivers

All drivers to include the omapdrm/dss/omapdss.h header file. This header
includes the <video/omapdss.h>

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>


# ef03b401 18-May-2016 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: cleanup dispc_fclk_rate()

With the new PLL helpers, we can clean up the dispc_fclk_rate(). This
will also make dispc_fclk_rate() support clock sources it didn't support
earlier.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 01575776 17-May-2016 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: cleanup dispc_mgr_lclk_rate()

With the new PLL helpers, we can clean up the dispc_mgr_lclk_rate().
This will also make dispc_mgr_lclk_rate() support clock sources it
didn't support earlier.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 3b63ca75 17-May-2016 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: rename dss_clk_source enums

The names of the enum dss_clk_source's values are legacy names, only
correct for OMAP3 DSS. Rename the names to more generic ones.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 407bd564 17-May-2016 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: rename dss_get_generic_clk_source_name()

Now that there is no "non-generic" version of the function to get the
clock source name, lets rename dss_get_generic_clk_source_name() to
dss_get_clk_source_name().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 557a1544 17-May-2016 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: remove dss_feat_get_clk_source_name()

We have two functions to return a name for clock sources for debugging
purposes: dss_feat_get_clk_source_name() and
dss_get_generic_clk_source_name().

The former is supposed to return a DSS IP version specific name for the
clock source, and the latter is supposed to return a more generic name.

All this seems a bit pointless, so let's remove the former one.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# dc0352d1 17-May-2016 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: rename omap_dss_clk_source

'enum omap_dss_clk_source' is internal to dss. Let's rename it to
'dss_clk_source' match our naming convention.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 3bce5f43 22-Feb-2016 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: remove dispc_ovl_check()

dispc_ovl_check() is not used anywhere, so it can be removed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 9198891b 22-Feb-2016 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: remove dss compat code

We have removed all the uses of compat code from omapdrm and the
non-compat parts of omapdss, so now we can remove all the compat code
itself.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# 7b9cb5ee 04-Nov-2015 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: Add dispc_mgr_get_supported_outputs()

We are removing the use of the 'struct omap_overlay_manager' from
omapdrm, and one part of that is removing the use of
mgr->supported_outputs field.

This patch adds dispc_mgr_get_supported_outputs() function which can be
used instead of mgr->supported_outputs. omap_crtc.c is changed to use
the new function.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


# b7536d67 13-Jan-2016 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: DISPC: Fix field order for HDMI

Interlace field order is different between VENC and HDMI. The driver
currently sets the field order for VENC.

This patch adds the code to set the field order for HDMI.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 3a38ed53 13-Jan-2016 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: DISPC: support double-pixel mode

We need double-pixel mode (pixel repetition) for interlace modes. This
patch adds the necessary support to DISPC to output double-pixel mode.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


# 9960aa7c 09-Dec-2015 Tomi Valkeinen <tomi.valkeinen@ti.com>

drm/omap: move omapdss & displays under omapdrm

Now that omapfb has its own copy of omapdss and display drivers, we can
move omapdss and display drivers which omapdrm uses to omapdrm's
directory.

We also need to change the main drm Makefile so that omapdrm directory
is always entered, because omapdss has a file that can't be built as a
module.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Acked-by: Rob Clark <robdclark@gmail.com>