summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
Commit message (Collapse)AuthorAgeFilesLines
* trivial: replace last usages of __FUNCTION__ in kernelHarvey Harrison2009-01-072-3/+3
| | | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drm: fix ordering of driver unload vs agp unload.Dave Airlie2009-01-071-3/+3
| | | | | | | For KMS drivers, we really need to cleanup the driver before disabling the AGP subsystem. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: Respect the other stolen memory sizes we know of.Eric Anholt2009-01-072-14/+40
| | | | | | | fd.o bug #19336. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Non-mobile parts don't have integrated TV-out.Eric Anholt2009-01-071-1/+1
| | | | | Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Add support for integrated HDMI on G4X hardware.Eric Anholt2009-01-077-7/+322
| | | | | | | | This is ported directly from the userland 2D driver code. The HDMI audio bits aren't hooked up yet. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Pin cursor bo and unpin old bo when setting cursor.Kristian Høgsberg2009-01-072-8/+22
| | | | | | | | | We also didn't track the cursor bo before and would leak a reference when the cursor image was change. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Don't allow objects to get bound while VT switched.Eric Anholt2009-01-071-6/+9
| | | | | | | | | | | | This avoids a BUG_ON in the enter_vt path due to objects being in the GTT when we shouldn't have ever let them be (as we're not supposed to touch the device during that time). This was triggered by a change in the 2D driver to use the GTT mapping of objects after pinning them to improve software fallback performance. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6Linus Torvalds2009-01-061-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (60 commits) uio: make uio_info's name and version const UIO: Documentation for UIO ioport info handling UIO: Pass information about ioports to userspace (V2) UIO: uio_pdrv_genirq: allow custom irq_flags UIO: use pci_ioremap_bar() in drivers/uio arm: struct device - replace bus_id with dev_name(), dev_set_name() libata: struct device - replace bus_id with dev_name(), dev_set_name() avr: struct device - replace bus_id with dev_name(), dev_set_name() block: struct device - replace bus_id with dev_name(), dev_set_name() chris: struct device - replace bus_id with dev_name(), dev_set_name() dmi: struct device - replace bus_id with dev_name(), dev_set_name() gadget: struct device - replace bus_id with dev_name(), dev_set_name() gpio: struct device - replace bus_id with dev_name(), dev_set_name() gpu: struct device - replace bus_id with dev_name(), dev_set_name() hwmon: struct device - replace bus_id with dev_name(), dev_set_name() i2o: struct device - replace bus_id with dev_name(), dev_set_name() IA64: struct device - replace bus_id with dev_name(), dev_set_name() i7300_idle: struct device - replace bus_id with dev_name(), dev_set_name() infiniband: struct device - replace bus_id with dev_name(), dev_set_name() ISDN: struct device - replace bus_id with dev_name(), dev_set_name() ...
| * gpu: struct device - replace bus_id with dev_name(), dev_set_name()Kay Sievers2009-01-061-1/+1
| | | | | | | | | | | | CC: Dave Airlie <airlied@redhat.com> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | Check fops_get() return valueLaurent Pinchart2009-01-061-0/+4
|/ | | | | | | | | | | | | | | | | | | | | | Several subsystem open handlers dereference the fops_get() return value without checking it for nullness. This opens a race condition between the open handler and module unloading. A module can be marked as being unloaded (MODULE_STATE_GOING) before its exit function is called and gets the chance to unregister the driver. During that window open handlers can still be called, and fops_get() will fail in try_module_get() and return a NULL pointer. This change checks the fops_get() return value and returns -ENODEV if NULL. Reported-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Acked-by: Takashi Iwai <tiwai@suse.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Dave Airlie <airlied@linux.ie> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drm/i915: fix modeset devname allocation + agp init return check.Dave Airlie2008-12-291-10/+12
| | | | | | | | | | devname needs to be allocated before the irq is installed, so the irq routines get the correct name in /proc. Also check the return value from the AGP init function, and fixup the exit points. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: Remove redundant test in error path.Julia Lawall2008-12-291-6/+5
| | | | | | | | The error path for object list being null is in the second goto target. Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: Add a debug node for vblank state.Eric Anholt2008-12-292-0/+72
| | | | | Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: Avoid use-before-null-test on dev in drm_cleanup().Eric Anholt2008-12-291-3/+1
| | | | | Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Don't print to dmesg when taking signal during object_pin.Eric Anholt2008-12-291-2/+4
| | | | | | | | | This showed up in logs where people had a hung chip, so pinning was blocked on the chip unpinning other buffers, and the X Server took its scheduler signal during that time. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: pin new and unpin old buffer when setting a mode.Kristian Høgsberg2008-12-292-15/+49
| | | | | | | | | This removes the requirement for user space to pin a buffer before setting a mode that is backed by the pixels from that buffer. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: un-EXPORT and make 'intelfb_panic' staticHannes Eder2008-12-291-3/+2
| | | | | | | | | | Fix this sparse warning: drivers/gpu/drm/i915/intel_fb.c:417:5: warning: symbol 'intelfb_panic' was not declared. Should it be static? Signed-off-by: Hannes Eder <hannes@hanneseder.net> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Delete unused, pointless i915_driver_firstopen.Eric Anholt2008-12-291-8/+0
| | | | | | | | Thanks to Hannes Eder for pointing out that this code was dead according to sparse. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: fix sparse warnings: returning void-valued expressionHannes Eder2008-12-291-2/+2
| | | | | | Signed-off-by: Hannes Eder <hannes@hanneseder.net> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: fix sparse warnings: move 'extern' decls to header fileHannes Eder2008-12-292-6/+6
| | | | | | | | | | Move 'extern'-decls from "intel_dvo.c" to "dvo.h", as "dvo.h" is included by and only by files where the symbols are either defined or used. Signed-off-by: Hannes Eder <hannes@hanneseder.net> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: fix sparse warnings: make symbols staticHannes Eder2008-12-299-22/+23
| | | | | | Signed-off-by: Hannes Eder <hannes@hanneseder.net> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: fix sparse warnings: declare one-bit bitfield as unsignedHannes Eder2008-12-291-4/+4
| | | | | | | Signed-off-by: Hannes Eder <hannes@hanneseder.net> Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Don't double-unpin buffers if we take a signal in evict_everything().Eric Anholt2008-12-291-0/+1
| | | | | | | | | We haven't seen this in practice, but it was visible when looking at a bug report from when i915_gem_evict_everything() was broken and would always return error. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Fix fbcon setup to align display pitch to 64b.Eric Anholt2008-12-291-1/+1
| | | | | | | This is required by the display plane, and fixes 1400x1050 laptop displays. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: drop DRM_IOCTL_MODE_REPLACEFB, add+remove works just as well.Kristian H�gsberg2008-12-293-72/+0
| | | | | | | | | | | The replace fb ioctl replaces the backing buffer object for a modesetting framebuffer object. This can be acheived by just creating a new framebuffer backed by the new buffer object, setting that for the crtcs in question and then removing the old framebuffer object. Signed-off-by: Kristian Hogsberg <krh@redhat.com> Acked-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: sanitise drm modesetting API + remove unused hotplugJakob Bornecrantz2008-12-293-29/+14
| | | | | | | | | | | The initially merged modesetting API has some uglies in it, this cleans up the struct members and ioctl ordering for initial submission. It also removes the unneeded hotplug infrastructure. airlied:- I've pulled this patch in from git modesetting-gem tree. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: fix allowing master ioctls on non-master fds.Dave Airlie2008-12-291-1/+1
| | | | | | | The multi-master patches changed master to a pointer, and this fell out, change to use is_master. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: use locked rmmap to remove sarea mapping.Dave Airlie2008-12-292-1/+2
| | | | | | this exports the locked version of the symbol as struct_mutex locks it all. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: fix missing hunk from the master changes.Dave Airlie2008-12-291-0/+2
| | | | | | | Thanks to Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> for reporting this. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: fix useless gcc unused variable warningDave Airlie2008-12-291-1/+1
| | | | | | | the calling function doesn't call this function unless one of the two states that sets the value is true. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: fix warning due to PAGE_SIZE maxDave Airlie2008-12-291-1/+1
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: kconfig have drm core select i2c for kmsDave Airlie2008-12-291-1/+2
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: PAGE_CACHE_WC is x86 only so farDave Airlie2008-12-291-0/+2
| | | | | | The page protections need to be checked whether they need to be more flexible. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: pick an 800x600@60HZ mode by default for unknown CRT.Dave Airlie2008-12-291-4/+4
| | | | | | This is what X picks now, so we should do the same. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: Fix stolen memory detection on G45 and GM45.Eric Anholt2008-12-292-6/+11
| | | | | Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: Register module dependencies for the modesetting code.Eric Anholt2008-12-291-0/+5
| | | | | Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* DRM: i915: add mode setting supportJesse Barnes2008-12-2926-50/+10566
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds i915 driver support for the DRM mode setting APIs. Currently, VGA, LVDS, SDVO DVI & VGA, TV and DVO LVDS outputs are supported. HDMI, DisplayPort and additional SDVO output support will follow. Support for the mode setting code is controlled by the new 'modeset' module option. A new config option, CONFIG_DRM_I915_KMS controls the default behavior, and whether a PCI ID list is built into the module for use by user level module utilities. Note that if mode setting is enabled, user level drivers that access display registers directly or that don't use the kernel graphics memory manager will likely corrupt kernel graphics memory, disrupt output configuration (possibly leading to hangs and/or blank displays), and prevent panic/oops messages from appearing. So use caution when enabling this code; be sure your user level code supports the new interfaces. A new SysRq key, 'g', provides emergency support for switching back to the kernel's framebuffer console; which is useful for testing. Co-authors: Dave Airlie <airlied@linux.ie>, Hong Liu <hong.liu@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* DRM: add mode setting supportDave Airlie2008-12-2911-40/+5070
| | | | | | | | | | | | | | | | | | | | | | | | | | Add mode setting support to the DRM layer. This is a fairly big chunk of work that allows DRM drivers to provide full output control and configuration capabilities to userspace. It was motivated by several factors: - the fb layer's APIs aren't suited for anything but simple configurations - coordination between the fb layer, DRM layer, and various userspace drivers is poor to non-existent (radeonfb excepted) - user level mode setting drivers makes displaying panic & oops messages more difficult - suspend/resume of graphics state is possible in many more configurations with kernel level support This commit just adds the core DRM part of the mode setting APIs. Driver specific commits using these new structure and APIs will follow. Co-authors: Jesse Barnes <jbarnes@virtuousgeek.org>, Jakob Bornecrantz <jakob@tungstengraphics.com> Contributors: Alan Hourihane <alanh@tungstengraphics.com>, Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: add GEM GTT mapping supportJesse Barnes2008-12-296-4/+548
| | | | | | | | | | Use the new core GEM object mapping code to allow GTT mapping of GEM objects on i915. The fault handler will make sure a fence register is allocated too, if the object in question is tiled. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: GEM mmap supportJesse Barnes2008-12-296-3/+139
| | | | | | | | | | | Add core support for mapping of GEM objects. Drivers should provide a vm_operations_struct if they want to support page faulting of objects. The code for handling GEM object offsets was taken from TTM, which was written by Thomas Hellström. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: Add /proc debugging entry for reading out the HWS.Eric Anholt2008-12-291-0/+34
| | | | | Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: reorganise start and load.Dave Airlie2008-12-291-3/+6
| | | | | | Make sure we have the primary node so the device can add maps. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: fix leak of uninitialized data to userspaceVegard Nossum2008-12-292-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...so drm_getunique() is trying to copy some uninitialized data to userspace. The ECX register contains the number of words that are left to copy -- so there are 5 * 4 = 20 bytes left. The offset of the first uninitialized byte (counting from the start of the string) is also 20 (i.e. 0xf65d2294&((1 << 5)-1) == 20). So somebody tried to copy 40 bytes when the string was only 19 long. In drm_set_busid() we have this code: dev->unique_len = 40; dev->unique = drm_alloc(dev->unique_len + 1, DRM_MEM_DRIVER); ... len = snprintf(dev->unique, dev->unique_len, pci:%04x:%02x:%02x.%d", ...so it seems that dev->unique is never updated to reflect the actual length of the string. The remaining bytes (20 in this case) are random uninitialized bytes that are copied into userspace. This patch fixes the problem by setting dev->unique_len after the snprintf(). airlied- I've had to fix this up to store the alloced size so we have it for drm_free later. Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com> Signed-off-by: Vegard Nossum <vegardno@thuin.ifi.uio.no> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: move to kref per-master structures.Dave Airlie2008-12-2918-332/+563
| | | | | | | | | | | | | | | | This is step one towards having multiple masters sharing a drm device in order to get fast-user-switching to work. It splits out the information associated with the drm master into a separate kref counted structure, and allocates this when a master opens the device node. It also allows the current master to abdicate (say while VT switched), and a new master to take over the hardware. It moves the Intel and radeon drivers to using the sarea from within the new master structures. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: cleanup exit path for module unloadDave Airlie2008-12-292-20/+7
| | | | | | | | The current sub-module unload exit path is a mess, it tries to abuse the idr. Just keep a list of devices per driver struct and free them in-order on rmmod. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: fix correctness of irq_enabled check for radeon.Dave Airlie2008-12-231-2/+2
| | | | | | | | | This check was introduced with the logic the wrong way around. Fixes regression: http://bugzilla.kernel.org/show_bug.cgi?id=12216 Tested-by: François Valenduc <francois.valenduc@tvcablenet.be> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: GEM on PAE has problems - disable it for now.Dave Airlie2008-12-192-1/+11
| | | | | | | | | | | On PAE systems, GEM allocates pages using shmem, and passes these pages to be bound into AGP, however the AGP interfaces + the x86 set_memory interfaces all take unsigned long not dma_addr_t. The initial fix for this was a mess, so we need to do this correctly for 2.6.29. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: Don't return busy for buffers left on the flushing list.Eric Anholt2008-12-191-1/+8
| | | | | | | | | | | | These buffers don't have active rendering still occurring to them, they just need either a flush to be emitted or a retire_requests to occur so that we notice they're done. Return unbusy so that one of the two occurs. The two expected consumers of this interface (OpenGL and libdrm_intel BO cache) both want this behavior. Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: Disable the GM965 MSI errata workaround.Keith Packard2008-12-091-2/+3
| | | | | | | | | | | Since applying the fix suggested by the errata (disabling MSI), we've had issues with interrupts being stuck on despite IIR being 0 on GM965 hardware. Most reporters of the issue have confirmed that turning MSI back on fixes things, and given the difficulties experienced in getting reliable MSI working on Linux, it's believable that the errata was about software issues and not actual hardware issues. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: Don't return error in evict_everything when we get to the end.Owain Ainsworth2008-12-091-0/+2
| | | | | | | Returning -ENOMEM errored all the way out of execbuf, so the rendering never occurred. Signed-off-by: Dave Airlie <airlied@redhat.com>
OpenPOWER on IntegriCloud