aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/omapdrm
AgeCommit message (Collapse)AuthorFilesLines
2017-06-02drm/omap: sdi: remove legacy set_datapairsTomi Valkeinen2-13/+0
Non-DT booting is no longer supported, so remove legacy code. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
2017-06-02drm/omap: connector-dvi/hdmi: remove extra includeTomi Valkeinen2-2/+0
Remove extra includes related to non-DT boot. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
2017-06-02drm/omap: connector-analog-tv: remove non-DT supportTomi Valkeinen1-46/+3
Non-DT booting is no longer supported, so remove legacy code. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
2017-06-02drm/omap: acx565akm: remove non-DT supportTomi Valkeinen1-44/+3
Non-DT booting is no longer supported, so remove legacy code. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
2017-06-02drm/omap: panel-dpi: remove non-DT supportTomi Valkeinen1-73/+3
Non-DT booting is no longer supported, so remove legacy code. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
2017-06-02drm/omap: define compat_ioctlTomi Valkeinen1-0/+1
Define compat_ioctl in omapdriver_fops to make it possible to use 32bit apps on 64bit platform. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
2017-06-02drm/omap: 64bit compile fixesTomi Valkeinen3-3/+3
Fix a few type issues that cause compile warnings on 64 bit ARM compiler. The change should not affect 32bit platforms. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
2017-06-02drm/omap: remove read_irqenable()Tomi Valkeinen3-8/+3
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 <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
2017-06-02drm/omap: remove ovl_set_channel_outTomi Valkeinen3-14/+10
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 <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
2017-06-02drm/omap: remove unused ovl_enabled()Tomi Valkeinen2-7/+0
ovl_enabled() is not used anywhere, so remove it. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
2017-06-02drm/omap: add new connector typesTomi Valkeinen1-0/+8
We have been using DRM_MODE_CONNECTOR_Unknown for many of our outputs because there has not been a proper connector type for them. We now have connector type for DPI so let's take it into use. At the same time, add better connector types for the remaining outputs too. This patch sets the following outputs to use the following connector types: DPI -> DPI DBI -> DPI (MIPI DBI is very similar to DPI at the bus level) SDI -> LVDS (SDI, TI Flatlink 3G, is a type of LVDS) VENC -> SVIDEO or Composite Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: sdi: Remove platform driverLaurent Pinchart3-63/+0
The SDI platform driver was used for non-DT platforms only. On DT platforms the SDI port is handled manually. As OMAP display devices are now instantiated from DT only, remove the SDI platform driver. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: dpi: Remove platform driverLaurent Pinchart3-102/+0
The DPI platform driver was used for non-DT platforms only. On DT platforms the DPI port is handled manually. As OMAP display devices are now instantiated from DT only, remove the DPI platform driver. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Infer the OMAP version from the SoC familyLaurent Pinchart2-3/+13
The omapdrm exposes the SoC version to userspace through an integer that contains the OMAP model (e.g. 0x3430 for the OMAP3430). This is an unfortunate choice of userspace API as it's both conceptually wrong (userspace nowadays should use /sys/bus/soc/ for that purpose) and inaccurate as many models with different features are reported with the same version number. The only known user of this API is the xomap X11 driver. Even if it has been deprecated for some time we can't drop the kernel API yet. We can, however, infer the version number from the SoC family to avoid the need to pass the version number through platform data. Do this, which makes the omapdrm platform data not needed anymore, and ready to be removed. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Remove unused default display name supportLaurent Pinchart2-19/+0
The default display name is both unused and never set by platform data. Remove default display name module parameter, platform data field and runtime infrastructure. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Bartlomiej Zolnierkiewicz <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Remove unused dss_get_core_pdev() functionLaurent Pinchart2-6/+0
The dss_get_core_pdev() function is unused, remove it. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Drop support for non-DT devicesLaurent Pinchart5-109/+35
All OMAP platforms use DT nowadays, drop support for non-DT devices. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Remove duplicate error messages when mapping memoryLaurent Pinchart11-121/+30
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 <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Take GEM object reference when exporting dmabufLaurent Pinchart1-12/+2
To ensure that neither the GEM object nor the DRM device goes away while a GEM object exported through dma-buf is still accessible, references must be taken to both the GEM object and the DRM device at export time. The dma-buf release handler already releases the GEM object, but the export handler doesn't take a corresponding reference, which results in a refcount underflow. Fix this by replacing the custom implementation by drm_gem_dmabuf_export() and drm_gem_dmabuf_release() that handle reference counting for us. Fixes: 6ad11bc3a0b8 ("staging: drm/omap: dmabuf/prime support") Signed-off-by: Laurent Pinchart <[email protected]>
2017-06-02drm: omapdrm: Map pages for DMA in DMA_TO_DEVICE directionLaurent Pinchart2-8/+7
The display engine only reads from memory, there's no need to use bidirectional DMA mappings. Use DMA_TO_DEVICE instead. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: DMA-unmap pages for all buffer types when freeing buffersLaurent Pinchart1-11/+6
Both coherent (uncached) and non-coherent (cached) buffers can have their pages mapped to the device through the DMA mapping API. Make sure to unmap any mapped page when freeing a buffer, regardless of its type. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Fix incorrect usage of the term 'cache coherency'Laurent Pinchart1-7/+15
The is_cache_coherent() function currently returns true when the mapping is not cache-coherent. This isn't a bug as such as the callers interpret cache-coherent as meaning that the driver has to handle the coherency manually, but it is nonetheless very confusing. Fix it and add a bit more documentation to explain how cached buffers are handled. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Rename GEM DMA sync functionsLaurent Pinchart4-9/+9
The omap_gem_cpu_sync() function operates at a page level, while the omap_gem_dma_sync() function operates at a buffer level. Rename them to omap_gem_cpu_sync_page() and omap_gem_dma_sync_buffer() respectively to avoid confusion. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Rename the omap_gem_object addrs field to dma_addrsLaurent Pinchart1-11/+11
The field contains DMA addresses, clarify that by renaming it. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Lower indentation level in omap_gem_dma_sync_buffer()Laurent Pinchart1-22/+21
This makes the function more readable. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Rename omap_gem_(get|put)_paddr() to omap_gem_(un)pin()Laurent Pinchart5-24/+39
The reflects the purpose of the function better. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Rename occurrences of paddr to dma_addrLaurent Pinchart5-56/+57
The fields, variables and functions deal with DMA addresses, name them accordingly. The omap_gem_get_paddr() and omap_gem_put_paddr() will be addressed differently separately. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Remove remap argument to omap_gem_get_paddr()Laurent Pinchart5-11/+8
The function is always called with the remap argument set to true. Hardcode that behaviour and remove it. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Add zpos propertyLaurent Pinchart2-1/+5
Create a standard zpos property for every plane as an alias to the omapdrm-specific zorder property. Unlike the zorder property that has to be instantiated for both planes and CRTCs due to backward compatibility, the zpos property is only instantiated for planes. When userspace will have switched to the zpos property the zorder property will be removed. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Remove custom plane stateLaurent Pinchart1-52/+6
The custom plane state only encapsulates the standard plane state with adding any custom field. Remove it and use the atomic plane helpers directly. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Store the Z order in the plane state zpos fieldLaurent Pinchart1-14/+7
The DRM core implements a standard "zpos" property to control planes ordering. The omapdrm driver implements a similar property named "zorder". Although we can't switch to DRM core handling of the "zpos" property for backward compatibility reasons, we can store the zorder value in the drm_plane_state zpos field, saving us from adding a custom field to the plane state. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Remove legacy buffer synchronization supportLaurent Pinchart3-268/+4
The omapdrm driver uses a custom API to synchronize with the SGX GPU. This is unusable as such in the mainline kernel as the API is only partially implemented and requires additional out-of-tree patches. Furthermore, as no SGX driver is available in the mainline kernel, the API can't be considered as a stable mainline API. Now that the driver supports synchronization through fences, remove legacy buffer synchronization support. The two userspace ioctls are turned into no-ops to avoid breaking userspace and will be removed in the future. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Use DRM core's atomic commit helperLaurent Pinchart2-106/+15
The DRM core atomic helper now supports asynchronous commits natively. The custom omapdrm implementation isn't needed anymore, remove it. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Handle events when enabling/disabling CRTCsLaurent Pinchart1-8/+22
The driver currently handles vblank events only when updating planes on an already enabled CRTC. The atomic update API however allows requesting an event when enabling or disabling a CRTC. This currently leads to event objects being leaked in the kernel and to events not being sent out. Fix it. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-05-22drm: Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ to UAPIRobert Foss3-19/+19
Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ defines to the UAPI as a convenience. Ideally the DRM_ROTATE_ and DRM_REFLECT_ property ids are looked up through the atomic API, but realizing that userspace is likely to take shortcuts and assume that the enum values are what is sent over the wire. As a result these defines are provided purely as a convenience to userspace applications. Changes since v3: - Switched away from past tense in comments - Add define name change to previously mis-spelled DRM_REFLECT_X comment - Improved the comment for the DRM_MODE_REFLECT_<axis> comment Changes since v2: - Changed define prefix from DRM_MODE_PROP_ to DRM_MODE_ - Fix compilation errors - Changed comment formatting - Deduplicated comment lines - Clarified DRM_MODE_PROP_REFLECT_ comment Changes since v1: - Moved defines from drm.h to drm_mode.h - Changed define prefix from DRM_ to DRM_MODE_PROP_ - Updated uses of the defines to the new prefix - Removed include from drm_rect.c - Stopped using the BIT() macro Signed-off-by: Robert Foss <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Acked-by: Liviu Dudau <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-05-18drm/omap: remove unneeded -Iinclude/drm compiler flagMasahiro Yamada1-1/+0
With the include directives under include/drm/ fixed, this flag is no longer needed. Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-04-20dma-buf: Rename dma-ops to prevent conflict with kunmap_atomic macroLogan Gunthorpe1-4/+4
Seeing the kunmap_atomic dma_buf_ops share the same name with a macro in highmem.h, the former can be aliased if any dma-buf user includes that header. I'm personally trying to include highmem.h inside scatterlist.h and this breaks the dma-buf code proper. Christoph Hellwig suggested [1] renaming it and pushing this patch ASAP. To maintain consistency I've renamed all four of kmap* and kunmap* to be map* and unmap*. (Even though only kmap_atomic presently conflicts.) [1] https://www.spinics.net/lists/target-devel/msg15070.html Signed-off-by: Logan Gunthorpe <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Acked-by: Daniel Vetter <[email protected]> Acked-by: Sumit Semwal <[email protected]> Signed-off-by: Sumit Semwal <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-04-06drm: omap: use common OF graph helpersRob Herring9-164/+26
The OMAP driver has its own OF graph helpers that are similar to the common helpers. This commit replaces most of the calls with the common helpers. There's still a couple of custom helpers left, but the driver needs more extensive changes to get rid of them. In dss_init_ports, we invert the loop, looping through the known ports and matching them to DT nodes rather than looping thru DT nodes and matching them to the ports. Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Sean Paul <[email protected]>
2017-04-03drm/omap: Major omap_modeset_init() cleanupJyri Sarha4-139/+86
Cleanup overly complex omap_modeset_init(). The function is trying to support many unusual configuration, that have never been tested and are not supported by other parts of the dirver. After cleanup the init function creates exactly one connector, encoder, crtc, and primary plane per each connected dss-device. Each connector->encoder->crtc chain is expected to be separate and each crtc is connect to a single dss-channel. If the configuration does not match the expectations or exceeds the available resources, the configuration is rejected. Signed-off-by: Jyri Sarha <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-04-03drm/omap: Remove the obsolete #define omap_plane _omap_plane hackJyri Sarha1-7/+1
Remove the obsolete "#define omap_plane _omap_plane" hack and other related hacks to get around the enum omap_plane colliding with struct omap_plane. Signed-off-by: Jyri Sarha <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-04-03drm/omap: Fix one ugly indentation style break left by coccinelleJyri Sarha1-3/+2
Fix one ugly indentation style break left by the previous coccilnelle patch. Signed-off-by: Jyri Sarha <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-04-03drm/omap: Rename enum omap_plane to enum omap_plane_idJyri Sarha6-103/+117
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 <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-04-03drm/omap: Get rid of DRM_OMAP_NUM_CRTCS config optionJyri Sarha2-52/+16
Allocate one CRTC for each connected output and get rid of DRM_OMAP_NUM_CRTCS config option. We still can not create more CRTCs than we have DSS display managers. We also reserve one overlay per CRTC for primary plane so we can not have more CRTCs than we have overlays either. Signed-off-by: Jyri Sarha <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-04-03drm/omap: fix crash on module unloadTomi Valkeinen1-14/+0
When unloading omapdrm we get a NULL pointer deref in omap_drm_irq_uninstall(). This is caused by: 967dd48417874dd25491a4e933648f394a64f70f ("drm: remove drm_vblank_no_hw_counter assignment from driver code") We shut down all the crtcs at unload time before calling omap_drm_irq_uninstall, so the code in omap_drm_irq_uninstall() is unnecessary and can be removed. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
2017-04-03drm/omap: use drm_atomic_helper_shutdown()Tomi Valkeinen1-0/+2
Use drm_atomic_helper_shutdown() to ensure that all crtcs are disabled when unloading the driver. Signed-off-by: Tomi Valkeinen <[email protected]>
2017-04-03drm/omap: fix display SYNC/DE flagsTomi Valkeinen2-5/+43
At the moment VSYNC/HSYNC/DE high/low flags set by the panel/encoder drivers get lost when the videotimings are translated to DRM's videomode, as DRM's mode does not have corresponding flags. DRM has bus-flags for this purpose, and while it lacks a few flags at the moment, it should be used here. However, until we rewrite omapdrm's device model, using bus-flags is rather difficult. As a short term fix, this patch makes sure that every time the videomode is set in omap_crtc_mode_set_nofb(), the driver asks for the SYNC/DE flags from the panel/encoder drivers, and thus we get the correct flags into use. Signed-off-by: Tomi Valkeinen <[email protected]>
2017-04-03drm/omap: dispc: improve debug print of display flagsTomi Valkeinen1-5/+15
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 <[email protected]>
2017-04-03drm/omap: displays: panel-dpi: Support for handling backlight devicesPeter Ujfalusi1-2/+35
The associated backlight device can be configured via DT by providing the phandle to the device. If the backlight device is configured, the driver can manage the backligt along with the panel's power state, iow it can turn on the backlight when the panel is enabled and turn it off when the panel is disabled. Signed-off-by: Peter Ujfalusi <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-04-03drm/omap: poll only connectors where the connect/disconnect can be checkedPeter Ujfalusi1-6/+4
When the connector associated detect callback is not provided, we can not detect if the display is connected or disconnected. These displays do not support hot plug, they are always connected. Let DRM know that connectors w/o detect callback should not be polled. Signed-off-by: Peter Ujfalusi <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
2017-04-03drm/omap: display: Add displays in sorted order to the panel_listPeter Ujfalusi1-1/+9
Keep the panel_list ordered according to aliases. The DRM connectors will be created following the panel_list. By keeping the list ordered the DRM connectors will be created in the same order regardless of the driver probe order. Signed-off-by: Peter Ujfalusi <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>