aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/omapdrm/dss/dispc.c
AgeCommit message (Collapse)AuthorFilesLines
2020-11-10drm/omap: Fix runtime PM imbalance on errorDinghao Liu1-2/+5
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 <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-08-04drm/omap: force runtime PM suspend on system suspendTomi Valkeinen1-0/+1
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 <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Acked-by: Tony Lindgren <[email protected]> Fixes: cef766300353 ("drm/omap: Prepare DSS for probing without legacy platform data") Cc: [email protected] # v5.7+ Tested-by: Tony Lindgren <[email protected]>
2020-05-05drm/omap: change default signal polarities and drivesTomi Valkeinen1-27/+6
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 <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Laurent Pinchart <[email protected]>
2020-01-08drm/omapdrm: use BUG_ON macro for error debugging.Wambui Karuga1-2/+1
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 <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-10-04drm/omap: fix missing scaler pixel fmt limitationsTomi Valkeinen1-0/+25
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 <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-10-04drm/omap: avoid copy in mgr_fld_read/writeTomi Valkeinen1-4/+4
Avoid unnecessary copy in mgr_fld_read/write by taking a pointer to the reg_resc and using that. Signed-off-by: Tomi Valkeinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Laurent Pinchart <[email protected]>
2019-10-04drm/omap: drop unneeded locking from mgr_fld_write()Tomi Valkeinen1-14/+1
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 <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-09-04dma-mapping: remove dma_{alloc,free,mmap}_writecombineChristoph Hellwig1-6/+5
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 <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234Thomas Gleixner1-12/+1
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 <[email protected]> Reviewed-by: Alexios Zavras <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Enrico Weigelt <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-10-02drm/omap: Substitute format_is_yuv() with format->is_yuvAyan Kumar Halder1-16/+10
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 <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2018-10-02drm/omap: remove set but not used variable 'frame_height'YueHaibing1-6/+3
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 <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2018-09-03drm/omap: Call dispc timings check operation directlyLaurent Pinchart1-8/+10
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 <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2018-09-03drm/omap: Remove supported output check in CRTC connect handlerLaurent Pinchart1-8/+0
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 <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2018-06-28drm/omap: fix email addressTomi Valkeinen1-1/+1
Change [email protected] to [email protected]. Signed-off-by: Tomi Valkeinen <[email protected]>
2018-05-07drm/omap: add missing linefeeds to printsTomi Valkeinen1-7/+7
A bunch of debug and error prints are missing linefeeds. Add those. Signed-off-by: Tomi Valkeinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Benoit Parrot <[email protected]> Reviewed-by: Peter Ujfalusi <[email protected]> Signed-off-by: Sean Paul <[email protected]>
2018-05-07drm/omap: handle error if scale coefs are not foundTomi Valkeinen1-0/+6
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 <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Benoit Parrot <[email protected]> Reviewed-by: Peter Ujfalusi <[email protected]> Signed-off-by: Sean Paul <[email protected]>
2018-03-01drm/omap: cleanup color space conversionTomi Valkeinen1-15/+44
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 <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
2018-03-01drm/omap: add writeback funcs to dispc_opsTomi Valkeinen1-4/+15
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 <[email protected]>
2018-03-01drm/omap: fix scaling limits for WBTomi Valkeinen1-4/+20
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 <[email protected]>
2018-03-01drm/omap: fix WB height with interlaceTomi Valkeinen1-12/+16
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 <[email protected]> Acked-by: Benoit Parrot <[email protected]>
2018-03-01drm/omap: fix WBDELAYCOUNT with interlaceTomi Valkeinen1-5/+9
Vertical blanking needs to be halved on interlace modes. WBDELAYCOUNT was calculated without such halving, resulting in WBUNCOMPLETE errors. Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Benoit Parrot <[email protected]>
2018-03-01drm/omap: fix WBDELAYCOUNT for HDMITomi Valkeinen1-2/+6
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 <[email protected]>
2018-03-01drm/omap: set WB channel-in in wb_setup()Tomi Valkeinen1-9/+3
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 <[email protected]>
2018-03-01drm/omap: Add pclk setting case when channel is DSS_WBBenoit Parrot1-0/+4
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 <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2018-03-01drm/omap: dispc: disp_wb_setup to check return codeBenoit Parrot1-1/+3
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 <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
2018-03-01drm/omap: reorganize locking in mgr_fld_writeTomi Valkeinen1-5/+5
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 <[email protected]>
2018-03-01drm: omapdrm: dispc: Allocate the dispc private data structure dynamicallyLaurent Pinchart1-895/+1039
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 <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]>
2018-03-01drm: omapdrm: dispc: Pass DISPC pointer to remaining dispc API functionsLaurent Pinchart1-46/+56
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 <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]>
2018-03-01drm: omapdrm: dispc: Pass DISPC pointer to dispc_ops operationsLaurent Pinchart1-102/+121
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 <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]>
2018-03-01drm: omapdrm: dss: Store dispc ops in dss_device structureLaurent Pinchart1-2/+4
Remove the global dispc ops variable by storing it in the dss_device structure. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]>
2018-03-01drm: omapdrm: dss: Store the debugfs root directory in struct dss_deviceLaurent Pinchart1-1/+1
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 <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]>
2018-03-01drm: omapdrm: dss: Store the registered plls array in struct dss_deviceLaurent Pinchart1-2/+2
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 <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]>
2018-03-01drm: omapdrm: dss: Support passing private data to debugfs show handlersLaurent Pinchart1-3/+10
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 <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]>
2018-03-01drm: omapdrm: dss: Pass DSS pointer to remaining dss functionsLaurent Pinchart1-1/+1
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 <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]>
2018-03-01drm: omapdrm: dss: Pass DSS pointer to dss clock functionsLaurent Pinchart1-4/+4
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 <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]>
2018-03-01drm: omapdrm: dss: Pass DSS pointer to dss_get_*_clk_source()Laurent Pinchart1-4/+7
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 <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]>
2018-03-01drm: omapdrm: Use unsigned int typeLaurent Pinchart1-13/+12
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 <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-12-19drm: omapdrm: Simplify platform registrationAndrew F. Davis1-11/+1
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 <[email protected]>
2017-12-19drm: omapdrm: Remove filename from header and fix copyright tagAndrew F. Davis1-2/+0
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 <[email protected]>
2017-12-19drm/omap: dss: Add support for reporting memory bandwidth limitationPeter Ujfalusi1-0/+13
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 <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-08-15drm: omapdrm: Remove dss_features.hLaurent Pinchart1-1/+0
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 <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-08-15drm: omapdrm: Move supported outputs feature to dss driverLaurent Pinchart1-1/+1
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 <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-08-15drm: omapdrm: Move DSS_FCK feature to dss driverLaurent Pinchart1-1/+1
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 <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-08-15drm: omapdrm: Move PCD, LINEWIDTH and DOWNSCALE features to dispc driverLaurent Pinchart1-14/+39
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 <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-08-15drm: omapdrm: Move FEAT_* features to dispc driverLaurent Pinchart1-67/+190
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 <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-08-15drm: omapdrm: Move reg_fields to dispc_features structureLaurent Pinchart1-11/+76
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 <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-08-15drm: omapdrm: Move num_ovls and num_mgrs to dispc_features structureLaurent Pinchart1-25/+66
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 <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-08-15drm: omapdrm: Move overlay caps features to dispc_features structureLaurent Pinchart1-4/+102
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 <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-08-15drm: omapdrm: Move color modes feature to dispc_features structureLaurent Pinchart1-3/+124
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 <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-08-15drm: omapdrm: Move size unit features to dispc_features structureLaurent Pinchart1-7/+18
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 <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>