summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2000-05-03file sysctl.c was initially added on branch bsd-1-0-0-branch.Brian Paul
2000-05-03file tdfx_context.c was initially added on branch bsd-1-0-0-branch.Brian Paul
2000-05-03file tdfx_drv.h was initially added on branch bsd-1-0-0-branch.Brian Paul
2000-05-03file vm.c was initially added on branch bsd-1-0-0-branch.Brian Paul
2000-04-20Merged glxmisc-1-0-0Brian Paul
2000-04-15file r128_bufs.c was initially added on branch ati-4-0-1-branch.Kevin E Martin
2000-04-12file r128_dma.c was initially added on branch ati-4-0-1-branch.Kevin E Martin
2000-04-12file r128_drm.h was initially added on branch ati-4-0-1-branch.Kevin E Martin
2000-04-09Only enable DRI for 16bpp mode. Allow GL_BLEND if color is 0,0,0,1 WrapDaryll Strauss
2000-04-05Fixed reclaim OopsJeff Hartmann
2000-04-04Merged mga branch with trunkJeff Hartmann
2000-03-31file mga_drm.h was initially added on branch mga-0-0-2-branch.Jeff Hartmann
2000-03-31file i810_drm.h was initially added on branch mga-0-0-2-branch.Jeff Hartmann
2000-03-16Merge with 4.0Jeff Hartmann
2000-03-15Import of XFree86 4.0Jeff Hartmann
2000-02-223.9.18 mergeKevin E Martin
2000-02-22Import of XFree86 3.9.18Kevin E Martin
2000-02-13file i810_clear.c was initially added on branch mga-0-0-1-branch.Keith Whitwell
2000-02-13file i810_dma.h was initially added on branch mga-0-0-1-branch.Keith Whitwell
2000-02-12file Makefile.linuxpoll was initially added on branch mga-0-0-1-branch.Jeff Hartmann
2000-02-12file mga_dmapoll.c was initially added on branch mga-0-0-1-branch.Jeff Hartmann
2000-02-12file i810_drm_public.h was initially added on branch mga-0-0-1-branch.Jeff Hartmann
2000-02-06file mga_state.h was initially added on branch mga-0-0-1-branch.Keith Whitwell
2000-02-04file mga_dma.h was initially added on branch mga-0-0-1-branch.Keith Whitwell
2000-02-04file mga_clear.c was initially added on branch mga-0-0-1-branch.Keith Whitwell
2000-01-28Fixed freelist_put bugJeff Hartmann
2000-01-27file mga_state.c was initially added on branch mga-0-0-1-branch.Jeff Hartmann
2000-01-27file mga_drm_public.h was initially added on branch mga-0-0-1-branch.Jeff Hartmann
2000-01-19file mgareg_flags.h was initially added on branch mga-0-0-1-branch.Jeff Hartmann
2000-01-17Try a more complex (and more correct?) method for finding kernel inlcudeRik Faith
2000-01-15Remove -g from build Fix lost code from tdfx-1-1 merge in tdfx_priv.c LowerDaryll Strauss
2000-01-13Add new code to do SMP/MODVERSIONS detection for more distributionsRik Faith
2000-01-12Add a drm_poll function to the tdfx driver. This fixes the problem withDaryll Strauss
2000-01-08file i810_dma.c was initially added on branch mga-0-0-1-branch.Jeff Hartmann
2000-01-08file i810_drv.h was initially added on branch mga-0-0-1-branch.Jeff Hartmann
2000-01-08file i810_drv.c was initially added on branch mga-0-0-1-branch.Jeff Hartmann
2000-01-08file i810_bufs.c was initially added on branch mga-0-0-1-branch.Jeff Hartmann
2000-01-08file i810_context.c was initially added on branch mga-0-0-1-branch.Jeff Hartmann
2000-01-07Merge between X_3_9_16 and X_3_9_17 Compiles but may not run.Rik Faith
2000-01-06file mga_bufs.c was initially added on branch mga-0-0-1-branch.Jeff Hartmann
2000-01-06file mga_context.c was initially added on branch mga-0-0-1-branch.Jeff Hartmann
2000-01-06file ctxbitmap.c was initially added on branch mga-0-0-1-branch.Jeff Hartmann
2000-01-06Import of XFree86 3.9.17Rik Faith
1999-12-18Rename the device to be /dev/dri instead of /dev/dri to avoid a conflict.Daryll Strauss
1999-12-17file agpsupport.c was initially added on branch ati-4-0-0-branch.Rik Faith
1999-12-17file r128_drv.c was initially added on branch ati-4-0-0-branch.Rik Faith
1999-12-17file r128_context.c was initially added on branch ati-4-0-0-branch.Rik Faith
1999-12-17file r128_drv.h was initially added on branch ati-4-0-0-branch.Rik Faith
1999-12-15file mga_drv.c was initially added on branch mga-0-0-1-branch.Jeff Hartmann
1999-12-15file mga_dma.c was initially added on branch mga-0-0-1-branch.Jeff Hartmann
5' href='#n375'>375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 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
/**
 * \file xf86drm.h 
 * OS-independent header for DRM user-level library interface.
 *
 * \author Rickard E. (Rik) Faith <faith@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
 * PRECISION INSIGHT 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.
 *
 */

#ifndef _XF86DRM_H_
#define _XF86DRM_H_

#include <stdarg.h>
#include <sys/types.h>
#include <stdint.h>
#include <drm.h>

				/* Defaults, if nothing set in xf86config */
#define DRM_DEV_UID	 0
#define DRM_DEV_GID	 0
/* Default /dev/dri directory permissions 0755 */
#define DRM_DEV_DIRMODE	 	\
	(S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
#define DRM_DEV_MODE	 (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)

#define DRM_DIR_NAME  "/dev/dri"
#define DRM_DEV_NAME  "%s/card%d"
#define DRM_PROC_NAME "/proc/dri/" /* For backward Linux compatibility */

#define DRM_ERR_NO_DEVICE  (-1001)
#define DRM_ERR_NO_ACCESS  (-1002)
#define DRM_ERR_NOT_ROOT   (-1003)
#define DRM_ERR_INVALID    (-1004)
#define DRM_ERR_NO_FD      (-1005)

#define DRM_AGP_NO_HANDLE 0

typedef unsigned int  drmSize,     *drmSizePtr;	    /**< For mapped regions */
typedef void          *drmAddress, **drmAddressPtr; /**< For mapped regions */

typedef struct _drmServerInfo {
  int (*debug_print)(const char *format, va_list ap);
  int (*load_module)(const char *name);
  void (*get_perms)(gid_t *, mode_t *);
} drmServerInfo, *drmServerInfoPtr;

typedef struct drmHashEntry {
    int      fd;
    void     (*f)(int, void *, void *);
    void     *tagTable;
} drmHashEntry;

extern void *drmGetHashTable(void);
extern drmHashEntry *drmGetEntry(int fd);

/**
 * Driver version information.
 *
 * \sa drmGetVersion() and drmSetVersion().
 */
typedef struct _drmVersion {
    int     version_major;        /**< Major version */
    int     version_minor;        /**< Minor version */
    int     version_patchlevel;   /**< Patch level */
    int     name_len; 	          /**< Length of name buffer */
    char    *name;	          /**< Name of driver */
    int     date_len;             /**< Length of date buffer */
    char    *date;                /**< User-space buffer to hold date */
    int     desc_len;	          /**< Length of desc buffer */
    char    *desc;                /**< User-space buffer to hold desc */
} drmVersion, *drmVersionPtr;

typedef struct _drmStats {
    unsigned long count;	     /**< Number of data */
    struct {
	unsigned long value;	     /**< Value from kernel */
	const char    *long_format;  /**< Suggested format for long_name */
	const char    *long_name;    /**< Long name for value */
	const char    *rate_format;  /**< Suggested format for rate_name */
	const char    *rate_name;    /**< Short name for value per second */
	int           isvalue;       /**< True if value (vs. counter) */
	const char    *mult_names;   /**< Multiplier names (e.g., "KGM") */
	int           mult;          /**< Multiplier value (e.g., 1024) */
	int           verbose;       /**< Suggest only in verbose output */
    } data[15];
} drmStatsT;


				/* All of these enums *MUST* match with the
                                   kernel implementation -- so do *NOT*
                                   change them!  (The drmlib implementation
                                   will just copy the flags instead of
                                   translating them.) */
typedef enum {
    DRM_FRAME_BUFFER    = 0,      /**< WC, no caching, no core dump */
    DRM_REGISTERS       = 1,      /**< no caching, no core dump */
    DRM_SHM             = 2,      /**< shared, cached */
    DRM_AGP             = 3,	  /**< AGP/GART */
    DRM_SCATTER_GATHER  = 4,	  /**< PCI scatter/gather */
    DRM_CONSISTENT      = 5	  /**< PCI consistent */
} drmMapType;

typedef enum {
    DRM_RESTRICTED      = 0x0001, /**< Cannot be mapped to client-virtual */
    DRM_READ_ONLY       = 0x0002, /**< Read-only in client-virtual */
    DRM_LOCKED          = 0x0004, /**< Physical pages locked */
    DRM_KERNEL          = 0x0008, /**< Kernel requires access */
    DRM_WRITE_COMBINING = 0x0010, /**< Use write-combining, if available */
    DRM_CONTAINS_LOCK   = 0x0020, /**< SHM page that contains lock */
    DRM_REMOVABLE	= 0x0040  /**< Removable mapping */
} drmMapFlags;

/**
 * \warning These values *MUST* match drm.h
 */
typedef enum {
    /** \name Flags for DMA buffer dispatch */
    /*@{*/
    DRM_DMA_BLOCK        = 0x01, /**< 
				  * Block until buffer dispatched.
				  * 
				  * \note the buffer may not yet have been
				  * processed by the hardware -- getting a
				  * hardware lock with the hardware quiescent
				  * will ensure that the buffer has been
				  * processed.
				  */
    DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */
    DRM_DMA_PRIORITY     = 0x04, /**< High priority dispatch */
    /*@}*/

    /** \name Flags for DMA buffer request */
    /*@{*/
    DRM_DMA_WAIT         = 0x10, /**< Wait for free buffers */
    DRM_DMA_SMALLER_OK   = 0x20, /**< Smaller-than-requested buffers OK */
    DRM_DMA_LARGER_OK    = 0x40  /**< Larger-than-requested buffers OK */
    /*@}*/
} drmDMAFlags;

typedef enum {
    DRM_PAGE_ALIGN       = 0x01,
    DRM_AGP_BUFFER       = 0x02,
    DRM_SG_BUFFER        = 0x04,
    DRM_FB_BUFFER        = 0x08,
    DRM_PCI_BUFFER_RO    = 0x10
} drmBufDescFlags;

typedef enum {
    DRM_LOCK_READY      = 0x01, /**< Wait until hardware is ready for DMA */
    DRM_LOCK_QUIESCENT  = 0x02, /**< Wait until hardware quiescent */
    DRM_LOCK_FLUSH      = 0x04, /**< Flush this context's DMA queue first */
    DRM_LOCK_FLUSH_ALL  = 0x08, /**< Flush all DMA queues first */
				/* These *HALT* flags aren't supported yet
                                   -- they will be used to support the
                                   full-screen DGA-like mode. */
    DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */
    DRM_HALT_CUR_QUEUES = 0x20  /**< Halt all current queues */
} drmLockFlags;

typedef enum {
    DRM_CONTEXT_PRESERVED = 0x01, /**< This context is preserved and
				     never swapped. */
    DRM_CONTEXT_2DONLY    = 0x02  /**< This context is for 2D rendering only. */
} drm_context_tFlags, *drm_context_tFlagsPtr;

typedef struct _drmBufDesc {