aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-10-12omapdrm: omapdss_hdmi_ops: add lost_hotplug opHans Verkuil4-5/+18
The CEC framework needs to know when the hotplug detect signal disappears, since that means the CEC physical address has to be invalidated (i.e. set to f.f.f.f). Add a lost_hotplug op that is called when the HPD signal goes away. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-10-12omapdrm: hdmi4: hook up the HDMI CEC supportHans Verkuil3-1/+31
Hook up the HDMI CEC support in the hdmi4 driver. It add the CEC irq handler, the CEC (un)init calls and tells the CEC implementation when the physical address changes. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-10-12omapdrm: hdmi4_cec: add OMAP4 HDMI CEC supportHans Verkuil2-0/+436
Add the source and header for the OMAP4 HDMI CEC support. This code is not yet hooked up, that will happen in the next patch. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-10-12omapdrm: hdmi4: refcount hdmi_power_on/off_coreHans Verkuil1-1/+9
The hdmi_power_on/off_core functions can be called multiple times: when the HPD changes and when the HDMI CEC support needs to power the HDMI core. So use a counter to know when to really power on or off the HDMI core. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-10-12omapdrm: hdmi4: move hdmi4_core_powerdown_disable to hdmi_power_on_core()Hans Verkuil2-3/+2
Call hdmi4_core_powerdown_disable() in hdmi_power_on_core() to power up the HDMI core (needed for CEC). The same call can now be dropped in hdmi4_configure(). Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-10-12omapdrm: hdmi4: prepare irq handling for HDMI CEC supportHans Verkuil1-5/+6
Pass struct omap_hdmi to the irq handler since it will need access to hdmi.core. Do not clear the IRQ_HDMI_CORE bit: that will be controlled by the HDMI CEC code. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-10-12omapdrm: hdmi4: make low-level functions availableHans Verkuil3-9/+13
Three low-level functions in hdmi4.c and hdmi4_core.c are made available for use by the OMAP4 CEC support. Renamed the prefix to hdmi4 since these are OMAP4 specific. These function deal with the HDMI core and are needed to power it up for use with CEC, even when the HPD is low. Background: even if the HPD is low it should still be possible to use CEC. Some displays will set the HPD low when they go into standby or when they switch to another input, but CEC is still available and able to wake up/change input for such a display. This is explicitly allowed by the CEC standard. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-10-12omapdrm: hdmi.h: extend hdmi_core_data with CEC fieldsHans Verkuil1-1/+6
Extend the hdmi_core_data struct with the additional fields needed for CEC. Also fix a simple typo in a comment. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-10-12omapdrm: encoder-tpd12s015: keep ls_oe_gpio highHans Verkuil1-8/+4
For OMAP4 CEC support the CEC pin should always be on. So keep ls_oe_gpio high all the time in order to support CEC. Background: even if the HPD is low it should still be possible to use CEC. Some displays will set the HPD low when they go into standby or when they switch to another input, but CEC is still available and able to wake up/change input for such a display. This is explicitly allowed by the CEC standard. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-23drm/omap: work-around for omap3 display enableTomi Valkeinen1-17/+30
Seems that on omap3 enabling a crtc without any planes causes a sync lost flood. This only happens on the first enable, and after that it works. This looks like an HW issue and it's unclear why this is happening or how to fix it. This started happening after 897145d0c7010b4e07fa9bc674b1dfb9a2c6fff9 ("drm/omapdrm: Move commit_modeset_enables() before commit_planes()") which, as a work-around, changed omapdrm first to do the modeset enable, and plane set only after that. This WA should be fine on all DSS versions, but apparently OMAP3 DSS is an exception. This patch reverts that work-around for OMAP3 DSS. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-23drm/omap: fix i886 work-aroundTomi Valkeinen3-9/+25
7d267f068a8b4944d52e8b0ae4c8fcc1c1c5c5ba ("drm/omap: work-around for errata i886") changed how the PLL dividers and multipliers are calculated. While the new way should work fine for all the PLLs, it breaks omap5 PLLs. The issues seen are rather odd: seemed that the output clock rate is half of what we asked. It is unclear what's causing there issues. As a work-around this patch adds a "errata_i886" flag, which is set only for DRA7's PLLs, and the PLL setup is done according to that flag. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Tested-by: H. Nikolaus Schaller <hns@goldelico.com>
2017-08-23drm/omap: fix analog tv-out modecheckTomi Valkeinen1-14/+51
omapdrm rejects all venc (analog tv-out) videomodes, due to somewhat strict checking of the values, making tv-out unusable. We only support two videomodes, one for PAL and one for NTSC, so instead of trying to check every field in the videomode struct, this patch makes the driver check only the pixel clock and the size of the display. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-16drm/omap: Potential NULL deref in omap_crtc_duplicate_state()Dan Carpenter1-2/+4
If the kmalloc() fails then we dereference "state" when we set "state->zpos". Fixes: 3dfeb631a15d ("drm/omap: Rework the rotation-on-crtc hack") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-16drm/omap: remove no-op cleanup codeTomi Valkeinen1-33/+0
The driver sets crtc and plane rotation properties back to 0 degrees in dev_lastclose() using drm_object_property_set_value(). drm_object_property_set_value() doesn't do anything with atomic drivers, and a recent change added WARN_ON() when atomic driver calls the function. So remove the code. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-08-16drm/omap: rename omapdrm device backTomi Valkeinen2-2/+2
Now that creating the omapdrm device from the platform code has been removed, we can rename the omapdrm device back to "omapdrm". Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-16drm: omapdrm: Remove the omapdss driverLaurent Pinchart2-48/+0
The omapdss driver (not to be confused with the omapdss_dss driver) is now a dummy driver with empty probe and remove functions. Remove it. 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>
2017-08-16drm: omapdrm: Register omapdrm platform device in omapdss driverLaurent Pinchart2-1/+17
The omapdrm platform device is a virtual device created for the sole purpose of handling the omapdss/omapdrm driver split. It should eventually be removed. As a first step to ease refactoring move its registration from platform code to driver code. The omapdrm driver name must be changed internally to avoid probing both the device registered in platform code and the device registered in the omapdss driver, as that would otherwise break bisection. 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>
2017-08-16drm: omapdrm: hdmi: Don't allocate PHY features dynamicallyLaurent Pinchart1-28/+4
There's no need to allocate memory dynamically to duplicate the contents of a const structure, only to store the memory pointer in a const pointer field. Just use the original structures directly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-16drm: omapdrm: hdmi: Configure the PHY from the HDMI core versionLaurent Pinchart4-19/+11
The OMAP4 and OMAP5 HDMI PHYs have different properties that require specific handling in the HDMI PHY driver. This needs knowledge of the PHY version, which is currently inferred from the DSS version. As part of the effort to remove usage of the DSS version, use the HDMI controller version instead. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-16drm: omapdrm: hdmi: Configure the PLL from the HDMI core versionLaurent Pinchart1-13/+2
The OMAP4 and OMAP5 PLLs have different properties that require specific handling in the HDMI PLL driver. This needs knowledge of the PLL version, which is currently inferred from the DSS version. AS part of the effort to remove usage of the DSS version, use the HDMI controller version instead. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-16drm: omapdrm: hdmi: Pass HDMI core version as integer to HDMI audioLaurent Pinchart2-2/+2
The HDMI audio driver only needs to know which generation of HDMI transmitter it deals with, not the detailed SoC model. Pass the version number as an integer to prepare for removal of the OMAP SoC version from the omapdrm driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-16drm: omapdrm: hdmi: Replace OMAP SoC model check with HDMI xmit versionLaurent Pinchart4-10/+10
The HDMI wrapper code only needs to differentiate between major OMAP revisions, which can be obtained from the HDMI transmitter compatible string. Replace the OMAP SoC model checks to prepare for removal of the OMAP SoC version platform data. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-16drm: omapdrm: hdmi: Rename functions and structures to use hdmi_ prefixLaurent Pinchart1-4/+5
The dsi_pll_ops structure and dsi_init_pll_data() function incorrectly use a dsi_ prefix, likely due to copy & paste. Fix it by using the correct hdmi_ prefix. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-16drm/omap: add OMAP5 DSIPHY lane-enable supportTomi Valkeinen1-8/+39
We are missing OMAP5 DSIPHY lane-enable support, which has prevented OMAP5 DSI working in mainline. This patch adds the lane-enable similarly to the recently added OMAP4 version. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-08-16drm/omap: use regmap_update_bit() when muxing DSI padsTomi Valkeinen1-12/+3
Use regmap_update_bits instead of regmap_read/write, which simplifies the code. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-08-15drm: omapdrm: Remove dss_features.hLaurent Pinchart12-38/+3
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>
2017-08-15drm: omapdrm: Move supported outputs feature to dss driverLaurent Pinchart7-211/+81
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>
2017-08-15drm: omapdrm: Move DSS_FCK feature to dss driverLaurent Pinchart6-57/+18
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>
2017-08-15drm: omapdrm: Move PCD, LINEWIDTH and DOWNSCALE features to dispc driverLaurent Pinchart3-36/+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 <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move FEAT_PARAM_DSI* features to dsi driverLaurent Pinchart3-14/+19
The FEAT_PARAM_DSI* features are specific to the DSI, move them from the omap_dss_features structure to the dsi driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move FEAT_* features to dispc driverLaurent Pinchart3-266/+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 <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move FEAT_LCD_CLK_SRC feature to dss_features structureLaurent Pinchart3-9/+11
The FEAT_LCD_CLK_SRC feature is specific to the DSS, move it from the omap_dss_features structure to the dss_features structure. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move FEAT_DPI_USES_VDDS_DSI feature to dpi codeLaurent Pinchart3-4/+12
The FEAT_DPI_USES_VDDS_DSI feature is specific to the DPI, move it from the omap_dss_features structure to the dpi code. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move FEAT_HDMI_* features to hdmi4 driverLaurent Pinchart4-9/+37
The FEAT_HDMI_* features are specific to the HDMI4, move them from the omap_dss_features structure to the hdmi4 driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move FEAT_DSI_* features to dsi driverLaurent Pinchart3-72/+88
The FEAT_DSI_* features are specific to the DSI, move them from the omap_dss_features structure to the dsi driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move FEAT_VENC_REQUIRES_TV_DAC_CLK to venc driverLaurent Pinchart3-4/+13
The FEAT_VENC_REQUIRES_TV_DAC_CLK is specific to the VENC, move it from the omap_dss_features structure to the venc driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move reg_fields to dispc_features structureLaurent Pinchart3-112/+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 <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move DISPC_CLK_SWITCH reg feature to struct dss_featuresLaurent Pinchart4-15/+16
The register belongs to the DSS, move the feature to the dss_features structure. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move num_ovls and num_mgrs to dispc_features structureLaurent Pinchart3-58/+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 <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move overlay caps features to dispc_features structureLaurent Pinchart3-84/+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 <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move color modes feature to dispc_features structureLaurent Pinchart3-136/+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 <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move size unit features to dispc_features structureLaurent Pinchart3-41/+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 <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move shutdown() handler from core to dssLaurent Pinchart2-20/+16
In preparation for removal of the core module, move the shutdown() handler from core to dss. 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>
2017-08-15drm: omapdrm: Move all debugfs code from core to dssLaurent Pinchart3-89/+84
debugfs code is spread between the core and dss drivers. In preparation for removal of the core driver, move it all to the dss driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: dss: Initialize DSS internal features at probe timeLaurent Pinchart1-13/+13
The DSS internal features are derived from the platform device compatible string which is available at probe time. Don't delay initialization until bind time. This prepares for the merge of the two DSS features structures that will be needed before the DSS is bound. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: dss: Use supported outputs instead of display typesLaurent Pinchart3-87/+17
The dss driver uses the supported display types to check whether the DSS has SDI, VENC or HDMI outputs. We can instead use the supported outputs the provide the same information. This removes the last use of the supported display types, that we can then remove as well. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: dss: Select features based on compatible stringLaurent Pinchart1-68/+29
Use the compatible string instead of the OMAP SoC revision to determine device features. The various OMAP3-based SoCs can't be told apart using the compatible string, use soc_device_match() to tell them apart. 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>
2017-08-15drm: omapdrm: dpi: Replace OMAP SoC model checks with DSS modelLaurent Pinchart3-37/+45
The DPI code only needs to differentiate between major OMAP revisions, which can be obtained from the DSS compatible string. Replace the OMAP SoC model checks to prepare for removal of the OMAP SoC version platform data. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: dispc: Select features based on compatible stringLaurent Pinchart1-60/+27
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>
2017-08-15drm: omapdrm: Don't forward set_min_bus_tput() to no-op platform codeLaurent Pinchart2-11/+6
The OMAP implementation of the set_min_bus_tput() API is a no-op. There's no point in forwarding the driver calls to the platform code. Remove the use of the related platform data callback, but keep the internal function as a reminder that the feature will need to be implemented when the OMAP platform will provide support. 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>