summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2002-09-29Remove some noise being spit to the console.Eric Anholt
2002-09-29Make our set_bit and friends match linux better (cleans up some warnings)Eric Anholt
2002-09-29warnings cleanupEric Anholt
2002-09-29Fix some of my silliness in DRM_WAIT_ON (not returning EINTR).Eric Anholt
2002-09-29Turn boxes off againKeith Whitwell
2002-09-29Move os-dependent stuff out of radeon_irq.cKeith Whitwell
2002-09-29Fix up BSD irq handling.Eric Anholt
2002-09-29add support for 16K and 64K page sizes (Bjorn Helgaas)Michel Daenzer
2002-09-27make SW interrupts more robust: write sequence number to scratch register,Michel Daenzer
2002-09-26DRM(vblank_wait) is driver specificMichel Daenzer
2002-09-26BSD vblank framework.Eric Anholt
2002-09-26Fix one warning.Eric Anholt
2002-09-25change RADEON_PARAM_IRQ_ACTIVE to RADEON_PARAM_IRQ_NRMichel Daenzer
2002-09-25common ioctl to wait for vertical blank IRQsMichel Daenzer
2002-09-23merged r200-0-2-branch to trunkKeith Whitwell
2002-09-21make sure we never oops because the hardware lock pointer in the sigdataMichel Daenzer
2002-09-11- Fix various bugs in the DRI support for the i830 and i845G (KeithDavid Dawes
2002-08-30Remove some extra symlinking for kernel module building that hasn't beenEric Anholt
2002-08-30Remove this one too: it'll be used from the linux version (if ever)Eric Anholt
2002-08-30Remove compat functions for FreeBSD for drivers which weren't available inEric Anholt
2002-08-30file radeon_irq.c was initially added on branch r200-0-2-branch.Keith Whitwell
2002-08-29standardize use of __FUNCTION__ (Linus)Keith Whitwell
2002-08-28Turn boxes off.Keith Whitwell
2002-08-28Remove i8x0 files from the BSD side. These were not actually ported, andEric Anholt
2002-08-27file radeon_mem.c was initially added on branch r200-0-2-branch.Keith Whitwell
2002-08-27Remove drm_linux.h, it's no longer used.Eric Anholt
2002-08-27Include non-radeon modules in the build.Eric Anholt
2002-08-26merged r200-0-1-branchKeith Whitwell
2002-08-22Don't (re)define vmalloc_to_page for kernel >= 2.4.19, as it has beenLeif Delgass
2002-08-22SetPageLocked only defined in 2.5.x (x=?), use LockPage for 2.4.x (x>=9).Leif Delgass
2002-08-21Change the linux kernel version condition in the i810 driver (according toJose Fonseca
2002-08-21Remove drm_linux.h, move the two useful defines into drm_drv.h (the onlyEric Anholt
2002-08-21add missing include (for udelay), remove unused counter.Leif Delgass
2002-08-21TRUE and FALSE don't seem to be defined everywhere...Michel Daenzer
2002-08-12zero-cliprect case patch from JacekKeith Whitwell
2002-08-11test scratch register writeback before using itMichel Daenzer
2002-08-08Try to open the /dev/dri/cardX device once, then only if it fails check theEric Anholt
2002-08-06Updates from Rusty Russell to:Rik Faith
2002-07-18fix off-by-one error for right bottom corner in radeon_emit_clip_rect()Michel Daenzer
2002-07-17Workaround for Radeon lockups on fast machinesTim Smith
2002-07-14bump DRM minor and check it before using the GETPARAM ioctl to obtainMichel Daenzer
2002-07-11Don't read scratch registers directly, obtain the values via the GET_PARAMMichel Daenzer
2002-07-09Increase the linux-compatibility max ioctl.Eric Anholt
2002-07-06remove obsolete filesAlan Hourihane
2002-07-05remove files missed by mergeAlan Hourihane
2002-07-05merged bsd-3-0-0-branchAlan Hourihane
2002-07-04Fix some more pageflipping issues -- existing code was doing MMIO writesKeith Whitwell
2002-07-04Revert SET_SCISSORS change.Keith Whitwell
2002-07-02Fix lockup on faster machines when drawing in multiple clip rectanglesTim Smith
2002-06-27Set pfCurrentPage on cleanup_pageflipKeith Whitwell
t">= read(commfd[pipe], &in, 1); if (ret == -1) err(1, "read error"); event = in; if (event != expected_event) errx(1, "unexpected event: %d\n", event); } static void send_event(int pipe, enum auth_event send_event) { int ret; unsigned char event; event = send_event; ret = write(commfd[pipe], &event, 1); if (ret == -1) err(1, "failed to send event %d", event); } static void client_auth(int drmfd) { struct drm_auth auth; int ret; /* Get a client magic number and pass it to the master for auth. */ ret = ioctl(drmfd, DRM_IOCTL_GET_MAGIC, &auth); if (ret == -1) err(1, "Couldn't get client magic"); send_event(0, CLIENT_MAGIC); ret = write(commfd[0], &auth.magic, sizeof(auth.magic)); if (ret == -1) err(1, "Couldn't write auth data"); } static void server_auth(int drmfd) { struct drm_auth auth; int ret; send_event(1, SERVER_READY); wait_event(1, CLIENT_MAGIC); ret = read(commfd[1], &auth.magic, sizeof(auth.magic)); if (ret == -1) err(1, "Failure to read client magic"); ret = ioctl(drmfd, DRM_IOCTL_AUTH_MAGIC, &auth); if (ret == -1) err(1, "Failure to authenticate client magic\n"); } /** Tests that locking is successful in normal conditions */ static void test_lock_unlock(int drmfd) { int ret; ret = drmGetLock(drmfd, lock1, 0); if (ret != 0) err(1, "Locking failed"); ret = drmUnlock(drmfd, lock1); if (ret != 0) err(1, "Unlocking failed"); } /** Tests that unlocking the lock while it's not held works correctly */ static void test_unlock_unlocked(int drmfd) { int ret; ret = drmUnlock(drmfd, lock1); if (ret == 0) err(1, "Unlocking unlocked lock succeeded"); } /** Tests that unlocking a lock held by another context fails appropriately */ static void test_unlock_unowned(int drmfd) { int ret; ret = drmGetLock(drmfd, lock1, 0); assert(ret == 0); ret = drmUnlock(drmfd, lock2); if (ret == 0) errx(1, "Unlocking other context's lock succeeded"); ret = drmUnlock(drmfd, lock1); assert(ret == 0); } /** * Tests that an open/close by the same process doesn't result in the lock * being dropped. */ static void test_open_close_locked(drmfd) { int ret, tempfd; ret = drmGetLock(drmfd, lock1, 0); assert(ret == 0); /* XXX: Need to make sure that this is the same device as drmfd */ tempfd = drm_open_any(); close(tempfd); ret = drmUnlock(drmfd, lock1); if (ret != 0) errx(1, "lock lost during open/close by same pid"); } static void client() { int drmfd, ret; unsigned int time; wait_event(0, SERVER_READY); /* XXX: Should make sure we open the same DRM as the master */ drmfd = drm_open_any(); client_auth(drmfd); /* Wait for the server to grab the lock, then grab it ourselves (to * contest it). Hopefully we hit it within the window of when the * server locks. */ wait_event(0, SERVER_LOCKED); ret = drmGetLock(drmfd, lock2, 0); time = get_millis(); if (ret != 0) err(1, "Failed to get lock on client\n"); drmUnlock(drmfd, lock2); /* Tell the server that our locking completed, and when it did */ send_event(0, CLIENT_LOCKED); ret = write(commfd[0], &time, sizeof(time)); close(drmfd); exit(0); } static void server() { int drmfd, tempfd, ret; unsigned int client_time, unlock_time; drmfd = drm_open_any_master(); test_lock_unlock(drmfd); test_unlock_unlocked(drmfd); test_unlock_unowned(drmfd); test_open_close_locked(drmfd); /* Perform the authentication sequence with the client. */ server_auth(drmfd); /* Now, test that the client attempting to lock while the server * holds the lock works correctly. */ ret = drmGetLock(drmfd, lock1, 0); assert(ret == 0); send_event(1, SERVER_LOCKED); /* Wait a while for the client to do its thing */ sleep(1); ret = drmUnlock(drmfd, lock1); assert(ret == 0); unlock_time = get_millis(); wait_event(1, CLIENT_LOCKED); ret = read(commfd[1], &client_time, sizeof(client_time)); if (ret == -1) err(1, "Failure to read client magic"); if (client_time < unlock_time) errx(1, "Client took lock before server released it"); close(drmfd); } int main(int argc, char **argv) { int ret; ret = pipe(commfd); if (ret == -1) err(1, "Couldn't create pipe"); ret = fork(); if (ret == -1) err(1, "failure to fork client"); if (ret == 0) client(); else server(); return 0; }