summaryrefslogtreecommitdiff
path: root/src/i830_driver.c
AgeCommit message (Collapse)Author
2009-11-29batch: Track pixmap domains.Chris Wilson
In order to detect when we require cache flushes we need to track which domains the pixmap currently belongs to. So to do so we create a device private structure to hold the extra information and hook it up. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-29Cleanup a few compiler warnings.Chris Wilson
Simple warnings for unused variables and C99-style declarations. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-10Check that batch buffers are atomic.Chris Wilson
Since batch buffers are rarely emitted by themselves but as part of a sequence of state and vertices, the whole sequence is emitted atomically. Here we just enforce that batches are marked as being part of an atomic sequence as appropriate. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-15Enable XVMC by default on gen4.Eric Anholt
2009-10-14conf: Add debugging flush optionsChris Wilson
Make the following options available via xorg.conf: Section "Driver" Option "DebugFlushBatches" "1" # Flush the batch buffer after every # single operation; Option "DebugFlushCaches" "1" # Include a MI_FLUSH at the end of every # batch buffer to force data to be # flushed out of cache and into memory # before the completion of the batch. Option "DebugWait" "1" # Wait for the completion of every batch buffer # before continuing, i.e. perform synchronous # rendering. EndSection Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-13Drop frontbuffer from crtc in I830CloseScreenAlbert Damen
By dropping the frontbuffer from the crtc, the new frontbuffer can be properly added to the crtc when the xserver is reset. Signed-off-by: Albert Damen <albrt@gmx.net>
2009-10-08Rename pScreen to screen.Eric Anholt
2009-10-08Rename the xf86 screen private from pScrn to scrn.Eric Anholt
2009-10-08Rename the screen private from I830Ptr pI830 to intel_screen_private *intel.Eric Anholt
This is the beginning of the campaign to remove some of the absurd use of Hungarian in the driver. Not that I don't like Hungarian, but I don't need to know that pI830 is a pPointer.
2009-10-06Remove the reg_dumper code, now that it's been moved to intel_gpu_tools.Eric Anholt
2009-10-06Move to kernel coding style.Eric Anholt
We've talked about doing this since the start of the project, putting it off until "some convenient time". Just after removing a third of the driver seems like a convenient time, when backporting's probably not happening much anyway.
2009-10-06Remove UMS support.Eric Anholt
At this point, the only remaining feature regressions should be the lack of overlay support (about to land), and the need to update the XVMC code to work in the presence of KMS. Acked-by: Keith Packard <keithp@keithp.com> (in principle) Acked-by: Carl Worth <cworth@cworth.org> (in principle)
2009-10-05Remove error state dumping code.Eric Anholt
This is replaced by intel_gpu_dump, and would no longer be used once UMS is gone.
2009-10-05Implement drmmode overlayDaniel Vetter
This does not restore the overlay on EnterVT/disable it on LeaveVT. Does not look like this is necessary. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> [anholt: Hacked in avoiding the actual kernel calls with Signed-off-by: Eric Anholt <eric@anholt.net>
2009-09-21Remove DGA support from the driver.Keith Packard
The xf86DiDGA code required that the scanout buffer always be mappable, stay be at a fixed address in the aperture and have a constant size. With frame buffer resizing, the latter two are no longer true, and with KMS, we'd really prefer to not allow the former. The only option available to the driver is to completely disable DGA as the modes code has internal calls to the xf86DiDGA code when fetching new modes from the hardware. A fix for the DiDGA code will be added to the X server which will automatically initialize DGA for mode switching and input, but not frame buffer access, and not require any driver cooperation. Thus, the correct solution is for the driver to not call xf86DiDGAInit at all. For old servers, this eliminates a potential catastrophic problem where random memory is written by the X server. New servers will get the DIX-based behaviour automatically. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-21Remove vestigial internal rotation which broke KMS DGA/VidMode modesetting.Keith Packard
Pre-2.0, the driver supported rotation internally, rather than relying on the X server rotation support. The last piece of this dealt with rotating the mouse coordinates and also tried to preserve rotation across DGA/VidModeExtension modesetting requests. That latter bit of code broke under KMS as the rotation value was never initialized, and when set to zero would create an invalid configuration. This would confuse xrandr which would bail before making any changes, leaving the user without a way to recover. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-17Don't destroy bufmgr at CloseScreen timeKeith Packard
Under KMS, the bufmgr is not initialized at InitOutput time and so it won't be re-initialized during server regen. Thus we must leave the bufmgr running during regen and cannot destroy it in CloseScreen. Under UMS, each place the bufmgr is initialized, it checks to see if it has already happened. Hence, we can safely leave the bufmgr running across server regen for UMS too. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-08Add B43 chipset supportZhenyu Wang
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-09-02Make DGA optionalZhenyu Wang
As DGA is optional in xserver, we should check this too instead of always trying to init DGA. Found when update xserver to 6fffcd5825454a7fe58ffbcfb219f007cf38e731, but not update xf86dgaproto, which caused X fails to start. Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-08-11Fix the chip names printed in the log to be less obnoxious.Adam Jackson
Names taken from pci.ids. Pineview appears to be a platform not a GMCH, so use the G/GM convention to distinguish.
2009-07-28intel: drop RES_SHARED_VGA not needed anymoreDave Airlie
2009-07-28xserver: fix up for stable buildDave Airlie
reported by Arkadiusz Miskiewicz <arekm@maven.pl>
2009-07-28intel: since driver depends on newer server don't need to wrap thisDave Airlie
drop resource/RAC interactions
2009-07-28intel: update for resources/RAC API removalDave Airlie
2009-07-15Use batch_start_atomic to fix batchbuffer wrapping problems with 8xx render.Eric Anholt
Bug #22483.
2009-07-11Remove vestiges of NoAccel options from i830_driver.cKeith Packard
The enum and OptionInfoRec weren't removed in the initial patch Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-10Allocate GTT space for GEM only under UMSKeith Packard
GEM requires GTT space to map objects. Under KMS, the kernel driver has already provided all available GTT space to GEM, so the X server need not do anything. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-10Always set screen pixmap data pointer at init and resize timesKeith Packard
For non-DRM environments, the screen pixmap will be GART allocated memory and not a libdrm buffer object and so uxa will only use devPrivate.ptr to find the associated memory. Make sure devPrivate.ptr is set each time the framebuffer is allocated so that uxa will be able to draw to it. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-10Make xorg.conf DRI option work under KMS. Fix name of I830AccelMethodInitKeith Packard
KMS mode does not call I830AccelMethodInit as that does the user modesetting initialization (yes, it was misnamed), but that means that the DRI option was ignored. Create a new i830_check_dri_option function to do the option detection, then remove that from I830AccelMethodInit, which is renamed i830_user_modesetting_init to reflect what it actually does. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-10Remove NoAccel supportKeith Packard
This removes yet another 'debugging' option that hasn't seen real use in a long time, and wasn't supported under KMS in any case. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-08Initialize the other argument to drmSetInterfaceVersion.Eric Anholt
The kernel ignores it if dd_major is -1, anyway.
2009-07-07non-DRI FB resize failed to assign the screen pixmap devPrivate.ptr (22328)Keith Packard
When not using DRI, the screen pixmap is not in a bo, and so the usual enable/disable access functions don't adjust the pixmap devPrivate field, leaving it to the frame buffer allocation code to assign this correctly. During mode setting and fb resizing, FB access is disabled, and the screen pixmap devPrivate is stashed away by xf86EnableDisableFBAccess, to be restored when FB access is turned back on. This means that we have to set the pixmap devPrivate.ptr (in case xf86EnableDisableFBAccess doesn't do this), along with storing the address in the scrn->pixmapPrivate field. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-07-07Check for a valid I830Ptr before closing master.Chris Wilson
After failing to become DRM master, the X server dies attempting to close the master fd during free: (EE) intel(0): [drm] failed to set drm interface version. (EE) intel(0): Failed to become DRM master. (EE) intel(0): failed to get resources: Bad file descriptor (EE) intel(0): Kernel modesetting setup failed Backtrace: 0: X(xorg_backtrace+0x3b) [0x8133a3b] 1: X(xf86SigHandler+0x55) [0x80c7945] 2: [0xb805d400] 3: /usr/lib/xorg/modules/drivers//intel_drv.so [0xb7b4bfcc] 4: X(xf86DeleteScreen+0x6b) [0x80d465b] 5: X(InitOutput+0x548) [0x80b0158] 6: X(main+0x1cb) [0x807220b] 7: /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb7d107a5] 8: X [0x8071881] Saw signal 11. Server aborting. ddxSigGiveUp: Closing log ddxSigGiveUp: re-raising 11 Segmentation fault Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-07-01Fix 945GM VT switch in UMSZhenyu Wang
Bug #19578. We should set private intel_crtc state according to current, as fail to do so pipe A needs active won't be taken care of. Also make sure pipe swap operation always set during VT switch. Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-07-01Load fbcon too if kernel mode setting is checked onZhenyu Wang
If i915 module has already been loaded and kms check is true, it would be nice to load fbcon module too. Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
2009-06-30Add a few error messages for DRM initializationJesse Barnes
Makes it easier to see where things go wrong. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-29Only get the VBIOS in non-KMS modeJesse Barnes
In KMS mode, the kernel takes care of this for us, so don't bother.
2009-06-24Fix i830_crtc_on to only check outputs associated with the given CRTCJesse Barnes
Otherwise we may end up returning a false positive if some other output & crtc are on, but not the one in question, again leading to hangs. Reported-by: Eric Anholt <eric@anholt.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-24Treat disabled CRTCs as "not covering" for scanline wait purposesJesse Barnes
Now that swapbuffers does a scanline wait to avoid tearing, it's important to take into account the CRTC status to avoid hangs. If we do a scanline wait when the CRTC is off (due to DPMS for example) we'll hang the GPU. So add some code to check the CRTC DPMS status to the i830_covering_crtc function, returning NULL if none of the covering CRTCs are actually active. KMS vs UMS logic is hidden in new i830* functions, cleaning up both DRI2 & video paths a bit. Fixes fdo bug #22383. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-23Add option to control swapbuffers behaviorJesse Barnes
Until we get triple buffering, we'll want this so users can avoid taking a performance hit on apps that render slower than the refresh rate. Fixes fdo bug #22234. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-10Remove fixed MMIO sizeZhenyu Wang
Use pci resource size instead, which will get the correct MMIO range. New chipset uses obviously larger MMIO range. Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-06-10Add new chipsets PCI idsZhenyu Wang
Desktop and mobile version of new chipsets are added. Also do memory config like Intel 4 series chipset. Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-06-04Merge branch 'xvmc-vld'root
2009-05-28Remove useless loader symbol lists.Adam Jackson
2009-05-26Fold GEM detection into DRM master open.Eric Anholt
We don't have anything to do with the DRM unless it's GEM-enabled, unless we were to support GEM-but-not-DRI2, which doesn't seem useful. Compilation fixes by Carl Worth <cworth@cworth.org>
2009-05-26Open the DRM and keep the handle throughout server startup to finish.Eric Anholt
This will let us configure the server from start to finish with the most pertinent information available (KMS vs UMS, DRI2 vs non-DRI). Also, we now close the DRI2 fd at terminate, which we didn't before. This duplicates some code from DRI1 for getting a master FD like I'd done in DRI2, but given that we weren't loading DRI1 ourselves, this is also a bogosity cleanup, and avoids allocating the extra DRI1 private.
2009-05-18 DRI2 for XvMCXiang Hai hao
2009-05-13Add new have_gem flagJesse Barnes
Prior to this patch, code that wanted to check whether GEM was present would look at pI830->memory_manager. This turned out to be occasionally problematic in the KMS case, since memory_manager didn't always get set correctly. So add a new pI830->have_gem flag to make things clear in the various code paths, and set it after GEM initializes or when KMS is detected. Reviewed-by: Eric Anholt <eric@anholt.net> Tested-by: Magnus Kessler <Magnus.Kessler@gmx.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-05-12Load i915 and fbcon when checking for KMSKeith Packard
Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net>
2009-05-12Remove the offset parameter from i830_allocator_init()Wu Fengguang
offset is redundant. i830_allocator_init() is only called in one place with offset=0. Acked-by: Magnus Kessler <Magnus.Kessler@gmx.net> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Eric Anholt <eric@anholt.net>