- Jan 27, 2015
-
-
Thierry Reding authored
For now only disable the KMS hotplug polling helper logic upon suspend and re-enable it on resume. Reviewed-by:
Sean Paul <seanpaul@chromium.org> Reviewed-by:
Mark Zhang <markz@nvidia.com> Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
Provide a custom ->atomic_commit() implementation which supports async commits. The generic atomic page-flip helper can use this to implement page-flipping. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
Switch out the regular plane helpers for the atomic plane helpers. Also use the default atomic helpers to implement the ->atomic_check() and ->atomic_commit() callbacks. The driver now exclusively uses the atomic interfaces. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
Hook up the default ->reset() and ->atomic_duplicate_state() helpers. This ensures that state objects are properly created and framebuffer reference counts correctly maintained. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
Implement initial atomic state handling. Hook up the CRTCs, planes' and connectors' ->atomic_destroy_state() callback to ensure that the atomic state objects don't leak. Furthermore the CRTC now implements the ->mode_set_nofb() callback that is used by new helpers to implement ->mode_set() and ->mode_set_base(). These new helpers also make use of the new plane helper functions which the driver now provides. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
This structure will be extended using non-framebuffer related callbacks in subsequent patches, so it should move to a more central location. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Dan Carpenter authored
iommu_domain_alloc() returns NULL on error, it never returns error pointers. Signed-off-by:
Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
Previously the struct bus_type exported by the host1x infrastructure was only a very basic skeleton. Turn that implementation into a more full- fledged bus to support proper probe ordering and power management. Note that the bus infrastructure needs to be available before any of the drivers can be registered. This is automatically ensured if all drivers are built as loadable modules (via symbol dependencies). If all drivers are built-in there are no such guarantees and the link order determines the initcall ordering. Adjust drivers/gpu/Makefile to make sure that the host1x bus infrastructure is initialized prior to any of its users (only drm/tegra currently). v2: Fix building host1x and tegra-drm as modules Reported-by:
Dave Airlie <airlied@gmail.com> Reviewed-by:
Sean Paul <seanpaul@chromium.org> Reviewed-by:
Mark Zhang <markz@nvidia.com> Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
- Dec 17, 2014
-
-
Thierry Reding authored
The hardware pipe numbers don't always match the DRM CRTC indices. This can happen for example if the first display controller defers probe, causing it to be registered with DRM after the second display controller. When that happens the hardware pipe numbers and DRM CRTC indices become different. Make sure that the CRTC index is always used when accessing per-CRTC VBLANK data. This can be ensured by using the drm_crtc_vblank_*() API, which will do the right thing automatically given a struct drm_crtc *. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
- Nov 13, 2014
-
-
Thierry Reding authored
Free the DRM device-private memory upon driver unload to make sure the memory doesn't leak. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
When an IOMMU device is available on the platform bus, allocate an IOMMU domain and attach the display controllers to it. The display controllers can then scan out non-contiguous buffers by mapping them through the IOMMU. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
The DRM driver's ->load() implementation didn't do a good job (no job at all really) cleaning up on failure. Fix that by undoing any prior setup when an error occurs. This requires a bit of rework to make it possible to clean up fbdev midway. This was tested by injecting errors at various points during the initialization sequence and verifying that error cleanup didn't crash and no memory leaked (using kmemleak). Reported-by:
Stéphane Marchesin <marcheu@chromium.org> Reported-by:
Sean Paul <seanpaul@chromium.org> Reviewed-by:
Sean Paul <seanpaul@chromium.org> Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
- Aug 04, 2014
-
-
Thierry Reding authored
Job submission currently relies on the fact that struct drm_tegra_reloc and struct host1x_reloc are the same size and uses a simple call to the copy_from_user() function to copy them to kernel space. This causes the handle to be stored in the buffer object field, which then needs a cast to a 32 bit integer to resolve it to a proper buffer object pointer and store it back in the buffer object field. On 64-bit architectures that will no longer work, since pointers are 64 bits wide whereas handles will remain 32 bits. This causes the sizes of both structures to because different and copying will no longer work. Fix this by adding a new function, host1x_reloc_get_user(), that copies the structures field by field. While at it, use substructures for the command and target buffers in struct host1x_reloc for better readability. Also use unsized types to make it more obvious that this isn't part of userspace ABI. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
This matches what other drivers do for equivalent IOCTLs. Reviewed-by:
Stéphane Marchesin <marcheu@chromium.org> Tested-by:
Alexandre Courbot <acourbot@nvidia.com> Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
The DRM_TEGRA_GEM_SET_FLAGS IOCTL can be used to set the flags of a buffer object after it has been allocated or imported. Flags associated with a buffer object can be queried using the DRM_TEGRA_GEM_GET_FLAGS IOCTL. Reviewed-by:
Stéphane Marchesin <marcheu@chromium.org> Tested-by:
Alexandre Courbot <acourbot@nvidia.com> Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
Currently the tiling parameters of buffer objects can only be set at allocation time, and only a single tiled mode is supported. This new DRM_TEGRA_GEM_SET_TILING IOCTL allows more modes to be set and also allows the tiling mode to be changed after the allocation. This will enable the Tegra DRM driver to import buffers from a GPU and directly scan them out by configuring the display controller appropriately. To complement this, the DRM_TEGRA_GEM_GET_TILING IOCTL can query the current tiling mode of a buffer object. This is necessary when importing buffers via handle (as is done in Mesa for example) so that userspace can determine the proper parameters for the 2D or 3D engines. Reviewed-by:
Stéphane Marchesin <marcheu@chromium.org> Tested-by:
Alexandre Courbot <acourbot@nvidia.com> Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
- Jul 08, 2014
-
-
Thierry Reding authored
A race condition currently exists on Tegra, where it can happen that a monitor attached via HDMI isn't detected during the initial FB helper setup, but the hotplug event happens too early to be processed by the poll helpers because they haven't been initialized yet. This happens because on some boards the HDMI driver can control the regulator that supplies the +5V pin on the HDMI connector. Therefore depending on the timing between the initialization of the HDMI driver and the rest of DRM, it's possible that the monitor returns the hotplug signal right within the window where we would miss it. Unfortunately, drm_kms_helper_poll_init() will wreak havoc when called before at least some parts of the FB helpers have been set up. This commit fixes this by splitting out the minimum of initialization required to make drm_kms_helper_poll_init() work into a separate function that can be called early. It is then safe to move all of the poll helper initialization to an earlier point in time (before the HDMI output driver has a chance to enable the +5V supply). That way if the hotplug signal is returned before the initial FB helper setup, the monitor will be forcefully detected at that point, and if the hotplug signal is returned after that it will be properly handled by the poll helpers. Signed-off-by:
Thierry Reding <treding@nvidia.com> Signed-off-by:
Dave Airlie <airlied@redhat.com>
-
- Jun 05, 2014
-
-
Thierry Reding authored
The DRM core can now cope with drivers that don't have an associated struct drm_bus, so the host1x implementation is no longer useful. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
Tegra124 is mostly backwards-compatible with Tegra114. However, Tegra124 supports a few more features (e.g. interlacing, ...). Introduce a new compatible string and TMDS tables to cope with these differences. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
- Apr 04, 2014
-
-
Thierry Reding authored
Add support for eDP functionality found on Tegra124 and later SoCs. Only fast link training is currently supported. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
- Feb 12, 2014
-
-
Paul Bolle authored
Signed-off-by:
Paul Bolle <pebolle@tiscali.nl> Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
- Dec 20, 2013
-
-
Thierry Reding authored
Implement very basic PRIME support. This currently only works with buffers that are contiguous in memory and will refuse to import any physically non-contiguous buffers. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
Tegra124 and later support interlacing, but the driver doesn't support it yet. Make sure interlacing stays disabled on hardware that supports it. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
A lot of the modern userspace is capable of working without the legacy fbdev support. kmscon can be used as a replacement for the framebuffer console, and KMS X drivers create their own framebuffers. Most people don't have a system where all of this works yet, though, so leave support enabled by default. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
This commit adds support for both DSI outputs found on Tegra. Only very minimal functionality is implemented, so advanced features like ganged mode won't work. Due to the lack of other test hardware, some sections of the driver are hardcoded to work with Dalmore. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
- Dec 03, 2013
-
-
Dan Carpenter authored
copy_from_user() returns the number of bytes remaining if it fails, but we want to return -EFAULT here. Signed-off-by:
Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
There is no need to access it from other files now that the driver has been decoupled from host1x. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
sparse complains because __user annotations aren't placed consistently. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
- Oct 31, 2013
-
-
Arto Merilainen authored
This patch adds a separate ioctl for delivering syncpoint base number to user space. If the syncpoint does not have an associated base, the function returns -ENXIO. Signed-off-by:
Arto Merilainen <amerilainen@nvidia.com> Reviewed-by:
Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
The gr2d and gr3d engines work more efficiently on buffers with a tiled memory layout. Allow created buffers to be marked as tiled so that the display controller can scan them out properly. Signed-off-by:
Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
Initialize and power the 3D unit on Tegra20, Tegra30 and Tegra114 and register a channel with the Tegra DRM driver so that the unit can be used from userspace. Signed-off-by:
Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
Command stream submissions are the same across all devices that expose a channel to userspace, so move the code into a generic function. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Mikko Perttunen authored
Tegra114 TMDS configuration requires a new peak_current field and the driver current override bit has changed position. Signed-off-by:
Mikko Perttunen <mperttunen@nvidia.com> Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
When the DRM driver is unloaded, all the associated resources must be cleaned up and zeroed out. This is necessary because of the architecture of the Tegra DRM driver, where not all subdrivers are unloaded along with the DRM driver. Therefore device-managed managed won't be freed and memory cannot be assumed to have been cleared (because it hasn't been reallocated using kzalloc()) by the time the DRM driver is reloaded. It is therefore necessary to zero out the structures to prevent strange errors (such as slab corruptions) from occurring. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
In order to make subsystem-wide changes easier, move the Tegra DRM driver back into the DRM tree. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
The Tegra DRM driver currently uses some infrastructure to defer the DRM core initialization until all required devices have registered. The same infrastructure can potentially be used by any other driver that requires more than a single sub-device of the host1x module. Make the infrastructure more generic and keep only the DRM specific code in the DRM part of the driver. Eventually this will make it easy to move the DRM driver part back to the DRM subsystem. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
Expose the buffer objects, syncpoint and channel functionality in the public public header so that drivers can use them. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
This structure derives from host1x_client. DRM-specific fields are moved from host1x_client to this structure, so that host1x_client can remain agnostic of DRM. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
Most of the included files are either not required or already included by some other header file. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
Thierry Reding authored
The structure represents a context associated with a particular process that has opened the Tegra DRM device and requested a channel. This is a very DRM-specific notion and has nothing to do with host1x. Rename the structure to more clearly mark the boundaries between the two. Signed-off-by:
Thierry Reding <treding@nvidia.com>
-