summaryrefslogtreecommitdiff
path: root/shared-core/savage_drv.h
AgeCommit message (Expand)Author
2007-11-05drm: remove lots of spurious whitespace.Dave Airlie
2007-07-20Replace DRM_IOCTL_ARGS with (dev, data, file_priv) and remove DRM_DEVICE.Eric Anholt
2007-07-20Replace filp in ioctl arguments with drm_file *file_priv.Eric Anholt
2007-07-16drm: remove drm_buf_tDave Airlie
2007-07-16drm: remove drmP.h internal typedefsDave Airlie
2007-07-16drm: detypedef drm.h and fixup all problemsDave Airlie
2006-12-19make a savage function static from kernelDave Airlie
2005-11-28Assert an MIT copyright on sis_drm.h, since one was lacking and I createdEric Anholt
2005-11-11cleanup ioctl/max_ioctl to use header file for extern symbolsDave Airlie
2005-11-08Correct a LOR issue on FreeBSD by allocating temporary space and doing aEric Anholt
2005-08-07make some functions static in the savage drm driverDave Airlie
2005-08-05Rename the driver hooks in the DRM to something a little moreEric Anholt
2005-03-13Command DMA optimizations:Felix Kuehling
2005-03-07Tracked down random lockups related to command DMA that occurred in Quake3Felix Kuehling
2005-03-06Added support for command DMA on Savage4-based hardware. UnfortunatelyFelix Kuehling
2005-02-23Use wrap counter to extend 16-bit hardware event tags to 32-bit logicalFelix Kuehling
2005-01-20Corrected some confusion of vb_stride and vtx_sizeFelix Kuehling
2005-01-16Fixed a bug that prevented the driver from ever emitting triangle strips orFelix Kuehling
2005-01-15Setup MTRRs for frame buffer and aperture manually on Savage3D andFelix Kuehling
2005-01-10Only try to find the agp_buffer_map if dma_type is AGP. This is all that'sFelix Kuehling
2005-01-09Improved workaround for Savage3D DMA lockup to emit NOPs only before theFelix Kuehling
2005-01-053D scissor regs are now managed by the DRM to iterate over clip rectsFelix Kuehling
2005-01-05Fixed the DMA buffer age test. Should fix occasional "soft" lockups. BumpedFelix Kuehling
2005-01-01Completeley rewritten Savage DRM which can be considered secure (moduloFelix Kuehling
nclude "drmtest.h" static void set_draw_cliprects_empty(int fd, int drawable) { int ret; struct drm_update_draw update; update.handle = drawable; update.type = DRM_DRAWABLE_CLIPRECTS; update.num = 0; update.data = 0; ret = ioctl(fd, DRM_IOCTL_UPDATE_DRAW, &update); assert(ret == 0); } static void set_draw_cliprects_empty_fail(int fd, int drawable) { int ret; struct drm_update_draw update; update.handle = drawable; update.type = DRM_DRAWABLE_CLIPRECTS; update.num = 0; update.data = 0; ret = ioctl(fd, DRM_IOCTL_UPDATE_DRAW, &update); assert(ret == -1 && errno == EINVAL); } static void set_draw_cliprects_2(int fd, int drawable) { int ret; struct drm_update_draw update; drm_clip_rect_t rects[2]; rects[0].x1 = 0; rects[0].y1 = 0; rects[0].x2 = 10; rects[0].y2 = 10; rects[1].x1 = 10; rects[1].y1 = 10; rects[1].x2 = 20; rects[1].y2 = 20; update.handle = drawable; update.type = DRM_DRAWABLE_CLIPRECTS; update.num = 2; update.data = (unsigned long long)(uintptr_t)&rects; ret = ioctl(fd, DRM_IOCTL_UPDATE_DRAW, &update); assert(ret == 0); } static int add_drawable(int fd) { drm_draw_t drawarg; int ret; /* Create a drawable. * IOCTL_ADD_DRAW is RDWR, though it should really just be RD */ drawarg.handle = 0; ret = ioctl(fd, DRM_IOCTL_ADD_DRAW, &drawarg); assert(ret == 0); return drawarg.handle; } static int rm_drawable(int fd, int drawable, int fail) { drm_draw_t drawarg; int ret; /* Create a drawable. * IOCTL_ADD_DRAW is RDWR, though it should really just be RD */ drawarg.handle = drawable; ret = ioctl(fd, DRM_IOCTL_RM_DRAW, &drawarg); if (!fail) assert(ret == 0); else assert(ret == -1 && errno == EINVAL); return drawarg.handle; } /** * Tests drawable management: adding, removing, and updating the cliprects of * drawables. */ int main(int argc, char **argv) { int fd, ret, d1, d2; fd = drm_open_any_master(); d1 = add_drawable(fd); d2 = add_drawable(fd); /* Do a series of cliprect updates */ set_draw_cliprects_empty(fd, d1); set_draw_cliprects_empty(fd, d2); set_draw_cliprects_2(fd, d1); set_draw_cliprects_empty(fd, d1); /* Remove our drawables */ rm_drawable(fd, d1, 0); rm_drawable(fd, d2, 0); /* Check that removing an unknown drawable returns error */ rm_drawable(fd, 0x7fffffff, 1); /* Attempt to set cliprects on a nonexistent drawable */ set_draw_cliprects_empty_fail(fd, d1); close(fd); return 0; }