summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2005-09-30Add Bens fix for radeon maps on ppcDave Airlie
2005-09-25via: fix stray error printout message.Thomas Hellstrom
2005-09-25Add the via PCI DMA blit code.Thomas Hellstrom
2005-09-25hopefully fix server recycling on PCIEDave Airlie
2005-09-25add __ATTRDave Airlie
2005-09-25use linux kernel macros don't make our ownDave Airlie
2005-09-18remove pci_find_class use for alphaDave Airlie
2005-09-17compat for pci_pretty_nameDave Airlie
2005-09-12update autogen from xserver treeDave Airlie
2005-09-12Fix the spelling of DRM_AUTH so that the bsd core stuff builds again. NextEric Anholt
2005-09-12add some pci express chipsDave Airlie
2005-09-12make PCI Express work on 64-bit machines, thanks to Alex Deucher (agd5f)Dave Airlie
2005-09-11back out change as gart is now in framebuffer for PCIEDave Airlie
2005-09-11Add GART in FB support for ati pcigart, and PCIE support for r300Dave Airlie
2005-09-11fix makefile bugDave Airlie
2005-09-09Add support for GL_ATI_fragment_shader, new packets R200_EMIT_PP_AFS_0/1,Roland Scheidegger
2005-09-09Add another R300 PCI id. Submitted by: Daniel EstévezVladimir Dergachev
2005-09-03convert ioctl flags to use flags instead of separate intsDave Airlie
2005-09-03check is the map containing the lockDave Airlie
2005-08-26- Don't try to allocate mappings of less than a PAGE_SIZE in MGA DMA code.Eric Anholt
2005-08-26Previously, drm_get_resource_start() and drm_get_resource_len() wouldEric Anholt
2005-08-26Fix a lack of parenthesis in macro usage that showed up with INVARIANTSEric Anholt
2005-08-26[1] Fix BSD DRM for the nonroot changes. [2] Don't attempt to acquire theEric Anholt
2005-08-25Add missing .cvsignore files for autotoolery.Eric Anholt
2005-08-25Include appropriate CFLAGS to find X headers, needed to build libdrm.Eric Anholt
2005-08-23add options for x86_64 and amd will small lettersDave Airlie
2005-08-22remove the README in the linux-2.6 directoryAlan Hourihane
2005-08-22remove i915_pm code as it causes too many issues with current softwareAlan Hourihane
2005-08-21allocating the PCIE table from GFP_DMA seems to stop it NMI'ingDave Airlie
2005-08-21We don't need to install all the internal headers files only drm.h andDave Airlie
2005-08-20add x86_64 to the list as wellDave Airlie
2005-08-20remove checks that make ppc64 not work properly... also fix ppc64 check..Dave Airlie
2005-08-20add powerpc64 to the list of archs that this test doesn't make sense onDave Airlie
2005-08-20Fix silly install issue by moving the header install rules for shared-coreAdam Jackson
2005-08-19Add r300_reg.h. Bump to 1.0.2.Adam Jackson
2005-08-17add agp buffer tokenDave Airlie
2005-08-17revert reversion of a part of a patch from Jon, that I did last night whileDave Airlie
2005-08-17commit toggle switch to make Linux drm_handle_t unsigned intDave Airlie
2005-08-16Remove the long-stale BSD non-core bits.Eric Anholt
2005-08-16add Egberts 32/64 bit patch (its in kernel already...)Dave Airlie
2005-08-15Port the VIA DRM to FreeBSD. Original patch by Jake, with some cleanup byEric Anholt
2005-08-14VIA bugvixes by Joris van Rantwijk Initial commit.Thomas Hellstrom
2005-08-12Fix build after linux-side checkin of master/root-only split. Still onlyEric Anholt
2005-08-12Reverting the previous via security-fix commit, since the assumption ofThomas Hellstrom
2005-08-11Missing symbol export from previous via context check commit.Thomas Hellstrom
2005-08-10Security fix on via: Checking that the specified context belongs to theThomas Hellstrom
2005-08-09Make sure savage has 3rd ioctl parameterJon Smirl
2005-08-07make some functions static in the savage drm driverDave Airlie
2005-08-07fix ioctl in r128 drm direction from Egbert Eich.Dave Airlie
2005-08-07remove bus addressDave Airlie
ommfd[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; }