summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm
Commit message (Collapse)AuthorAgeFilesLines
* Fix error in busmaster enable logicrnoland2008-10-271-2/+4
| | | | | | | | rs400/rs480 should clear the RADEON_BUS_MASTER_DIS bit. This should get the rs485 IGP chips going again. Approved by: jhb (mentor) Obtained from: drm git master
* Fix some fallout from the busmaster disable cleanuprnoland2008-10-272-10/+9
| | | | | | | rs400 is just like rs480 Approved by: jhb (mentor) Obtained from: drm git
* Don't report GEM capability until we actually have GEM support.rnoland2008-10-271-1/+2
| | | | | | This was causing the newer Intel video drivers to fail and abort X. Approved by: jhb (mentor)
* drm/i915: fix ioremap of a user address for non-root (CVE-2008-3831)rnoland2008-10-251-1/+1
| | | | | | | | | | | | | | | Olaf Kirch noticed that the i915_set_status_page() function of the i915 kernel driver calls ioremap with an address offset that is supplied by userspace via ioctl. The function zeroes the mapped memory via memset and tells the hardware about the address. Turns out that access to that ioctl is not restricted to root so users could probably exploit that to do nasty things. We haven't tried to write actual exploit code though. It only affects the Intel G33 series and newer. Approved by: bz (secteam) Obtained from: Intel drm repo Security: CVE-2008-3831
* Replace calls to minor() with dev2unit(). Ed already fixed this once,rnoland2008-10-232-2/+2
| | | | | | | | but I inadvertently overwrote the change when I synced to git. Commit the fix in both places, so this doesn't happen again. Approved by: jhb (mentor) MFC after: 2 weeks
* This check is invalid and I disabled it once already. I accidentallyrnoland2008-10-231-6/+4
| | | | | | | | reintroduced it with the sync to git master. Commit the fix in both places this time. Approved by: jhb (mentor) MFC after: 2 weeks
* Correct memory leak of info->rects. Previously we would free info, butrnoland2008-10-131-11/+9
| | | | | | but abandon info->rects. Approved by: jhb (mentor)
* Rework memory allocation to allocate memory with different type names. Thisrnoland2008-10-1323-171/+182
| | | | | | | | | | | will ease the identification of memory leaks as the OS will be able to track allocations for us by malloc type. vmstat -m will show all of the allocations. Convert the calls to drm_alloc() and friends, which are used in shared code to static __inline__ while we are here. Approved by: jhb (mentor)
* The linux list compat code had an error which prevented list_for_each_safe()rnoland2008-10-131-2/+2
| | | | | | | | from operating on a list with a single item. This code is used much more by the i915 driver with xorg-7.4. Correct it to match the actual linux implementation. Approved by: jhb (mentor)
* Correct the interrupt handling in the Intel i915 driver.rnoland2008-10-131-11/+16
| | | | Approved by: jhb (mentor)
* Several of the newer radeon cards have moved around the registers for enablingrnoland2008-10-133-24/+61
| | | | | | | | busmastering support. This also adds register definitions for MSI support, which we will be using shortly. Approved by: jhb (mentor) Obtained from: drm git master
* Add support for Radeon rs740 (HD 2100)rnoland2008-10-133-9/+23
| | | | | Approved by: jhb (mentor) Obtained from: drm git master
* Don't explicitly bzer driver softcrnoland2008-10-048-16/+0
| | | | | | | | new-bus already handles this for us. Suggested by jhb@ Approved by: jhb (mentor)
* Use M_WAITOK when allocating driver memoryrnoland2008-10-048-8/+24
| | | | | | | | | We don't explicity check for error here and M_WAITOK will just put the process to sleep waiting on resources to become available. Suggested by jhb@ Approved by: jhb (mentor)
* Change drm_order() to use ffsl()rnoland2008-10-041-3/+4
| | | | | | pointed out by jhb@ Approved by: jhb (mentor)
* resync to git masterrnoland2008-10-0333-1611/+1838
| | | | | | | | | | | | | | | | | | | | | | This reverts a private patch which is causing issues with many Intel chipsets. I will review that patch and see what we need to do to fix it up later, but for the time being, we will just get these chips working again. This update contains a lot of code cleanup and is post gem merge (no, we don't have gem support). It should prove much easier to read the code now. A lot of thanks goes to vehemens for that work. I have adapted the code to use cdevpriv for tracking per open file data. That alleviates the old ugly hack that we used to try and accomplish the task and helped to clean up the open / close behavior a good bit. This also replaces the hack that was put in place a year or so ago to prevent radeons from locking up with AIGLX enabled. I have had a couple of radeon testers report that it still works as expected, though I no longer have radeon hardware to test with myself. Other various fixes from the linux crew and Intel, many of which are muddled in with the gem merge. Approved by: jhb (mentor) Obtained from: mesa/drm git master MFC after: 2 weeks
* Replace all calls to minor() with dev2unit().ed2008-09-272-2/+2
| | | | | | | | | | | | | | | After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib
* IGP based radeon cards such as the rs485 and rs690 require that the GART tablernoland2008-09-091-18/+73
| | | | | | | | be un-cached. Our previous memory barrier was not sufficient. This patch allocates the IGP GART tables using the BUS_DMA_NOCACHE flag to get these cards working. Approved by: kib
* We should never call drm_pci_alloc() while holding locks, due the thernoland2008-09-095-14/+36
| | | | | | | | calls to bus_dma. There were multiple paths that held different locks or no locks at all. This patch ensures that all of the calling paths drop their lock(s) before calling drm_pci_alloc(). Reviewed by: kib
* Don't return EINVAL when trying to unlock.rnoland2008-08-301-1/+6
| | | | | | | | anholt thinks that he added this check as part of some regression testing, but it is failing at least some of the time. I don't want to remove it just yet. I added a bit of debugging to help identify the issue. Approved by: kib
* We need to lock around driver unload now.rnoland2008-08-301-1/+4
| | | | | | | The i915 driver installs it's register map at load time now. We can't remove the map during unload without holding the lock. Approved by: kib
* Free the device lock around the call to drm_drawable_free_all()rnoland2008-08-301-0/+2
| | | | | | This function manipulates a spin lock and we can't hold a mutex over it. Approved by: kib
* Update drm kernel drivers.rnoland2008-08-2368-6410/+13388
| | | | | | | | | | This is a sync to mesa/drm pre-gem, with a few fixes on top of that. It also contains one local patch supplied by kib@ that I can't apply to git.master shared code. Approved by: flz Obtained from: mesa/drm git.master MFC after: 2 weeks
* Add the i915 GME device to DRM.remko2008-03-212-1/+3
| | | | | | | PR: kern/121808 Submitted by: Volker Werth <volker at vwsoft dot com> Approved by: imp (mentor, implicit for trivial changes) MFC after: 3 days
* Add support for the 965GM.remko2008-02-271-0/+1
| | | | | | | PR: kern/120978 Submitted by: Dominic Fandrey <kamikaze at bsdforen dot de> Approved by: imp (mentor, implicit), anholt (drm maintainer) MFC after: 3 days
* Dont accidentally remove a filesocket which is still in use. This givesremko2008-01-161-6/+9
| | | | | | | | | | | | problems when the DRM driver is loaded and the AIXGL extension is loaded , the AIXGL driver requests a drm_close and this will cause the radeon driver to fail while starting X windows. PR: kern/114688 Submitted by: vehemens <vehemens at verizon dot net> Prodded by: Robert Noland Approved by: imp (mentor, a while ago already), anholt MFC After: 1 week
* Move the agp(4) driver from sys/pci to sys/dev/agp. __FreeBSD_version wasjhb2007-11-122-0/+8
| | | | | | | | | bumped to 800004 to note the change though userland apps should not be affected since they use <sys/agpio.h> rather than the headers in sys/dev/agp. Discussed with: anholt Repocopy by: simon
* Properly initialize the dev_priv before calling the i915_dma_cleanup().kib2007-08-211-3/+2
| | | | | | | | This fixes my rev. 1.5. Reviewed by: anholt Approved by: re (kensmith) MFC after: 2 weeks
* bus_dma_tag_create() and bus_dma_mem_alloc() shall not be called with akib2007-07-121-9/+15
| | | | | | | | | | | | | non-sleepable lock held. drm_pci_alloc() calls them, thus drm mutex shall not be held during the call. Move the drm_pci_alloc() to the start of the i915_initialize() and drop the the drm mutex around it. Reported by: Ganbold <ganbold micom mng net> Reviewed by: anholt Approved by: re (hrs) MFC after: 1 week
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-1/+1
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* Update __FreeBSD_version check for pci_find_extcap() now that it isjhb2006-12-281-1/+1
| | | | present in 6.x.
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-061-0/+7
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Merge from DRM upstream:anholt2006-09-0712-62/+268
| | | | | | | - Add support for Intel 965 Express chipsets. - Add support for R200 vertex programs, along with minor bugfixes. - Add support for vblank synchronization to pipe B of Intel hardware (laptop screens).
* Update to current DRM CVS, bringing in a fix for a NULL pointer chase whenanholt2006-05-174-5/+7
| | | | running 3d apps on i915.
* Merge from DRM CVS:anholt2006-05-171-0/+1
| | | | | | | Set entry->virtual for sg maps, fixing ATI PCI/PCIE GART support. PR: kern/97056 Submitted by: Stanislav Sedov <ssedov@mbsd.msk.ru>
* Reorder the DRM_*_AGP enums to match linux and what our code expects, fixinganholt2006-04-181-2/+2
| | | | | | i915 attachment. Submitted by: Jonathan Fosburgh <jonathan@fosburgh.org>
* Re-apply changes to make this compile with -Wundef:ru2006-04-131-1/+1
| | | | | | /usr/src/sys/modules/drm/radeon/../../../dev/drm/radeon_state.c:2976:5: "BITS_PER_LONG" is not defined (Previous revision has trashed my changes.)
* Update to DRM CVS as of 2006-04-09. The most notable new feature is the updatedanholt2006-04-0921-769/+1265
| | | | | | | Radeon memmap code, which with a new DDX driver and DRI drivers should fix long-term stability issues with Radeons. Also adds support for r200's ATI_fragment_shader, r300 texrect support and texture caching fixes, i915 vblank support and bugfixes, and new PCI IDs.
* - Bump FreeBSD version for the hostb(4) and vgapci(4) drivers as well asjhb2005-12-2010-3/+59
| | | | | | | | | the addition of pci_find_extcap(). - Change the drm drivers to attach to vgapci. This is #ifdef'd so the code can be shared across branches. - Use pci_find_extcap() to look for AGP and PCIE capabilities in drm. - GC all the drmsub stuff for i810/i830/i915. The agp and drm devices are now both children of vgapci.
* Use compile-time detection of 64-bit addressing.ru2005-12-041-3/+3
|
* Fix -Wundef warnings and properly check the size of long, FWIW.ru2005-12-041-3/+3
|
* Merge DRM CVS as of 2005-12-02, adding i915 DRM support thanks to Alexey Popov,anholt2005-12-033-5/+11
| | | | and a new r300 PCI ID.
* Make cleaner diffs by munging the $FreeBSD$s from the FreeBSD CVS sources backanholt2005-12-031-1/+15
| | | | into the new sources.
* Restore the enabling of debugging by default by the DRM_DEBUG kernel option.anholt2005-12-021-0/+4
| | | | | | | It remains controlled by hw.dri.*.debug no matter what. PR: kern/85479 Submitted by: Oliver Fromme <olli@secnetix.de>
* Update DRM to CVS snapshot as of 2005-11-28. Notable changes:anholt2005-11-2873-1722/+3486
| | | | | | | | | | | | | - S3 Savage driver ported. - Added support for ATI_fragment_shader registers for r200. - Improved r300 support, needed for latest r300 DRI driver. - (possibly) r300 PCIE support, needs X.Org server from CVS. - Added support for PCI Matrox cards. - Software fallbacks fixed for Rage 128, which used to render badly or hang. - Some issues reported by WITNESS are fixed. - i915 module Makefile added, as the driver may now be working, but is untested. - Added scripts for copying and preprocessing DRM CVS for inclusion in the kernel. Thanks to Daniel Stone for getting me started on that.
* Fix a buffer aging problem in new r300 code that could lead to hangs with someanholt2005-08-011-3/+1
| | | | | | apps. Obtained from: DRM CVS
* Add the latest r300 code from r300.sf.net. This is based on the patch suppliedanholt2005-07-2011-43/+2454
| | | | | | by Vladimir Dergachev for inclusion in DRM CVS, with minor modifications for FreeBSD CVS and the appropriate license from Nicolai Haehnle on r300_reg.h. Fixes hangs when using r300.sf.net userland, tested on a Radeon 9600 on amd64.
* Disable the drm_initmap calls in radeon_cp.c, due to them resulting in improperanholt2005-06-281-0/+6
| | | | | | | | | | handling of pci resources, and mapping framebuffer leading to panics on X startup. The proper solution involves use of bus_alloc_resource without RF_ACTIVE, but this code is being rewritten in DRM CVS currently, and disabling for now doesn't remove any features, so take the easy route. PR: kern/80718 Approved by: re (scottl)
* Mark the permanent map for radeon registers read-only. Failure to set this flaganholt2005-06-241-1/+2
| | | | | | | | | allowed writing to the registers by any user that can open the DRI device, and therefore ability to initiate DMA. This came in with the merge from DRI CVS on 2005-04-15. Approved by: re (scottl) Obtained from: DRM CVS
* Fix a panic on X startup for drivers that don't init maps themselves by storinganholt2005-04-241-1/+1
| | | | | | the return value of drm_ioremap in the right place again. Submitted by: tegge
OpenPOWER on IntegriCloud