dga_db.c revision 919
830N/A/* Copyright 1999 Sun Microsystems, Inc. All rights reserved. 830N/A * Use is subject to license terms. 830N/A * Permission is hereby granted, free of charge, to any person obtaining a 919N/A * copy of this software and associated documentation files (the "Software"), 919N/A * to deal in the Software without restriction, including without limitation 919N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense, 919N/A * and/or sell copies of the Software, and to permit persons to whom the 919N/A * Software is furnished to do so, subject to the following conditions: 919N/A * The above copyright notice and this permission notice (including the next 919N/A * paragraph) shall be included in all copies or substantial portions of the 919N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 919N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 919N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 919N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 919N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 919N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 919N/A * DEALINGS IN THE SOFTWARE. 830N/A /* Do a block if necessary and if vrt_func has been supplied */ 830N/A/* INTERNAL INTERFACE */ 830N/A/* INTERNAL INTERFACE */ 830N/A * the driver provides the dev_offset into the mmaped page 830N/A * where the vertical retrace counter word is. 830N/A * We will mmap a shared memory page that is on a 830N/A * page boundary then modify the pointer to the 830N/A * vertical retrace counter to reflect the exact 830N/A * location where the counter word exists 830N/A /* if the mmap failed then return NULL otherwide return 830N/A * the computed address of the vertical retract counter 830N/A * by adding the beginning of the mmaped page to the 830N/A * dev_offset into the page returned by the device driver 830N/A /* Unmap the page for this client. 830N/A * remove the offset computation and munmap the 830N/A * vertical retrace counter page. we remove the 830N/A * offset by simply setting the lower bits of 830N/A/* New routines that will be exposed to the public */ 830N/A /* Return 1 = done, 0 = not done, -1 = error */ 830N/A /* If the user does not want to block or if the 830N/A * display_done_func() returned a non-zero, we return 830N/A * else we try till success after each vrt_retrace() 830N/A/* Returns 0 on fail and non-zero on success */ 830N/A * Check for an invalid Dga_window 830N/A * If the buffers has already been grabbed. Don't 830N/A * Find out if this is an X window. If so get the Display and window 830N/A * Request the server to allow DGA to the buffers associated 830N/A * with this Dga_window. 830N/A /* Now if they supplied vrtfunc, update the clientp 830N/A /* Now update the clientp pointer with other info */ 830N/A /* Even though they have not supplied vrtp we allow the db_grab 830N/A * to succeed but we null out vrtfunc and set vrtcntrp to point 830N/A/* Returns 0 on failure and non-zero on success */ 830N/A * Check for an invalid Dga_window 830N/A /* If it wasm't grabbed in the first place. don't do anything */ 830N/A * Find out if this is an X window. If so get the Display and window 830N/A /* Mark the window as single buffered */ 830N/A /* Tell server t ungrab */ 830N/A/* This is just for internal use */