summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/omapdrm/omap_drv.c
AgeCommit message (Collapse)AuthorFilesLines
2018-07-13drm: drop _mode_ from drm_mode_connector_attach_encoderDaniel Vetter1-1/+1
Again to align with the usual prefix of just drm_connector_. Again done with sed + manual fixup for indent issues. Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-7-daniel.vetter@ffwll.ch
2018-06-28drm/omap: gem: Switch to gem_free_object_unlocked()Daniel Vetter1-1/+1
The only thing that omap_gem_free_object does that might need the magic protection of struct_mutex (of keeping all objects alive if that lock is held, even if the last reference is gone) is the mm_list manipulation. This is already protected by the separate omapdrm->list_lock, which means that struct_mutex is not needed by omapdrm. We can switch to gem_free_object_unlocked() Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2018-06-28drm/omap: gem: Fix mm_list lockingDaniel Vetter1-1/+1
- None of the list walkings where protected. - Switch to a mutex since the list walking at device resume time can sleep when pinning buffers through the tiler. Only thing we need to be careful with here is that while we walk the list we can't unreference any gem objects, since the final unref would result in a recursive deadlock. But the only functions that walk the list is the device resume and debugfs dumping, so all safe. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2018-03-28drm/omap: Use normalized zpos for plane placementPeter Ujfalusi1-0/+3
Planes with identical zpos value will result undefined behavior: disappearing planes, screen flickering and it is not supported by the hardware. Use normalized zpos to make sure that we don't encounter invalid configuration. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> CC: Tomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180321102029.15248-7-peter.ujfalusi@ti.com
2018-03-01drm/omap: fix maximum sizesTomi Valkeinen1-4/+7
We define max width and height in mode_config to 2048. These maximums affect many things, which are independent and depend on platform. We need to do more fine grained checks in the code paths for each component, and so the maximum values in mode_config should just be "big enough" to cover all use cases. Change the maximum width & height to 8192. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2018-03-01drm/omap: cleanup fbdev init/freeTomi Valkeinen1-5/+4
omap_fbdev_init() and omap_fbdev_free() use priv->fbdev directly. However, omap_fbdev_init() returns the fbdev, and omap_drv.c also assigns the return value to priv->fbdev. This is slightly confusing. Clean this up by removing the omap_fbdev_init() return value, as we don't care whether fbdev init succeeded or not. Also change omap_drv.c to call omap_fbdev_free() always, and omap_fbdev_free() does the check if fbdev was initialized. While at it, rename omap_fbdev_free() to omap_fbdev_fini() to better match the "init" counterpart. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-03-01drm: omapdrm: dispc: Pass DISPC pointer to dispc_ops operationsLaurent Pinchart1-6/+7
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>
2018-03-01drm: omapdrm: dss: Store dispc ops in dss_device structureLaurent Pinchart1-3/+2
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>
2018-03-01drm: omapdrm: dss: Store DSS device pointer in the omapdrm private dataLaurent Pinchart1-0/+1
The dss_device is the top-level component in the omapdss driver. Give the omapdrm driver access to the dss_device pointer in order to obtain pointers to all other components from it. This requires a new global variable in the omapdss driver that will be removed when merging the omapdrm and omapdss drivers, but will already allow removal of several other global variables. As this partly duplicates the omapdss_is_initialized() API, reimplement it as an inline function wrapping omapdss_get_dss(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-01drm: omapdrm: dss: Pass omap_drm_private pointer to dss_mgr_opsLaurent Pinchart1-1/+1
The dss_mgr_ops operations implemented by the omapdrm side have to look up the omap_crtc objects from global variables as they are only passed a channel number. In order to remove global variables in the omapdrm driver pass the omap_drm_private pointer to the dss_mgr_ops. This requires storing a pointer to the omap_drm_private in a global variable on the DSS side as a temporary measure until the omapdrm and omapdss drivers get merged. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-01drm: omapdrm: Split init and cleanup from probe and remove functionsLaurent Pinchart1-32/+51
When merging the omapdrm and omapdss drivers there will be not omapdrm platform device anymore, and thus no associated probe and remove functions. To prepare for that, split all the initialization code from the probe function to make it usable without a platform device. Similarly, split the cleanup code from the remove function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-12-19drm: omapdrm: Remove filename from header and fix copyright tagAndrew F. Davis1-3/+1
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>
2017-12-19drm: omapdrm: Pass drm_device to omap_gem_resume()Laurent Pinchart1-1/+1
The omap_gem_resume() function is internal to the driver. Pass it a drm_device pointer that the caller already has instead of looking it up from device data. 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>
2017-12-19drm/omap: Filter displays mode based on bandwidth limitPeter Ujfalusi1-0/+5
If we have memory bandwidth limit configured, reject the modes which would require more bandwidth than the limit if it is used with one full resolution plane (most common use case). This filtering is not providing full protection as it is possible that application would pick smaller crtc resolution with high resolution planes and down scaling, or can enable more smaller planes where the sum of their bandwidth need would be higher than the limit. This patch only allows us to filter out modes which would need more bandwidth if they were used with one full screen plane. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-12-08drm/omap: Use drm_fb_helper_lastclose() and _poll_changed()Noralf Trønnes1-32/+2
This driver can use drm_fb_helper_lastclose() as its .lastclose callback. It can also use drm_fb_helper_output_poll_changed() as its .output_poll_changed callback. Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20171205182504.41923-9-noralf@tronnes.org
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-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 Valkeinen1-1/+1
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: Register omapdrm platform device in omapdss driverLaurent Pinchart1-1/+7
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-15drm/omap: Support for HDMI hot plug detectionPeter Ujfalusi1-0/+29
The HPD signal can be used for detecting HDMI cable plug and unplug event without the need for polling the status of the line. This will speed up detecting such event because we do not need to wait for the next poll event to notice the state change. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-01drm/omapdrm: Fix omap_atomic_wait_for_completionMaarten Lankhorst1-3/+3
Use the new iterator macro and look for crtc_state->active instead of enable, only crtc_state->active implies that vblanks will happen. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20170719143920.25685-5-maarten.lankhorst@linux.intel.com
2017-07-29drm/omapdrm: Use the drm_driver.dumb_destroy defaultNoralf Trønnes1-1/+0
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it. Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/1500837417-40580-31-git-send-email-noralf@tronnes.org
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 <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
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 <tomi.valkeinen@ti.com>
2017-06-02drm: omapdrm: Infer the OMAP version from the SoC familyLaurent Pinchart1-2/+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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-06-02drm: omapdrm: Add zpos propertyLaurent Pinchart1-1/+3
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 <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-06-02drm: omapdrm: Remove legacy buffer synchronization supportLaurent Pinchart1-49/+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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-06-02drm: omapdrm: Use DRM core's atomic commit helperLaurent Pinchart1-98/+14
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-05-22drm: Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ to UAPIRobert Foss1-2/+2
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 <robert.foss@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> Acked-by: Liviu Dudau <Liviu.Dudau@arm.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170519205017.23307-2-robert.foss@collabora.com
2017-04-03drm/omap: Major omap_modeset_init() cleanupJyri Sarha1-130/+47
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 <jsarha@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-04-03drm/omap: Get rid of DRM_OMAP_NUM_CRTCS config optionJyri Sarha1-43/+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 <jsarha@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
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 <tomi.valkeinen@ti.com>
2017-04-03drm/omap: Use omapdss_stack_is_ready() to check that the display stack is upPeter Ujfalusi1-6/+3
Instead of 'guessing' based on aliases of the status of the DSS drivers, use the new interface to check that all needed drivers are loaded. In this way we can be sure that all needed drivers are loaded so it is safe to continue the probing of omapdrm. This method will allow the omapdrm to be probed 'headless', without outputs. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-04-03drm/omap: use dispc_opsTomi Valkeinen1-4/+6
Change omapdrm to get dispc_ops and use that to call the dispc functions instead or direct function calls. The change is very straightforward. The only problem was in omap_crtc_init() which calls pipe2vbl(crtc), and at that point of time the crtc->dev link, which is used to get the dispc_ops, has not been set up yet. This patch makes omap_crtc_init() skip the call to pipe2vbl() and instead calls dispc_ops->mgr_get_vsync_irq() directly. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-04-03drm/omap: move dispc related dss-feat funcs to dispcTomi Valkeinen1-2/+2
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>
2017-04-03drm/omap: Add support for render nodesHemant Hariyani1-7/+13
Add support for render nodes in omap driver and allow required ioctls to be accessible via render nodes. This enables unprivileged clients to allocate resources like GEM buffers for rendering their content into. Mode setting (KMS ioctls) is not allowed using render nodes. These buffers are then shared with a previleged process (e.g compositor) that has mode setting access. An example of this use case is Android where the hardware composer is the only master and has mode setting access. Every other client then uses render node(e.g /dev/dri/renderD128 to allocate and use its buffers. Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-04-03drm/omap: decrease min width & heightTomi Valkeinen1-2/+2
mode_config's min_width and min_height are both set to 32, which is overly restrictive. The real limits depend on whether we're configuring a crtc or a plane, but a limit of 8x2 is safe for both cases. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-02-26Merge airlied/drm-next into drm-misc-nextDaniel Vetter1-2/+15
Backmerge the main pull request to sync up with all the newly landed drivers. Otherwise we'll have chaos even before 4.12 started in earnest. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2017-02-16drm/omapdrm: Move commit_modeset_enables() before commit_planes()Jyri Sarha1-1/+15
Move drm_atomic_helper_commit_modeset_enables() call to before drm_atomic_helper_commit_planes() call and have a omap_atomic_wait_for_completion() call after both. With the current dss dispc implementation we have to enable the new modeset before we can commit planes. The dispc ovl configuration relies on the video mode configuration been written into the HW when the ovl configuration is calculated. This approach is not ideal because after a mode change the plane update is executed only after the first vblank interrupt. The dispc implementation should be fixed so that it is able use uncommitted drm state information. information. Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-02-16Revert "drm: omapdrm: Let the DRM core skip plane commit on inactive CRTCs"Jyri Sarha1-2/+1
This reverts commit dadf4659d0608e034b6633f30300c2eff2dafb4c. If planes are not disabled when the they are not on any crtc anymore they will remain active and may show as "ghosts" when the crtc they were last on is active again. Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-02-08drm/omap: use vblank hooks in struct drm_crtc_funcsTomi Valkeinen1-2/+0
The vblank hooks in struct drm_driver are deprecated and only meant for legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks in struct drm_crtc_funcs should be used instead. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-02-07drm: remove drm_vblank_no_hw_counter assignment from driver codeShawn Guo1-1/+0
Core code already makes drm_driver.get_vblank_counter hook optional by letting drm_vblank_no_hw_counter be the default implementation for the function hook. So the drm_vblank_no_hw_counter assignment in the driver code becomes redundant and can be removed now. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: Alexey Brodkin <abrodkin@synopsys.com> Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: Mali DP Maintainers <malidp@foss.arm.com> Cc: Russell King <linux@armlinux.org.uk> Cc: Boris Brezillon <boris.brezillon@free-electrons.com> Cc: Inki Dae <inki.dae@samsung.com> Cc: Stefan Agner <stefan@agner.ch> Cc: Xinliang Liu <z.liuxinliang@hisilicon.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: CK Hu <ck.hu@mediatek.com> Cc: Neil Armstrong <narmstrong@baylibre.com> Cc: Rob Clark <robdclark@gmail.com> Cc: Marek Vasut <marex@denx.de> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Mark Yao <mark.yao@rock-chips.com> Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Jyri Sarha <jsarha@ti.com> Cc: Eric Anholt <eric@anholt.net> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Alexey Brodkin <abrodkin@synopsys.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1486458995-31018-3-git-send-email-shawnguo@kernel.org
2017-02-01Merge tag 'drm-misc-next-2017-01-30' of ↵Dave Airlie1-1/+0
git://anongit.freedesktop.org/git/drm-misc into drm-next Another round of -misc stuff: - Noralf debugfs cleanup cleanup (not yet everything, some more driver patches awaiting acks). - More doc work. - edid/infoframe fixes from Ville. - misc 1-patch fixes all over, as usual Noralf needs this for his tinydrm pull request. * tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc: (48 commits) drm/vc4: Remove vc4_debugfs_cleanup() dma/fence: Export enable-signaling tracepoint for emission by drivers drm/tilcdc: Remove tilcdc_debugfs_cleanup() drm/tegra: Remove tegra_debugfs_cleanup() drm/sti: Remove drm_debugfs_remove_files() calls drm/radeon: Remove drm_debugfs_remove_files() call drm/omap: Remove omap_debugfs_cleanup() drm/hdlcd: Remove hdlcd_debugfs_cleanup() drm/etnaviv: Remove etnaviv_debugfs_cleanup() drm/etnaviv: allow build with COMPILE_TEST drm/amd/amdgpu: Remove drm_debugfs_remove_files() call drm/prime: Clarify DMA-BUF/GEM Object lifetime drm/ttm: Make sure BOs being swapped out are cacheable drm/atomic: Remove drm_atomic_debugfs_cleanup() drm: drm_minor_register(): Clean up debugfs on failure drm: debugfs: Remove all files automatically on cleanup drm/fourcc: add vivante tiled layout format modifiers drm/edid: Set YQ bits in the AVI infoframe according to CEA-861-F drm/edid: Set AVI infoframe Q even when QS=0 drm/edid: Introduce drm_hdmi_avi_infoframe_quant_range() ...
2017-01-27drm/omap: Remove omap_debugfs_cleanup()Noralf Trønnes1-1/+0
drm_debugfs_cleanup() now removes all minor->debugfs_list entries automatically, so the drm_driver.debugfs_cleanup callback is not needed. Cc: tomi.valkeinen@ti.com Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170126225621.12314-12-noralf@tronnes.org
2017-01-09drm: Change the return type of the unload hook to voidGabriel Krisman Bertazi1-3/+1
The integer returned by the unload hook is ignored by the drm core, so let's make it void. This patch was created using the following Coccinelle semantic script (except for the declaration and comment in drm_drv.h): Compile-tested only. // <smpl> @ get_name @ struct drm_driver drv; identifier fn; @@ drv.unload = fn; @ replace_type @ identifier get_name.fn; @@ - int + void fn (...) { ... } @ remove_return_param @ identifier get_name.fn; @@ void fn (...) { <... if (...) return - ... ; ...> } @ drop_final_return @ identifier get_name.fn; @@ void fn (...) { ... - return 0; } // </smpl> Suggested-by: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Acked-by: Christian König <christian.koenig@amd.com>. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170106175731.29196-1-krisman@collabora.co.uk
2016-12-19drm: omapdrm: Perform initialization/cleanup at probe/remove timeLaurent Pinchart1-106/+105
The drm driver .load() operation is prone to race conditions as it initializes the driver after registering the device nodes. Its usage is deprecated, inline it in the probe function and call drm_dev_alloc() and drm_dev_register() explicitly. For consistency inline the .unload() handler in the remove function as well. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-12-19drm: omapdrm: Let the DRM core skip plane commit on inactive CRTCsLaurent Pinchart1-1/+2
The DRM core supports skipping plane update for inactive CRTCs for hardware that don't need it or can't cope with it. That's our case, and the driver already skips flushing planes on inactice CRTCs. We can't remove the check from the driver, as active CRTCs are disabled at the hardware level when an atomic flush is performed if a mode set is pending. There's however no need to forward the plane commit calls to the driver, so use the DRM core infrastructure to skip them with a detailed comment to explain why the check must still be kept in the driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-12-19drm: omapdrm: Handle FIFO underflow IRQs internallyLaurent Pinchart1-2/+2
As the FIFO underflow IRQ handler just prints an error message to the kernel log, simplify the code by not registering one IRQ handler per plane but print the messages directly from the main IRQ handler. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-12-08drm/omap: fix primary-plane's possible_crtcsTomi Valkeinen1-5/+12
We set the possible_crtc for all planes to "(1 << priv->num_crtcs) - 1", which is fine as the HW planes can be used fro all crtcs. However, when we're doing that, we are still incrementing 'num_crtcs', and we'll end up with bad possible_crtcs, preventing the use of the primary planes. This patch passes a possible_crtcs mask to plane init function so that we get correct possible_crtc. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-10-21drm/omap: Use per-plane rotation propertyVille Syrjälä1-27/+25
The global mode_config.rotation_property is going away, switch over to per-plane rotation_property. Not sure I got the annoying crtc rotation_property handling right. Might work, or migth not. v2: Drop the BIT() Don't create rotation property twice for each primary plane Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Rob Clark <robdclark@gmail.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com> [danvet: Add comment per discussion between Tomi&Ville.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1474907460-10717-8-git-send-email-ville.syrjala@linux.intel.com