summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm2/radeon
Commit message (Collapse)AuthorAgeFilesLines
* MFC: r317591nyan2017-05-071-0/+17
| | | | | | | | Add TUNABLE_INT to radeonkms driver parameters. They are required by PowerMac G5 DP. PR: 217852 Submitted by: Hiroo Ono
* MFC r302571,r302572,r302577,r302841:ngie2016-08-031-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Approved by: re (gjb) r302571: Remove redundant declaration for radeon_pm_acpi_event_handler(..) to fix -Wredundant-decls warning PR: 209924 Tested with: devel/amd64-gcc (5.3.0) r302572: Remove redundant declarations for intel_fbc_enabled(..) and i915_gem_dump_object(..) to fix -Wredundant-decls warning PR: 209924 Tested with: devel/amd64-gcc (5.3.0) r302577: Add missing default case to capable(..) function definition By definition (enum __drm_capabilities), cases other than CAP_SYS_ADMIN aren't possible. Add in a KASSERT safety belt and return false in !INVARIANTS case if an invalid value is passed in, as it would be a programmer error. This fixes a -Wreturn-type error with gcc 5.3.0. r302841: Always panic if an invalid capability is passed to `capable(..)` instead of just with INVARIANTS rwatson's point was valid in the sense that if the data passed at runtime is invalid, it should always trip the invariant, not just in the debug case. This is a deterrent against malicious input, or input caused by hardware errors. Requested by: rwatson
* Don't repeat the the word 'the'eadler2016-05-175-6/+6
| | | | | | | (one manual change to fix grammar) Confirmed With: db Approved by: secteam (not really, but this is a comment typo fix)
* sys/dev: minor spelling fixes.pfg2016-05-038-18/+18
| | | | Most affect comments, very few have user-visible effects.
* etc: minor spelling fixes.pfg2016-05-021-1/+1
| | | | | | Mostly comments but also some user-visible strings. MFC after: 2 weeks
* Cleanup unnecessary semicolons from the kernel.pfg2016-04-101-1/+1
| | | | Found with devel/coccinelle.
* radeon_suspend_kms: don't mess with pci state that's managed by the busavg2015-09-111-8/+0
| | | | | | | | | | | | | | The pci bus driver handles the power state, it also manages configuration state saving and restoring for its child devices. Thus a PCI device driver does not have to worry about those things. In fact, I observe a hard system hang when trying to suspend a system with active radeonkms driver where both the bus driver and radeonkms driver try to do the same thing. I suspect that it could be because of an access to a PCI configuration register after the device is placed into D3 state. Reviewed by: dumbbell, jhb MFC after: 13 days Differential Revision: https://reviews.freebsd.org/D3561
* drm: Update the device-independent code to match Linux 3.8.13dumbbell2015-03-1772-1432/+1320
| | | | | | | | | | | | | | | | | | | | | | This update brings few features: o Support for the setmaster/dropmaster ioctls. For instance, they are used to run multiple X servers simultaneously. o Support for minor devices. The only user-visible change is a new entry in /dev/dri but it is useless at the moment. This is a first step to support render nodes [1]. The main benefit is to greatly reduce the diff with Linux (at the expense of an unreadable commit diff). Hopefully, next upgrades will be easier. No updates were made to the drivers, beside adapting them to API changes. [1] https://en.wikipedia.org/wiki/Direct_Rendering_Manager#Render_nodes Tested by: Many people MFC after: 1 month Relnotes: yes
* vt(4): Add support to "downgrade" from eg. vt_fb to vt_vgadumbbell2015-03-011-0/+2
| | | | | | | | | | | | | | The main purpose of this feature is to be able to unload a KMS driver. When going back from the current vt(4) backend to the previous backend, the previous backend is reinitialized with the special VDF_DOWNGRADE flag set. Then the current driver is terminated with the new "vd_fini" callback. In the case of vt_fb and vt_vga, this allows the former to pass the vgapci device vt_fb used to vt_vga so the device can be rePOSTed. Differential Revision: https://reviews.freebsd.org/D687
* After r278004 was committed, Bruce Evans noted that the casts weredim2015-02-092-7/+7
| | | | | | | | | | | | actually completely unnecessary, here: https://lists.freebsd.org/pipermail/svn-src-all/2015-February/098478.html Remove the casts, and just assign &xxx_io_mc_regs[0][0] directly. Reviewed by: dumbbell MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D1748
* Constify a number of accesses in drm2's radeon drivers to avoiddim2015-01-312-9/+9
| | | | | | | | -Wcast-qual warnings. No functional change. Reviewed by: dumbbell MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D1727
* An update for the i915 GPU driver, which brings the code up to Linuxkib2015-01-212-3/+3
| | | | | | | | | | | | commit 4d93914ae3db4a897ead4b. Some related drm infrastructure changes are imported as needed. Biggest update is the rewrite of the i915 gem io to more closely follow Linux model, althought the mechanism used by FreeBSD port is different. Sponsored by: The FreeBSD Foundation MFC after: 2 month
* drm/radeon: Lower priority of a message related to invalid EDIDdumbbell2014-11-161-1/+1
| | | | | | | | | Like in r259717, the prority goes from "error" to "debug" to avoid spamming logs when the connectors are polled. PR: 194770 Submitted by: Larry Rosenman <ler@lerctr.org> MFC after: 1 week
* drm: Lower priority of two messages related to invalid EDIDdumbbell2014-11-021-1/+1
| | | | | | | Like in r259717, the prority goes from "error" to "debug" to avoid spamming logs when the connectors are polled. MFC after: 1 week
* Port the TTM AGP backend to the FreeBSD agp driver and enable AGP supporttijl2014-10-303-6/+27
| | | | | | | | | | | | | | | in the radeonkms driver. Note: In PCI mode virtual addresses on the graphics card that map to system RAM are translated to physical addresses by the graphics card itself. In AGP mode address translation is done by the AGP chipset so fictitious addresses appear on the system bus. For the CPU cache management to work correctly when the CPU accesses this memory it needs to use the same fictitious addresses (and let the chipset translate them) instead of using the physical addresses directly. Reviewed by: kib MFC after: 1 month
* drm/radeon: Fix a memory leak when radeonkms is unloadeddumbbell2014-08-281-0/+1
| | | | MFC after: 1 week
* Merge change from upstream linux kernel submitted by OpenBSD:sbruno2014-07-212-22/+5
| | | | | | | | | | | | | | | | drm/radeon: fix-up some float to fixed conversion thinkos Spotted by Brad Smith when porting to OpenBSD. Noticed-by: Brad Smith <brad@comstyle.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> ref: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1cd73ff7 Remove #ifdef DUMBBELL_WIP in favor of upstream fix. Phabric: https://phabric.freebsd.org/D423 Reviewed by: dumbbell, jkim MFC after: 2 weeks
* Revert r268543.rpaulo2014-07-122-2/+2
| | | | We should probably fix sys/gpio.h instead.
* Move iic.h to sys/ so that it's automatically installed in /usr/include/sys.rpaulo2014-07-122-2/+2
| | | | | | | This lets us call iic(4) ioctls without needing the kernel source code and follows the same model of GPIO. MFC after: 3 weeks
* Fix DMA handling in radeon_dummy_page_init():marius2014-05-281-2/+2
| | | | | | | | | | | | | | | | | | | - Based on actual usage and on what Linux does, dummy_page.addr should contain the physical bus address of the dummy page rather than its virtual one. As a side-effect, correcting this bug fixes compilation with PAE support enabled by getting rid of an inappropriate cast. - Also based on actual usage of dummy_page.addr, theoretically Radeon devices could do a maximum of 44-bit DMA. In reality, though, it is more likely that they only support 32-bit DMA, at least that is what radeon_gart_table_ram_alloc() sets up for, too. However, passing ~0 to drm_pci_alloc() as maxaddr parameter translates to 64-bit DMA on amd64/64-bit machines. Thus, use BUS_SPACE_MAXSIZE_32BIT instead, which the existing 32-bit DMA limits within the drm2 code spelled as 0xFFFFFFFF should also be changed to. Reviewed by: dumbbell MFC after: 1 week Sponsored by: Bally Wulff Games & Entertainment GmbH
* drm/radeon: Add 32bit ioctls supportdumbbell2014-05-032-259/+166
| | | | | | | | This allows to run 32bit applications on a 64bit host. This was tested successfully with Wine (emulators/i386-wine-devel) and StarCraft II. Submitted by: Jan Kokemüller <jan.kokemueller@gmail.com> MFC after: 1 week
* Abort when firmware isn't present in R600+ models.rmh2014-02-042-0/+12
| | | | | | | | More details at: http://anonscm.debian.org/viewvc/kernel/dists/trunk/linux/debian/patches/bugfix/all/radeon-firmware-is-required-for-drm-and-kms-on-r600-onward.patch?revision=20909&view=co Reviewed by: dumbbell MFC after: 1 week
* drm/ttm, drm/radeon: Replace EINTR/ERESTART by ERESTARTSYS...dumbbell2013-12-212-2/+8
| | | | | | | | | | | | | | | ... for msleep/cv_*wait() return values, where wait_event*() is used on Linux. ERESTARTSYS is the return code expected by callers when the operation was interrupted. For instance, this is the case of radeon_cs_ioctl() (radeon_cs.c): if an error occurs, and the code isn't ERESTARTSYS (eg. EINTR), it logs an error. Note that ERESTARTSYS is defined as ERESTART, but this keeps callers' code close to Linux. Submitted by: avg@ (previous version)
* drm/radeon: radeon_dp_i2c_aux_ch() must return 0 on FreeBSDdumbbell2013-12-081-1/+1
| | | | | | | | | The code was unmodified compared to Linux and returned the amount of received bytes from the i2c bus. This led to non-working i2c bus and failure to eg. read monitor's EDID, if connected to DisplayPort. MFC after: 3 days Tested by: Mikaël Urankar <mikael.urankar@gmail.com>
* drm/radeon: agp_info->ai_aperture_size is in bytes, not Mbytesdumbbell2013-12-081-3/+3
| | | | | | | | This fixes radeon_agp_init() and gtt_size is now correct. However, this is not enough to make Radeon AGP cards work: ttm_agp_backend.c isn't implemented yet. Submitted by: tijl@
* Merge VT(9) project (a.k.a. newcons).ray2013-12-054-73/+48
|\ | | | | | | | | | | | | Reviewed by: nwhitehorn MFC_to_10_after: re approval Sponsored by: The FreeBSD Foundation
| * MFC @r258947.ray2013-12-0517-98/+98
| |\ | | | | | | | | | Sponsored by: The FreeBSD Foundation
| * \ MFC @r258091.ray2013-11-132-3/+2
| |\ \
| * | | drm/radeon: Fix build of radeon_fb.c on i386dumbbell2013-11-121-1/+3
| | | |
| * | | drm/radeon: Implement the FB_GETINFO() newbus callbackdumbbell2013-11-023-21/+23
| | | |
| * | | Change drm2 to attach fbd as device.ray2013-10-311-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | Radeon driver not ready yet. Sponsored by: The FreeBSD Foundation
| * | | MFC @r256953ray2013-10-231-0/+1
| |\ \ \
| * | | | o Update drivers according to fb_info structure changes.ray2013-10-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Switch drm_fb_helper to be simple framebuffer provider. Sponsored by: The FreeBSD Foundation
| * | | | drm/radeon: Fill "struct fb_info" for Newconsdumbbell2013-10-102-72/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a first step to make Newcons work with "radeonkms". However, this is very unstable at the moment. Especially, the locking change in radeon_pm.c is probably not correct.
* | | | | Initialize modesetting sysctls in radeonkms.rmh2013-12-051-0/+7
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended for MFC if re@ permits. Reviewed by: kib, dumbbell Tested by: Steven Chamberlain <steven@pyro.eu.org> MFC after: 3 days
* | | | Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thiseadler2013-11-3017-93/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shifts into the sign bit. Instead use (1U << 31) which gets the expected result. This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD. Discussed with: -arch, rdivacky Reviewed by: cperciva
* | | | Similar to the (1 << 31) case it is not defined to do (2 << 30).eadler2013-11-303-5/+5
| |_|/ |/| |
* | | drm/radeon: Wake up userland after page flipdumbbell2013-11-081-3/+1
| | | | | | | | | | | | | | | For instance, this caused issues in KDE, such as stuttered animations (with desktop effects enabled).
* | | drm: Initialize "handle" to 0 before calling drm_gem_handle_create()dumbbell2013-11-081-0/+1
| |/ |/| | | | | | | This is variable is being checked in drm_gem_name_create() before being set.
* | drm/radeon: radeonkms depends on firmware(9)dumbbell2013-10-191-0/+1
|/ | | | Submitted by: tijl@
* drm/radeon: Add missing "return false" after unmapping invalid BIOSdumbbell2013-09-151-0/+1
| | | | | | | Without that, we would try to copy the unmapped BIOS. Submitted by: Christoph Mallon <christoph.mallon@gmx.de> Approved by: re (blanket)
* drm/radeon: Fix usage of pci_save_state() and pci_restore_state()dumbbell2013-09-144-8/+8
| | | | | | | | | | Calling those functions with the drmn device as argument causes a panic, because it's not a direct child of pci$N. They must be called with the vgapci device instead. This fix is not enough to make suspend/resume work reliably. Approved by: re (blanket)
* drm/radeon: Fix usage of vga_pci_map_bios()dumbbell2013-09-141-3/+5
| | | | | | | | vga_pci_(un)map_bios() takes a vgapci device as argument, not a drmn one. This fixes a bug where the BIOS couldn't be mapped if the device wasn't the boot display. Approved by: re (kib; blanket for following drm2/radeon commits)
* drm/radeon: Rename the (S)DEBUG macros in atom.c to avoid conflictsdumbbell2013-08-261-100/+100
| | | | | For instance, DEBUG is already defined in the LINT kernel configuration. This fixes the build of LINT.
* drm/radeon: Import the Radeon KMS driverdumbbell2013-08-25145-0/+130362
This driver is based on Linux 3.8 and a previous effort by kan@. More informations about this project can be found on the FreeBSD wiki: https://wiki.freebsd.org/AMD_GPU The driver is split into: sys/dev/drm2: The driver sources. sys/modules/drm2/radeonkmw: The driver main kernel module's Makefile. sys/modules/drm2/radeonkmsfw: All firmware kernel module Makefiles. There's one directory and one Makefile for each firmware. sys/contrib/dev/drm2/radeonkmsfw: All firmware binary sources. tools/tools/drm/radeon Tools to update firmwares or regenerate some headers. Merging the driver to FreeBSD 9.x may be possible but not a priority for now. Help from: kib@, kan@ Tested by: avg@, kwm@, ray@, Alexander Yerenkow <yerenkow@gmail.com>, Anders Bolt-Evensen <andersbo87@me.com>, Denis Djubajlo <stdedjub@googlemail.com>, J.R. Oldroyd <fbsd@opal.com>, Mikaël Urankar <mikael.urankar@gmail.com>, Pierre-Emmanuel Pédron <pepcitron@gmail.com>, Sam Fourman Jr. <sfourman@gmail.com>, Wade <wade-is-great@live.com>, (probably other I forgot...) HW donations: kyzh, Yakaz
OpenPOWER on IntegriCloud