summaryrefslogtreecommitdiff
path: root/linux-core
AgeCommit message (Collapse)Author
2008-06-02drm: add functions to get/set gamma rampsDave Airlie
2008-06-02Merge branch 'modesetting-101-encoders' into modesetting-101Dave Airlie
2008-06-02drm: fixup encoder picking in set_config stageDave Airlie
2008-06-02drm/modesetting: add best encoder finding for modesettingDave Airlie
This asks the driver to suggest the best encoder for the connector during the pick crtcs stage. Need to also do this during mode setting stages
2008-06-02drm/modesetting: move some connector functions to helper.Dave Airlie
Migrated the output mode collection into the helper.
2008-06-02drm: fixup some interfaces so test code works againDave Airlie
2008-06-02drm/modesetting: another re-org of some internals.Dave Airlie
Move dpms into the helper functions. Move crtc into the encoder. Move disable unused functions into the helper.
2008-05-30Merge commit 'origin/master' into drm-gemEric Anholt
Conflicts: linux-core/Makefile.kernel shared-core/i915_drv.h shared-core/nouveau_state.c
2008-05-30[intel-gem] Only update obj->write_domain if we're actually changing it.Eric Anholt
The problem was revealed where on 965, the display list vertex buffer would see: create -> (CPU, CPU) set_domain (CPU, CPU) -> (CPU, CPU) set_comain (CPU, 0) -> (CPU, 0) (no clflush occurred) execbuf (GPU, 0) -> (CPU+GPU, 0) (still no clflush) instead of: create -> (CPU, CPU) set_domain (CPU, CPU) -> (CPU, CPU) set_comain (CPU, 0) -> (CPU, CPU) execbuf (GPU, 0) -> (CPU+GPU, 0) (clflushed)
2008-05-30[intel-gem] Add an option to check GTT versus CPU coherency at execbuf time.Eric Anholt
2008-05-30Fix ivch i2c read function to use the "special" i2c format.Kristian Høgsberg
2008-05-30drm: switch possible crtc/clones over to encodersDave Airlie
2008-05-30modesetting: the great renaming.Dave Airlie
Okay we have crtc, encoder and connectors. No more outputs exposed beyond driver internals I've broken intel tv connector stuff. Really for TV we should have one TV connector, with a sub property for the type of signal been driven over it
2008-05-30drm: attach an encoder.Dave Airlie
Time to do some renaming on the connectors I think
2008-05-30drm: add encoder attach/detachDave Airlie
2008-05-30drm: init the encoder list/countDave Airlie
2008-05-30drm: add red hat copyright.Dave Airlie
2008-05-30drm: add encoder ids to the output handlingDave Airlie
2008-05-30drm: add encoder / get encoder to the modesetting resources interfaceDave Airlie
2008-05-30drm: remove unused init func from outputsDave Airlie
2008-05-30drm/modesetting: add initial encoder structures and setup functionsDave Airlie
2008-05-30modesetting: reorganise out crtc/outputs are allocated.Dave Airlie
Use subclassing from the drivers to allocate the objects. This saves two objects being allocated for each crtc/output and generally makes exit paths cleaner.
2008-05-29[intel-gem] Write the presumed_offset back out after updating it.Eric Anholt
Otherwise, 965 constant state buffers get re-relocated every exec. Ouch.
2008-05-28[intel-gem] Clean up active/inactive/flushing list debugging.Keith Packard
2008-05-29modesetting: reorganise code into core and helper functions.Dave Airlie
This splits a lot of the core modesetting code out into a file of helper functions, that are only called from themselves and/or the driver. The driver gets called into more often or can call these functions from itself if it is a helper using driver. I've broken framebuffer resize doing this but I didn't like the API for that in any case.
2008-05-29modeset: disable radeon ms by defaultDave Airlie
as I'm going to break it.
2008-05-28Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into ↵Alan Hourihane
modesetting-101 Conflicts: shared-core/i915_dma.c shared-core/i915_drv.h
2008-05-28i915: unmap BIOS when we're done with itJesse Barnes
At the moment, we only read it at startup time, so we can just unmap it there when we're done.
2008-05-28radeon: split microcode out into a separate header file.Dave Airlie
2008-05-27[intel-gem] Replace idlelock usage with real lock acquisition.Eric Anholt
2008-05-26[intel-gem] Must hold DRM lock while setting object domainKeith Packard
Object domain transfer can involve adding flush ops to the request queue, and so the DRM lock must be held to avoid having the X server smash pointers badly.
2008-05-26[i915] leave interrupts masked off when not in use.Keith Packard
The interrupt enable register cannot be used to temporarily disable interrupts, instead use the interrupt mask register. Note that this change means that a pile of buffers will be left stuck on the chip as the final interrupts will not be recognized to come and drain things.
2008-05-25[intel-gem] Add DRM_I915_GEM_BUSY ioctl to check for idle buffers.Keith Packard
This new ioctl returns whether re-using the buffer would force a wait.
2008-05-25[intel-gem] Compute npages instead of nbytes in flush_pwriteKeith Packard
i915_gem_flush_pwrite optimizes short writes to the buffer by clflushing only the modified pages, but it was miscomputing the number of pages.
2008-05-25[intel-gem] replace call to jiffies_to-msec with simple inlineKeith Packard
2008-05-23i915: do a better job of parsing VBIOS dataJesse Barnes
Add code to get panel modes from the VBIOS if present and check whether certain outputs exist. Should make our display detection code a little more robust.
2008-05-23drm_mode_debug_printmodeline doesn't need struct drm_device *Jesse Barnes
Makes printing modelines from some routines easier.
2008-05-22[intel-gem] Encourage multiple caches to hold read dataKeith Packard
When reading from multiple domains, allow each cache to continue to hold data until writes occur somewhere. This is done by first leaving the read_domains alone at bind time (presumably the CPU read cache contains valid data still) and then in set_domain, if no write_domain is specified, the new read domains are simply merged into the existing read domains. A huge comment was added above set_domain to explain how things are expected to work.
2008-05-22[gem] Use CPU domain for new or pageable objectsKeith Packard
Newly allocated objects need to be in the CPU domain as they've just been cleared by the CPU. Also, unmapping objects from the GTT needs to put them into the CPU domain, both to flush rendering as well as to ensure that any paging action gets flushed before we remap to the GTT.
2008-05-22[intel-gem] Force ring retire by emiting flush before user-interrupt.Keith Packard
Commands in the ring are parsed and started when the head pointer passes by them, but they are not necessarily finished until a MI_FLUSH happens. This patch inserts a flush after the execbuffer (the only place a flush wasn't already happening).
2008-05-22[intel-gem] invalidate ring locals for pin/unpin/set_domain/free functionsKeith Packard
Ring locals must be reloaded from hardware in case the X server ran.
2008-05-22[gem] Release GEM buffers from work task scheduled from IRQ.Eric Anholt
There are now 3 lists. Active is buffers currently in the ringbuffer. Flushing is not in the ringbuffer, but needs a flush before unbinding. Inactive is as before. This prevents object_free → unbind → wait_rendering → object_reference and a kernel oops about weird refcounting. This also avoids an synchronous extra flush and wait when freeing a buffer which had a write_domain set (such as a temporary rendered to and then from using the 2d engine). It will sit around on the flushing list until the appropriate flush gets emitted, or we need the GTT space for another operation.
2008-05-22i915: check dummy page before freeingHong Liu
The dummy read page will point to NULL if drm_bo_driver_init failed at firstopen (modeset is not enabled), and will cause kernel oops at subsequent drm_lastclose call, so be sure to check it.
2008-05-21[gem] Replace ring throttling hack with actual time measurement.Eric Anholt
2008-05-21[gem] Fix bad test for list_for_each completion.Eric Anholt
Since it's a circular list, the entry won't be NULL at termination.
2008-05-21[gem] Hold a reference on the object in i915_gem_wait_space.Eric Anholt
Otherwise, in the middle of the function called using it the last ref might disappear.
2008-05-21[intel-gem] invalidate ring locals for pin/unpin/set_domain/free functionsKeith Packard
Ring locals must be reloaded from hardware in case the X server ran.
2008-05-20[gem] Use a separate sequence number field from classic/ttmEric Anholt
This lets us get some qualities we desire, such as using the full 32-bit range (except zero), avoiding DRM_WAIT_ON, and a 1:1 mapping of active sequence numbers to request structs, which will be used soon for throttling and interrupt-driven list cleanup.
2008-05-20[gem] Rename sequence numbers from "cookie" to "seqno"Eric Anholt
2008-05-20[gem] Clean up active/inactive list handling using helper functions.Eric Anholt
Additionally, a boolean active field is added to indicate which list an object is on, rather than smashing last_rendering_cookie to 0 to show inactive. This will help with flush-reduction later on, and makes the code clearer.
an> } drm_map_t; typedef enum drm_lock_flags { _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 */ } drm_lock_flags_t; typedef struct drm_lock { int context; drm_lock_flags_t flags; } drm_lock_t; typedef enum drm_dma_flags { /* These values *MUST* match xf86drm.h */ /* 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 */ /* 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 */ } drm_dma_flags_t; typedef struct drm_buf_desc { int count; /* Number of buffers of this size */ int size; /* Size in bytes */ int low_mark; /* Low water mark */ int high_mark; /* High water mark */ enum { _DRM_PAGE_ALIGN = 0x01, /* Align on page boundaries for DMA */ _DRM_AGP_BUFFER = 0x02 /* Buffer is in agp space */ } flags; unsigned long agp_start; /* Start address of where the agp buffers * are in the agp aperture */ } drm_buf_desc_t; typedef struct drm_buf_info { int count; /* Entries in list */ drm_buf_desc_t *list; } drm_buf_info_t; typedef struct drm_buf_free { int count; int *list; } drm_buf_free_t; typedef struct drm_buf_pub { int idx; /* Index into master buflist */ int total; /* Buffer size */ int used; /* Amount of buffer in use (for DMA) */ void *address; /* Address of buffer */ } drm_buf_pub_t; typedef struct drm_buf_map { int count; /* Length of buflist */ void *virtual; /* Mmaped area in user-virtual */ drm_buf_pub_t *list; /* Buffer information */ } drm_buf_map_t; typedef struct drm_dma { /* Indices here refer to the offset into buflist in drm_buf_get_t. */ int context; /* Context handle */ int send_count; /* Number of buffers to send */ int *send_indices; /* List of handles to buffers */ int *send_sizes; /* Lengths of data to send */ drm_dma_flags_t flags; /* Flags */ int request_count; /* Number of buffers requested */ int request_size; /* Desired size for buffers */ int *request_indices; /* Buffer information */ int *request_sizes; int granted_count; /* Number of buffers granted */ } drm_dma_t; typedef enum { _DRM_CONTEXT_PRESERVED = 0x01, _DRM_CONTEXT_2DONLY = 0x02 } drm_ctx_flags_t; typedef struct drm_ctx { drm_context_t handle; drm_ctx_flags_t flags; } drm_ctx_t; typedef struct drm_ctx_res { int count; drm_ctx_t *contexts; } drm_ctx_res_t; typedef struct drm_draw { drm_drawable_t handle; } drm_draw_t; typedef struct drm_auth { drm_magic_t magic; } drm_auth_t; typedef struct drm_irq_busid { int irq; int busnum; int devnum; int funcnum; } drm_irq_busid_t; typedef struct drm_agp_mode { unsigned long mode; } drm_agp_mode_t; /* For drm_agp_alloc -- allocated a buffer */ typedef struct drm_agp_buffer { unsigned long size; /* In bytes -- will round to page boundary */ unsigned long handle; /* Used for BIND/UNBIND ioctls */ unsigned long type; /* Type of memory to allocate */ unsigned long physical; /* Physical used by i810 */ } drm_agp_buffer_t; /* For drm_agp_bind */ typedef struct drm_agp_binding { unsigned long handle; /* From drm_agp_buffer */ unsigned long offset; /* In bytes -- will round to page boundary */ } drm_agp_binding_t; typedef struct drm_agp_info { int agp_version_major; int agp_version_minor; unsigned long mode; unsigned long aperture_base; /* physical address */ unsigned long aperture_size; /* bytes */ unsigned long memory_allowed; /* bytes */ unsigned long memory_used; /* PCI information */ unsigned short id_vendor; unsigned short id_device; } drm_agp_info_t; #define DRM_IOCTL_BASE 'd' #define DRM_IOCTL_NR(n) ((n) & 0xff) #define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) #define DRM_IOR(nr,size) _IOR(DRM_IOCTL_BASE,nr,size) #define DRM_IOW(nr,size) _IOW(DRM_IOCTL_BASE,nr,size) #define DRM_IOWR(nr,size) _IOWR(DRM_IOCTL_BASE,nr,size) #define DRM_IOCTL_VERSION DRM_IOWR(0x00, drm_version_t) #define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, drm_unique_t) #define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, drm_auth_t) #define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, drm_irq_busid_t) #define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, drm_unique_t) #define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, drm_auth_t) #define DRM_IOCTL_BLOCK DRM_IOWR(0x12, drm_block_t) #define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, drm_block_t) #define DRM_IOCTL_CONTROL DRM_IOW( 0x14, drm_control_t) #define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, drm_map_t) #define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, drm_buf_desc_t) #define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, drm_buf_desc_t) #define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, drm_buf_info_t) #define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, drm_buf_map_t) #define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, drm_buf_free_t) #define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, drm_ctx_t) #define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, drm_ctx_t) #define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, drm_ctx_t) #define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, drm_ctx_t) #define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, drm_ctx_t) #define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, drm_ctx_t) #define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, drm_ctx_res_t) #define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, drm_draw_t) #define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, drm_draw_t) #define DRM_IOCTL_DMA DRM_IOWR(0x29, drm_dma_t) #define DRM_IOCTL_LOCK DRM_IOW( 0x2a, drm_lock_t) #define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, drm_lock_t) #define DRM_IOCTL_FINISH DRM_IOW( 0x2c, drm_lock_t) #define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30) #define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31) #define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, drm_agp_mode_t) #define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, drm_agp_info_t) #define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, drm_agp_buffer_t) #define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, drm_agp_buffer_t) #define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, drm_agp_binding_t) #define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, drm_agp_binding_t) /* Mga specific ioctls */ #define DRM_IOCTL_MGA_INIT DRM_IOW( 0x40, drm_mga_init_t) #define DRM_IOCTL_MGA_SWAP DRM_IOW( 0x41, drm_mga_swap_t) #define DRM_IOCTL_MGA_CLEAR DRM_IOW( 0x42, drm_mga_clear_t) #define DRM_IOCTL_MGA_ILOAD DRM_IOW( 0x43, drm_mga_iload_t) #define DRM_IOCTL_MGA_VERTEX DRM_IOW( 0x44, drm_mga_vertex_t) #define DRM_IOCTL_MGA_FLUSH DRM_IOW( 0x45, drm_lock_t ) #define DRM_IOCTL_MGA_INDICES DRM_IOW( 0x46, drm_mga_indices_t) /* I810 specific ioctls */ #define DRM_IOCTL_I810_INIT DRM_IOW( 0x40, drm_i810_init_t) #define DRM_IOCTL_I810_VERTEX DRM_IOW( 0x41, drm_i810_vertex_t) #define DRM_IOCTL_I810_CLEAR DRM_IOW( 0x42, drm_i810_clear_t) #define DRM_IOCTL_I810_FLUSH DRM_IO ( 0x43) #define DRM_IOCTL_I810_GETAGE DRM_IO ( 0x44) #define DRM_IOCTL_I810_GETBUF DRM_IOWR(0x45, drm_i810_dma_t) #define DRM_IOCTL_I810_SWAP DRM_IO ( 0x46) /* Rage 128 specific ioctls */ #define DRM_IOCTL_R128_INIT DRM_IOW( 0x40, drm_r128_init_t) #define DRM_IOCTL_R128_RESET DRM_IO( 0x41) #define DRM_IOCTL_R128_FLUSH DRM_IO( 0x42) #define DRM_IOCTL_R128_CCEIDL DRM_IO( 0x43) #define DRM_IOCTL_R128_PACKET DRM_IOW( 0x44, drm_r128_packet_t) #define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x45, drm_r128_vertex_t) #endif