aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/host1x
AgeCommit message (Collapse)AuthorFilesLines
2013-10-31drm/tegra: Introduce tegra_drm_client structureThierry Reding5-83/+94
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 <[email protected]>
2013-10-31gpu: host1x: Make host1x header file publicThierry Reding4-35/+5
In preparation to support host1x clients other than DRM, move this header into a public location. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31drm/tegra: gem: Miscellaneous cleanupsThierry Reding1-11/+10
Rename the host1x_to_drm_bo() macro to host1x_to_tegra_bo() for consistency and fixup various stylistic issues. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31drm/tegra: Rename gr2d to tegra-gr2dThierry Reding1-1/+1
Other drivers use the tegra- prefix in their names, so add it to this driver's name as well for consistency. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31drm/tegra: gr2d: Miscellaneous cleanupsThierry Reding1-51/+49
Rework the address table code for the host1x firewall. The previous implementation allocated a bitfield but didn't check for a valid pointer so it could potentially crash. Instead, embed a static bitmap within the gr2d structure to avoid the allocation and use the Linux bitmap API to reduce code complexity. Don't annotate the driver's .remove() function __exit. Even if built in the driver can be unloaded via sysfs, so .remove() needs to stick around after initialization. Also remove the explicit initialization of the driver's .owner field to THIS_MODULE because that's now handled by the driver core. Furthermore make an error message more consistent with other subdrivers, index the syncpts array for better readability, remove a gratuituous newline and reorder some variable declarations to make the code easier to read. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31gpu: host1x: firewall: Refactor register checkThierry Reding1-26/+31
The same code sequence is used in various places to validate a register access in the command stream. This can be refactored into a separate function. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31gpu: host1x: firewall: Rename cmdbuf_id -> cmdbufThierry Reding1-5/+5
The value stored in this field is a pointer to a command buffer, not an ID. Avoid some confusion by reflecting that in the field's name. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31gpu: host1x: Fix alignment of function argumentsThierry Reding1-1/+1
Arguments on subsequent lines should be aligned with the first argument. This one occurrence went unnoticed during code review. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31gpu: host1x: Do not discard .remove()Thierry Reding1-4/+3
The device can be unbound from the driver via sysfs, so regardless of whether the driver is builtin or a module, its .remove() function needs to stick around. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31gpu: host1x: Cleanup includesThierry Reding9-51/+2
Most of the included files are either not required or already included by some other header file. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31drm/tegra: Rename host1x_drm_context to tegra_drm_contextThierry Reding3-20/+28
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 <[email protected]>
2013-10-31drm/tegra: Rename host1x_drm_file to tegra_drm_fileThierry Reding2-15/+15
This structure extends drm_file with Tegra DRM specific fields and has nothing to do with host1x. Rename the structure to more clearly mark the boundaries between host1x and Tegra DRM. While at it, move the structure definition out of the header. It's never used outside of the drm.c source file, so it can be defined within that. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31drm/tegra: Rename host1x_drm structure to tegra_drmThierry Reding8-116/+115
The host1x and Tegra DRM drivers are currently tightly coupled. Renaming the structure marks the boundary more clearly. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31drm/tegra: Cleanup tegra_dc structureThierry Reding1-4/+1
Remove the unused host1x field from the structure and group the fields more logically. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31drm/tegra: Remove unused fieldsThierry Reding1-4/+0
Some of the fields in struct host1x_drm haven't been used for a while, so remove them. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31gpu: host1x: Remove unused MakefileThierry Reding1-6/+0
Signed-off-by: Thierry Reding <[email protected]>
2013-10-31gpu: host1x: check relocs after all gathers are consumedErik Faye-Lund1-4/+4
The num_relocs count are passed to the kernel per job, not per gather. For multi-gather jobs, we would previously fail if there were relocs in other gathers aside from the first one. Fix this by simply moving the check until all gathers have been consumed. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Arto Merilainen <[email protected]> Acked-By: Terje Bergstrom <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-10-09drm: Make irq_enabled boolVille Syrjälä1-1/+1
irq_enabled is only ever 0 or 1, so make it a bool. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-09-05Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds9-57/+31
Pull drm tree changes from Dave Airlie: "This is the main drm pull request, I have some overlap with sound and arm-soc, the sound patch is acked and may conflict based on -next reports but should be a trivial fixup, which I'll leave to you! Highlights: - new drivers: MSM driver from Rob Clark - non-drm: switcheroo and hdmi audio driver support for secondary GPU poweroff, so drivers can use runtime PM to poweroff the GPUs. This can save 5 or 6W on some optimus laptops. - drm core: combined GEM and TTM VMA manager per-filp mmap permission tracking initial rendernode support (via a runtime enable for now, until we get api stable), remove old proc support, lots of cleanups of legacy code hdmi vendor infoframes and 4k modes lots of gem/prime locking and races fixes async pageflip scaffolding drm bridge objects - i915: Haswell PC8+ support and eLLC support, HDMI 4K support, initial per-process VMA pieces, watermark reworks, convert to generic hdmi infoframes, encoder reworking, fastboot support, - radeon: CIK PM support, remove 3d blit code in favour of DMA engines, Berlin GPU support, HDMI audio fixes - nouveau: secondary GPU power down support for optimus laptops, lots of fixes, use MSI, VP3 engine support - exynos: runtime pm support for g2d, DT support, remove non-DT, - tda998x i2c driver: lots of fixes for sync issues - gma500: lots of cleanups - rcar: add LVDS support, fbdev emulation, - tegra: just minor fixes" * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (684 commits) drm/exynos: Fix build error with exynos_drm_connector.c drm/exynos: Remove non-DT support in exynos_drm_fimd drm/exynos: Remove non-DT support in exynos_hdmi drm/exynos: Remove non-DT support in exynos_drm_g2d drm/exynos: Remove non-DT support in exynos_hdmiphy drm/exynos: Remove non-DT support in exynos_ddc drm/exynos: Make Exynos DRM drivers depend on OF drm/exynos: Consider fallback option to allocation fail drm/exynos: fimd: move platform data parsing to separate function drm/exynos: fimd: get signal polarities from device tree drm/exynos: fimd: replace struct fb_videomode with videomode drm/exynos: check a pixel format to a particular window layer drm/exynos: fix fimd pixel format setting drm/exynos: Add NULL pointer check drm/exynos: Remove redundant error messages drm/exynos: Add missing of.h header include drm/exynos: Remove redundant NULL check in exynos_drm_buf drm/exynos: add device tree support for rotator drm/exynos: Add missing includes drm/exynos: add runtime pm interfaces to g2d driver ...
2013-09-04Merge tag 'drm/for-3.12-rc1' of git://anongit.freedesktop.org/tegra/linux ↵Dave Airlie5-17/+23
into drm-next drm/tegra: Changes for v3.12-rc1 Only a couple of small patches this time around. These are mostly fixes for minor bugs that showed up, but there is also some preparatory work that will come in handy for future patches. * tag 'drm/for-3.12-rc1' of git://anongit.freedesktop.org/tegra/linux: drm/tegra: Parse device tree earlier gpu: host1x: Sort drivers by probe order gpu: host1x: Check for valid host1x pointer gpu: host1x: returning success instead of -ENOMEM gpu: host1x: fix an integer overflow check drm/tegra: hdmi: Make sure clock is enabled before dumping registers
2013-09-03drm/tegra: Parse device tree earlierThierry Reding1-7/+7
Parsing the device tree may cause probing to be deferred. Doing this as early as possible prevents any other resources from being requested and enabled, therefore reducing the need to cleanup on deferred probe while at the same time not wasting precious CPU cycles determining if probing needs to be deferred or not. Signed-off-by: Thierry Reding <[email protected]>
2013-09-03gpu: host1x: Sort drivers by probe orderThierry Reding1-1/+1
External driver declarations are sorted by probe order for consistency. Signed-off-by: Thierry Reding <[email protected]>
2013-09-03gpu: host1x: Check for valid host1x pointerThierry Reding1-1/+1
Under rare circumstances it can happen that the host1x driver's .probe() doesn't finish properly, in which case the device's driver-specific data will not be set. Instead of crashing in such a situation, propagate the error to callers of the host1x_get_drm_data() function. Signed-off-by: Thierry Reding <[email protected]>
2013-09-02drm/tegra: fix up page flip flags.Dave Airlie1-1/+1
This was one level away from where I'd grepped. Signed-off-by: Dave Airlie <[email protected]>
2013-08-30video/hdmi: Use hdmi_vendor_infoframe for the HDMI specific infoframeLespiau, Damien1-3/+3
We just got rid of the version of hdmi_vendor_infoframe that had a byte array for anyone to poke at. It's now time to shuffle around the naming of hdmi_hdmi_infoframe to make hdmi_vendor_infoframe become the HDMI vendor specific structure. Cc: Thierry Reding <[email protected]> Signed-off-by: Damien Lespiau <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-08-30gpu: host1x: Port the HDMI vendor infoframe code the common helpersLespiau, Damien1-20/+4
I just wrote the bits to define and pack HDMI vendor specific infoframe. Port the host1x driver to use those so I can refactor the infoframe code a bit more. This changes the length of the infoframe payload from 6 to 5, which is enough for the "frame packing" stereo format. v2: Pimp up the commit message with the note about the length (Ville Syrjälä) Cc: Thierry Reding <[email protected]> Cc: Terje Bergström <[email protected]> Cc: [email protected] Signed-off-by: Damien Lespiau <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-08-27gpu: host1x: returning success instead of -ENOMEMDan Carpenter1-2/+1
There is a mistake here so it returns PTR_ERR(NULL) which is success instead of -ENOMEM. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-08-27gpu: host1x: fix an integer overflow checkDan Carpenter1-6/+6
Tegra is a 32 bit arch. On 32 bit systems then size_t is 32 bits so "total" will never be higher than UINT_MAX because of integer overflows. We need cast to u64 first before doing the math. Also the addition earlier: unsigned int num_unpins = num_cmdbufs + num_relocs; That can overflow as well, but I think it's still safe because we check both "num_cmdbufs" and "num_relocs" again in this test. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-08-27drm/tegra: hdmi: Make sure clock is enabled before dumping registersMikko Perttunen1-0/+7
The debugfs register dumping function did not enable the HDMI clock. This led to a possible system hang when reading the debugfs entry while no HDMI cable was connected to the system. This patch makes sure that the clock is enabled during the read. Signed-off-by: Mikko Perttunen <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-08-23i2c: move OF helpers into the coreWolfram Sang1-1/+1
I2C of helpers used to live in of_i2c.c but experience (from SPI) shows that it is much cleaner to have this in the core. This also removes a circular dependency between the helpers and the core, and so we can finally register child nodes in the core instead of doing this manually in each driver. So, fix the drivers and documentation, too. Signed-off-by: Wolfram Sang <[email protected]>
2013-08-19drm/host1x: stop casting VMA offsets to 32bitDavid Herrmann3-8/+2
VMA offsets are 64bit so do not cast them to "unsigned int". Also remove the (now useless) offset-retrieval helper. The VMA manager provides simple enough helpers. Cc: Thierry Reding <[email protected]> Cc: "Terje Bergström" <[email protected]> Cc: Arto Merilainen <[email protected]> Signed-off-by: David Herrmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-08-19drm: remove FASYNC supportDaniel Vetter1-1/+0
So I've stumbled over drm_fasync and wondered what it does. Digging that up is quite a story. First I've had to read up on what this does and ended up being rather bewildered why peopled loved signals so much back in the days that they've created SIGIO just for that ... Then I wondered how this ever works, and what that strange "No-op." comment right above it should mean. After all calling the core fasync helper is pretty obviously not a noop. After reading through the kernels FASYNC implementation I've noticed that signals are only sent out to the processes attached with FASYNC by calling kill_fasync. No merged drm driver has ever done that. After more digging I've found out that the only driver that ever used this is the so called GAMMA driver. I've frankly never heard of such a gpu brand ever before. Now FASYNC seems to not have been the only bad thing with that driver, since Dave Airlie removed it from the drm driver with prejudice: commit 1430163b4bbf7b00367ea1066c1c5fe85dbeefed Author: Dave Airlie <[email protected]> Date: Sun Aug 29 12:04:35 2004 +0000 Drop GAMMA DRM from a great height ... Long story short, the drm fasync support seems to be doing absolutely nothing. And the only user of it was never merged into the upstream kernel. And we don't need any fops->fasync callback since the fcntl implementation in the kernel already implements the noop case correctly. So stop this particular cargo-cult and rip it all out. v2: Kill drm_fasync assignments in rcar (newly added) and imx drivers (somehow I've missed that one in staging). Also drop the reference in the drm DocBook. ARM compile-fail reported by Rob Clark. v3: Move the removal of dev->buf_asnyc assignment in drm_setup to this patch here. v4: Actually git add ... tsk. Cc: Dave Airlie <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: Rob Clark <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Reviewed-by: David Herrmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-08-07drm: const'ify ioctls table (v2)Rob Clark1-1/+1
Because, there is no reason for it not to be const. v1: original v2: fix compile break in vmwgfx, and couple related cleanups suggested by Ville Syrjälä Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-08-07drm/gem: create drm_gem_dumb_destroyDaniel Vetter3-9/+1
All the gem based kms drivers really want the same function to destroy a dumb framebuffer backing storage object. So give it to them and roll it out in all drivers. This still leaves the option open for kms drivers which don't use GEM for backing storage, but it does decently simplify matters for gem drivers. Acked-by: Inki Dae <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Cc: Intel Graphics Development <[email protected]> Cc: Ben Skeggs <[email protected]> Reviwed-by: Rob Clark <[email protected]> Cc: Alex Deucher <[email protected]> Acked-by: Patrik Jakobsson <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-07-25drm/gem: convert to new unified vma managerDavid Herrmann1-3/+2
Use the new vma manager instead of the old hashtable. Also convert all drivers to use the new convenience helpers. This drops all the (map_list.hash.key << PAGE_SHIFT) non-sense. Locking and access-management is exactly the same as before with an additional lock inside of the vma-manager, which strictly wouldn't be needed for gem. v2: - rebase on drm-next - init nodes via drm_vma_node_reset() in drm_gem.c v3: - fix tegra v4: - remove duplicate if (drm_vma_node_has_offset()) checks - inline now trivial drm_vma_node_offset_addr() calls v5: - skip node-reset on gem-init due to kzalloc() - do not allow mapping gem-objects with offsets (backwards compat) - remove unneccessary casts Cc: Inki Dae <[email protected]> Cc: Rob Clark <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Thierry Reding <[email protected]> Signed-off-by: David Herrmann <[email protected]> Acked-by: Patrik Jakobsson <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-06-22gpu: host1x: Rework CPU syncpoint incrementArto Merilainen6-32/+15
This patch merges host1x_syncpt_cpu_incr to host1x_syncpt_incr() as they are in practise doing the same thing. host1x_syncpt_incr() is also modified to return error codes. User space interface is modified accordingly to pass return values. Signed-off-by: Arto Merilainen <[email protected]> Acked-By: Terje Bergstrom <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-06-22gpu: host1x: Fix client_managed typeArto Merilainen3-8/+8
client_managed field in syncpoint structure was defined as an integer. The field holds, however, only a boolean value. This patch modifies the type to boolean. Signed-off-by: Arto Merilainen <[email protected]> Acked-By: Terje Bergstrom <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-06-22gpu: host1x: Fix memory access in syncpt requestArto Merilainen1-1/+2
This patch fixes a bad memory access in syncpoint request code. If no syncpoints were available, the code accessed unreserved memory area causing unexpected behaviour. Signed-off-by: Arto Merilainen <[email protected]> Acked-By: Terje Bergstrom <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-06-22gpu: host1x: Copy gathers before verificationArto Merilainen1-31/+20
The firewall verified gather buffers before copying them. This allowed a malicious application to rewrite the buffer content by timing the rewrite carefully. This patch makes the buffer validation occur after copying the buffers. Signed-off-by: Arto Merilainen <[email protected]> Signed-off-by: Terje Bergstrom <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-06-22gpu: host1x: Don't reset firewall between gathersTerje Bergstrom1-38/+34
The firewall was reinitialised for each gather. Because the filter was reinitialised, it did not track the class over gather boundaries. This allowed the user application to set host1x class to one class in one gather and use that class in another gather without firewall having knowledge about that. Signed-off-by: Terje Bergstrom <[email protected]> Signed-off-by: Arto Merilainen <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-06-22gpu: host1x: Check reloc table before usageArto Merilainen1-13/+13
The firewall assumed that the user space always delivers a relocation table when it is accessing address registers. If userspace did not deliver a relocation table and tried to access the address registers, the code performed bad memory accesses. This patch modifies the firewall to check correctly that the firewall table is available before accessing it. In addition, check_reloc() is converted to use boolean return value (true when the reloc is valid, false when invalid). Signed-off-by: Arto Merilainen <[email protected]> Acked-By: Terje Bergstrom <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-06-22gpu: host1x: Check INCR opcode correctlyTerje Bergstrom1-1/+1
The firewall code used a wrong loop condition (pointer to a structure) while checking INCR opcode. This patch fixes the code to use correct loop condition (number of words remaining). Signed-off-by: Terje Bergstrom <[email protected]> Signed-off-by: Arto Merilainen <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-06-22drm/tegra: Remove DRIVER_BUS_PLATFORM from driver_featuresLaurent Pinchart1-1/+1
DRIVER_BUS_PLATFORM is not a DRM driver feature flag, it must not be set in the driver's driver_features field. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-06-22drm/tegra: Fix return valueThierry Reding1-1/+1
Return NULL instead of 0 in host1x_bo_lookup(). Signed-off-by: Thierry Reding <[email protected]>
2013-05-25drm/tegra: fix error return code in gr2d_submit()Wei Yongjun1-2/+6
Fix to return -ENOENT in the host1x_bo lookup error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-05-25drm/tegra: fix missing unlock on errorWei Yongjun1-0/+2
Add the missing unlock before return from function host1x_drm_init() and host1x_drm_exit() in the error handling case. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-05-25drm/tegra: Honor pixel-format changesThierry Reding1-0/+2
When using a base mode-set, honor changes in pixel-format since the core doesn't explicitly check for them as long as they use the same depth. Signed-off-by: Thierry Reding <[email protected]>
2013-05-25drm/tegra: Explicitly set irq_enabledThierry Reding1-0/+7
Since the Tegra DRM driver doesn't use the drm_irq_install() helper, the irq_enabled flag needs to be set manually in order to make functionality such as the DRM_IOCTL_WAIT_VBLANK work properly. Signed-off-by: Thierry Reding <[email protected]>
2013-05-25drm/tegra: Don't disable unused planesThierry Reding1-0/+3
When a plane isn't in use it isn't attached to a CRTC and therefore the DC registers aren't available for programming. Signed-off-by: Thierry Reding <[email protected]>
2013-05-18drivers/gpu/host1x/drm: don't check resource with devm_ioremap_resourceWolfram Sang1-5/+0
devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver. Signed-off-by: Wolfram Sang <[email protected]>