summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2007-11-06i915: disable TTM on 8xx chips for now until flushing is solvedDave Airlie
2007-11-06i915: compat code doesn't work in i8xx hw.Dave Airlie
2007-11-06[PATCH] i915: fix missing G33 detect in IS_I9XXZhenyu Wang
G33 detect seems missing with Jesse's suspend/resume patch.
2007-11-06drm/agp: kernel style fixesDave Airlie
2007-11-06i915: cleanup most of the whitespaceDave Airlie
2007-11-05Export a symbol.Thomas Hellstrom
2007-11-05Fix a user-buffer check.Thomas Hellstrom
2007-11-05drm: more kernel coding style cleanupsDave Airlie
2007-11-05drm/ttm: apply linux kernel coding style to bo_lock/move/object/ttm.cDave Airlie
2007-11-05drm/ttm: kernel coding style for bo.c and objects.hDave Airlie
2007-11-05drm: fix the the typoDave Airlie
2007-11-05drm: fix memset size errorLi Zefan
The size passing to memset is wrong. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
2007-11-05drm: update kernel generator script using v4l scriptDave Airlie
2007-11-05drm: remove lots of spurious whitespace.Dave Airlie
Kernel "cleanfile" script run.
2007-11-05drm: move some of the OS stuff into the OS headerDave Airlie
2007-11-04nouveau: more nv20_graph_init.Pekka Paalanen
This patch is originally from malc0_, but since it used some NV40_* regs, I edited them into hex values with a comment. This seems to correspond quite well with my own mmio-trace, for the parts I cared to check.
2007-11-05nouveau: Use a sw method instead of notify interrupt to signal fence completion.Ben Skeggs
2007-11-05nouveau: disable m2mf buffer move for the momentBen Skeggs
2007-11-05Fill fence sequence after emit ioctl.Ben Skeggs
2007-11-05nouveau: cleanupsBen Skeggs
2007-11-05nouveau: only pass annoying messages if irq isn't handled fully.Ben Skeggs
2007-11-05nouveau: vram is bar1Ben Skeggs
2007-11-05nouveau: hook up an inital fence irq handlerBen Skeggs
2007-11-05nouveau: crappy ttm mm init, disabled for now.Ben Skeggs
2007-11-04drm: fix oops since user objects..Dave Airlie
2007-11-02nouveau: add darktama's email address to authors section.Jeremy Kolb
2007-11-02nouveau: put it all together.Jeremy Kolb
2007-11-02nouveau: Add darktama's fencing code. Restructure some stuff.Jeremy Kolb
2007-11-02nouveau: incorporate darktama's buffer object work.Jeremy Kolb
2007-11-02nouveau: more filling in for ttm. Change copyright since it's based off of ↵Jeremy Kolb
radeon code.
2007-11-02User buffer support.Thomas Hellstrom
2007-11-02Return fence errors.Thomas Hellstrom
Time out properly in the presence of signals.
2007-11-03radeon: set the address to access the aperture on the CPU side correctlyDave Airlie
This code relied on the CPU and GPU address for the aperture being the same, On some r5xx hardware I was playing with I noticed that this isn't always true. I wonder if this will fix some of those r4xx DRI issues we've seen in the past.
2007-11-01Use unsigned long instead of u64 in drm_modeset_ctl_tJesse Barnes
A bad idea, ABI-wise, but we're going to be changing this structure anyway before we merge upstream, so just fix the build for now.
2007-11-01Cleanup vblank_init and fix drm_irq_installJesse Barnes
The vblank_init function wanted a couple of cleanups. Also, drm_irq_install wasn't checking the new return value of irq_postinstall. If it returns a failure, assume IRQs didn't get set up and take appropriate action.
2007-11-01nouveau: don't use AGP on PPC. It's a hopeless case.Stephane Marchesin
2007-10-31nouveau: add missing file.Jeremy Kolb
2007-10-31Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drmJeremy Kolb
2007-10-31nouveau: ttm stubsJeremy Kolb
2007-11-01drm/ttm: add support for cached un-snooped mappings.Dave Airlie
This mapping allows cached objects to be mapped in/out of the TT space with the appropriate flushing calls. It should put back the old CACHED functionality for snooped mappings
2007-11-01i915: fix compat code on 965/g33Dave Airlie
2007-10-31drm: add chipset flushing via agp supportDave Airlie
2007-10-31i915: add backwards compat chipset flushing codeDave Airlie
2007-10-31drm: call driver load after initing agp subsystemDave Airlie
2007-10-30Merge branch 'master' into vblank-rework, fixup remaining driversJesse Barnes
Conflicts: linux-core/drmP.h linux-core/drm_drv.c linux-core/drm_irq.c shared-core/i915_drv.h shared-core/i915_irq.c shared-core/mga_drv.h shared-core/mga_irq.c shared-core/radeon_drv.h shared-core/radeon_irq.c Merge in the latest master bits and update the remaining drivers (except mach64 which math_b is working on). Also remove the 9xx hack from the i915 driver; it seems to be correct.
2007-10-30Nouveau: add a comment about SKIPS for next API breakage.Stephane Marchesin
2007-10-30Nouveau: fold some loops.Stephane Marchesin
2007-10-30drm/i915: add driver cache flush entry pointDave Airlie
Use clflush on Intel hardware to flush cached objects.
2007-10-29Move struct drm_drawable_info out of public header file.Kristian Høgsberg
2007-10-29Remove unused memory save areasJesse Barnes
These need to be kmalloc'd separately anyway or we may hit kmalloc size limits.
/a> 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725
/* drm_context.h -- IOCTLs for generic contexts -*- linux-c -*-
 * Created: Fri Nov 24 18:31:37 2000 by gareth@valinux.com
 *
 * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
 * All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * Authors:
 *    Rickard E. (Rik) Faith <faith@valinux.com>
 *    Gareth Hughes <gareth@valinux.com>
 */

#include "drmP.h"

#if __HAVE_CTX_BITMAP

/* ================================================================
 * Context bitmap support
 */

void DRM(ctxbitmap_free)( drm_device_t *dev, int ctx_handle )
{
	if ( ctx_handle < 0 ) goto failed;
	if ( !dev->ctx_bitmap ) goto failed;

	if ( ctx_handle < DRM_MAX_CTXBITMAP ) {
		DRM_LOCK;
		clear_bit( ctx_handle, dev->ctx_bitmap );
		dev->context_sareas[ctx_handle] = NULL;
		DRM_UNLOCK;
		return;
	}
failed:
       	DRM_ERROR( "Attempt to free invalid context handle: %d\n",
		   ctx_handle );
       	return;
}

int DRM(ctxbitmap_next)( drm_device_t *dev )
{
	int bit;

	if(!dev->ctx_bitmap) return -1;

	DRM_LOCK;
	bit = find_first_zero_bit( dev->ctx_bitmap, DRM_MAX_CTXBITMAP );
	if ( bit < DRM_MAX_CTXBITMAP ) {
		set_bit( bit, dev->ctx_bitmap );
	   	DRM_DEBUG( "drm_ctxbitmap_next bit : %d\n", bit );
		if((bit+1) > dev->max_context) {
			dev->max_context = (bit+1);
			if(dev->context_sareas) {
				drm_local_map_t **ctx_sareas;

				ctx_sareas = DRM(realloc)(dev->context_sareas,
						(dev->max_context - 1) * 
						sizeof(*dev->context_sareas),
						dev->max_context * 
						sizeof(*dev->context_sareas),
						DRM_MEM_MAPS);
				if(!ctx_sareas) {
					clear_bit(bit, dev->ctx_bitmap);
					DRM_UNLOCK;
					return -1;
				}
				dev->context_sareas = ctx_sareas;
				dev->context_sareas[bit] = NULL;
			} else {
				/* max_context == 1 at this point */
				dev->context_sareas = DRM(alloc)(
						dev->max_context * 
						sizeof(*dev->context_sareas),
						DRM_MEM_MAPS);
				if(!dev->context_sareas) {
					clear_bit(bit, dev->ctx_bitmap);
					DRM_UNLOCK;
					return -1;
				}
				dev->context_sareas[bit] = NULL;
			}
		}
		DRM_UNLOCK;