VirtualBox

Ignore:
Timestamp:
Oct 25, 2017 2:24:45 PM (7 years ago)
Author:
vboxsync
Message:

common/crOpenGL: scm updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/dri_util.c

    r64525 r69310  
    88 * useful stuff is done here that otherwise would have to be duplicated in most
    99 * drivers.
    10  * 
     10 *
    1111 * Basically, these utility functions take care of some of the dirty details of
    1212 * screen initialization, context creation, context binding, DRM setup, etc.
     
    4848/**
    4949 * Print message to \c stderr if the \c LIBGL_DEBUG environment variable
    50  * is set. 
    51  * 
     50 * is set.
     51 *
    5252 * Is called from the drivers.
    53  * 
     53 *
    5454 * \param f \c printf like format string.
    5555 */
     
    8888/**
    8989 * Unbind context.
    90  * 
     90 *
    9191 * \param scrn the screen.
    9292 * \param gc context.
    9393 *
    9494 * \return \c GL_TRUE on success, or \c GL_FALSE on failure.
    95  * 
     95 *
    9696 * \internal
    9797 * This function calls __DriverAPIRec::UnbindContext, and then decrements
    9898 * __DRIdrawablePrivateRec::refcount which must be non-zero for a successful
    9999 * return.
    100  * 
     100 *
    101101 * While casting the opaque private pointers associated with the parameters
    102  * into their respective real types it also assures they are not \c NULL. 
     102 * into their respective real types it also assures they are not \c NULL.
    103103 */
    104104static int driUnbindContext(__DRIcontext *pcp)
     
    197197            DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
    198198        }
    199        
     199
    200200        if ((pdp != prp) && (!prp->pStamp || *prp->pStamp != prp->lastStamp)) {
    201201            DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
     
    223223 *
    224224 * \param pdp pointer to the private drawable information to update.
    225  * 
     225 *
    226226 * This function basically updates the __DRIdrawablePrivate struct's
    227227 * cliprect information by calling \c __DRIinterfaceMethods::getDrawableInfo.
     
    236236    __DRIscreenPrivate *psp = pdp->driScreenPriv;
    237237    __DRIcontextPrivate *pcp = pdp->driContextPriv;
    238    
    239     if (!pcp 
     238
     239    if (!pcp
    240240        || ((pdp != pcp->driDrawablePriv) && (pdp != pcp->driReadablePriv))) {
    241         /* ERROR!!! 
     241        /* ERROR!!!
    242242         * ...but we must ignore it. There can be many contexts bound to a
    243243         * drawable.
     
    246246
    247247    if (pdp->pClipRects) {
    248         _mesa_free(pdp->pClipRects); 
     248        _mesa_free(pdp->pClipRects);
    249249        pdp->pClipRects = NULL;
    250250    }
    251251
    252252    if (pdp->pBackClipRects) {
    253         _mesa_free(pdp->pBackClipRects); 
     253        _mesa_free(pdp->pBackClipRects);
    254254        pdp->pBackClipRects = NULL;
    255255    }
     
    330330       case DRI2_EVENT_BUFFER_ATTACH:
    331331          ba = (__DRIBufferAttachEvent *) p;
    332           if (ba->drawable == pdp->dri2.drawable_id && 
     332          if (ba->drawable == pdp->dri2.drawable_id &&
    333333              ba->buffer.attachment == DRI_DRAWABLE_BUFFER_FRONT_LEFT)
    334334             last_ba = ba;
     
    336336       }
    337337    }
    338          
     338
    339339    if (last_dc) {
    340340       if (pdp->w != last_dc->width || pdp->h != last_dc->height)
     
    449449 *
    450450 * \param drawablePrivate opaque pointer to the per-drawable private info.
    451  * 
     451 *
    452452 * \internal
    453453 * This function calls __DRIdrawablePrivate::swapBuffers.
    454  * 
     454 *
    455455 * Is called directly from glXSwapBuffers().
    456456 */
     
    595595    /* This special default value is replaced with the configured
    596596     * default value when the drawable is first bound to a direct
    597      * rendering context. 
     597     * rendering context.
    598598     */
    599599    pdp->swap_interval = (unsigned)-1;
     
    651651/**
    652652 * Destroy the per-context private information.
    653  * 
     653 *
    654654 * \internal
    655655 * This function calls __DriverAPIRec::DestroyContext on \p contextPrivate, calls
     
    668668/**
    669669 * Create the per-drawable private driver information.
    670  * 
     670 *
    671671 * \param render_type   Type of rendering target.  \c GLX_RGBA is the only
    672672 *                      type likely to ever be supported for direct-rendering.
     
    675675 * \returns An opaque pointer to the per-context private information on
    676676 *          success, or \c NULL on failure.
    677  * 
     677 *
    678678 * \internal
    679679 * This function allocates and fills a __DRIcontextPrivateRec structure.  It
     
    685685static __DRIcontext *
    686686driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config,
    687                     int render_type, __DRIcontext *shared, 
     687                    int render_type, __DRIcontext *shared,
    688688                    drm_context_t hwContext, void *data)
    689689{
     
    756756/**
    757757 * Destroy the per-screen private information.
    758  * 
     758 *
    759759 * \internal
    760760 * This function calls __DriverAPIRec::DestroyScreen on \p screenPrivate, calls
     
    813813 *
    814814 * For legacy DRI.
    815  * 
     815 *
    816816 * \param scrn  Index of the screen
    817817 * \param ddx_version Version of the 2D DDX.  This may not be meaningful for
     
    826826 * \param driver_modes  Returns modes supported by the driver
    827827 * \param loaderPrivate  ??
    828  * 
     828 *
    829829 * \note There is no need to check the minimum API version in this
    830830 * function.  Since the name of this function is versioned, it is
     
    837837                   const __DRIversion *drm_version,
    838838                   const __DRIframebuffer *frame_buffer,
    839                    drmAddress pSAREA, int fd, 
     839                   drmAddress pSAREA, int fd,
    840840                   const __DRIextension **extensions,
    841841                   const __DRIconfig ***driver_modes,
     
    10491049    { __DRI_FRAME_TRACKING, __DRI_FRAME_TRACKING_VERSION },
    10501050    driFrameTracking,
    1051     driQueryFrameTracking   
     1051    driQueryFrameTracking
    10521052};
    10531053
    10541054/**
    10551055 * Calculate amount of swap interval used between GLX buffer swaps.
    1056  * 
     1056 *
    10571057 * The usage value, on the range [0,max], is the fraction of total swap
    10581058 * interval time used between GLX buffer swaps is calculated.
    10591059 *
    10601060 *            \f$p = t_d / (i * t_r)\f$
    1061  * 
     1061 *
    10621062 * Where \f$t_d\f$ is the time since the last GLX buffer swap, \f$i\f$ is the
    10631063 * swap interval (as set by \c glXSwapIntervalSGI), and \f$t_r\f$ time
    10641064 * required for a single vertical refresh period (as returned by \c
    10651065 * glXGetMscRateOML).
    1066  * 
     1066 *
    10671067 * See the documentation for the GLX_MESA_swap_frame_usage extension for more
    10681068 * details.
     
    10761076 *
    10771077 * \sa glXSwapIntervalSGI glXGetMscRateOML
    1078  * 
     1078 *
    10791079 * \todo Instead of caching the \c glXGetMscRateOML function pointer, would it
    10801080 *       be possible to cache the sync rate?
     
    11111111      usage /= 1000000.0;
    11121112   }
    1113    
     1113
    11141114   return usage;
    11151115}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette