VirtualBox

Ignore:
Timestamp:
Dec 5, 2019 8:44:23 PM (5 years ago)
Author:
vboxsync
Message:

WDDM: miniport log groups

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/Svga.cpp

    r81594 r82440  
    1515 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1616 */
     17
     18#define GALOG_GROUP GALOG_GROUP_SVGA
    1719
    1820#include "Svga.h"
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/SvgaFifo.cpp

    r76553 r82440  
    1616 */
    1717
     18#define GALOG_GROUP GALOG_GROUP_SVGA_FIFO
     19
    1820#include "SvgaFifo.h"
    1921#include "SvgaHw.h"
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/VBoxMPGaFence.cpp

    r76884 r82440  
    1515 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1616 */
     17#define GALOG_GROUP GALOG_GROUP_FENCE
    1718
    1819#include "VBoxMPGaWddm.h"
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/VBoxMPGaUtils.cpp

    r76884 r82440  
    2222
    2323volatile uint32_t g_fu32GaLogControl =
     24      GALOG_GROUP_RELEASE
    2425#ifdef DEBUG
    25     1 /* Enable LogRels */
    26 #else
    27     0 /* Disable LogRels, but they can be enabled if necessary. */
     26    | GALOG_GROUP_TEST
     27//    | GALOG_GROUP_PRESENT
     28//    | GALOG_GROUP_DXGK
     29//    | GALOG_GROUP_SVGA
     30//    | GALOG_GROUP_SVGA_FIFO
    2831#endif
    29 ;
     32    ;
    3033
    3134/*
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/VBoxMPGaUtils.h

    r76563 r82440  
    2828#include <VBox/log.h>
    2929
     30#define GALOG_GROUP_RELEASE   0x00000001
     31#define GALOG_GROUP_TEST      0x00000002
     32#define GALOG_GROUP_DXGK      0x00000004
     33#define GALOG_GROUP_SVGA      0x00000008
     34#define GALOG_GROUP_SVGA_FIFO 0x00000010
     35#define GALOG_GROUP_FENCE     0x00000020
     36#define GALOG_GROUP_PRESENT   0x00000040
     37
     38#ifndef GALOG_GROUP
     39#define GALOG_GROUP GALOG_GROUP_TEST
     40#endif
     41
    3042extern volatile uint32_t g_fu32GaLogControl;
    31 #define GALOG_(_msg, _log) do {                   \
    32     if (RT_LIKELY(g_fu32GaLogControl == 0))       \
    33     { /* likely */ }                              \
    34     else if (RT_BOOL(g_fu32GaLogControl & 1))     \
    35         _log(_msg);                               \
     43
     44#define GALOG_ENABLED(a_Group) RT_BOOL(g_fu32GaLogControl & (a_Group))
     45
     46#define GALOG_EXACT_(a_Group, a_Msg, a_Logger) do { \
     47    if (GALOG_ENABLED(a_Group)) \
     48    { \
     49        a_Logger(a_Msg); \
     50    } \
    3651} while (0)
    3752
    38 #define GALOG_EXACT(_msg) GALOG_(_msg, LogRel)
    39 #define GALOG(_msg) GALOG_(_msg, LogRelFunc)
     53#define GALOG_(a_Group, a_Msg, a_Logger) do { \
     54    if (GALOG_ENABLED(a_Group)) \
     55    { \
     56        a_Logger(("%s: ", __FUNCTION__)); a_Logger(a_Msg); \
     57    } \
     58} while (0)
    4059
    41 #define GALOGREL_EXACT(a) LogRel(a)
    42 #define GALOGREL(a) LogRelFunc(a)
     60#define GALOGG_EXACT(a_Group, a_Msg) GALOG_EXACT_(a_Group, a_Msg, LogRel)
     61#define GALOGG(a_Group, a_Msg) GALOG_(a_Group, a_Msg, LogRel)
     62
     63#define GALOG_EXACT(a_Msg) GALOGG_EXACT(GALOG_GROUP, a_Msg)
     64#define GALOG(a_Msg) GALOGG(GALOG_GROUP, a_Msg)
     65
     66#define GALOGREL_EXACT(a_Msg) GALOGG_EXACT(GALOG_GROUP_RELEASE, a_Msg)
     67#define GALOGREL(a_Msg) GALOGG(GALOG_GROUP_RELEASE, a_Msg)
     68
     69#define GALOGTEST_EXACT(a_Msg) GALOGG_EXACT(GALOG_GROUP_TEST, a_Msg)
     70#define GALOGTEST(a_Msg) GALOGG(GALOG_GROUP_TEST, a_Msg)
    4371
    4472void *GaMemAlloc(uint32_t cbSize);
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/VBoxMPGaWddm.cpp

    r81686 r82440  
    1515 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1616 */
     17
     18#define GALOG_GROUP GALOG_GROUP_DXGK
    1719
    1820#include "VBoxMPGaWddm.h"
     
    555557            {
    556558                /* From GDI software drawing surface. */
    557                 GALOG(("Blt: SHADOWSURFACE(%d) 0x%08X -> SHAREDPRIMARYSURFACE 0x%08X\n",
    558                        pSrcAlloc->enmType, pSrc->PhysicalAddress.LowPart, pDst->PhysicalAddress.LowPart));
     559                GALOGG(GALOG_GROUP_PRESENT, ("Blt: %s(%d) 0x%08X -> SHAREDPRIMARYSURFACE 0x%08X\n",
     560                    vboxWddmAllocTypeString(pSrcAlloc),
     561                    pSrcAlloc->enmType, pSrc->PhysicalAddress.LowPart, pDst->PhysicalAddress.LowPart));
    559562
    560563                int32_t const xSrc = pPresent->pDstSubRects[iSubRect].left + dx;
     
    569572            {
    570573                /* From a surface. */
    571                 GALOG(("Blt: surface id 0x%08X -> SHAREDPRIMARYSURFACE 0x%08X\n",
    572                        pSrcAlloc->AllocData.hostID, pDst->PhysicalAddress.LowPart));
     574                GALOGG(GALOG_GROUP_PRESENT, ("Blt: surface sid=%u -> SHAREDPRIMARYSURFACE 0x%08X\n",
     575                    pSrcAlloc->AllocData.hostID, pDst->PhysicalAddress.LowPart));
    573576
    574577                RECT const dstRect = pPresent->pDstSubRects[iSubRect];
     
    599602            {
    600603                /* From screen. */
    601                 GALOG(("Blt: SHAREDPRIMARYSURFACE 0x%08X -> SHADOWSURFACE(%d) 0x%08X\n",
    602                        pSrc->PhysicalAddress.LowPart, pDstAlloc->enmType, pDst->PhysicalAddress.LowPart));
     604                GALOGG(GALOG_GROUP_PRESENT, ("Blt: SHAREDPRIMARYSURFACE 0x%08X -> %s(%d) 0x%08X\n",
     605                    pSrc->PhysicalAddress.LowPart,
     606                    vboxWddmAllocTypeString(pDstAlloc),
     607                    pDstAlloc->enmType, pDst->PhysicalAddress.LowPart));
    603608
    604609                int32_t const xSrc = pPresent->pDstSubRects[iSubRect].left + dx;
     
    614619            {
    615620                /* From a surface. */
    616                 GALOG(("Blt: surface id 0x%08X -> SHADOWSURFACE(%d) %d:0x%08X\n",
    617                        pSrcAlloc->AllocData.hostID, pDstAlloc->enmType, pDst->SegmentId, pDst->PhysicalAddress.LowPart));
     621                GALOGG(GALOG_GROUP_PRESENT, ("Blt: surface sid=%u -> %s(%d) %d:0x%08X\n",
     622                    pSrcAlloc->AllocData.hostID,
     623                    vboxWddmAllocTypeString(pDstAlloc),
     624                    pDstAlloc->enmType, pDst->SegmentId, pDst->PhysicalAddress.LowPart));
    618625
    619626                SVGAGuestImage guestImage;
     
    690697    DXGK_ALLOCATIONLIST *pDst =  &pPresent->pAllocationList[DXGK_PRESENT_DESTINATION_INDEX];
    691698
    692 #ifdef VBOX_WDDM_DUMP_REGIONS_ON_PRESENT
    693     LogRel(("%s: [%ld, %ld, %ld, %ld] -> [%ld, %ld, %ld, %ld] (SubRectCnt=%u)\n",
     699    GALOGG(GALOG_GROUP_PRESENT, ("%s: [%ld, %ld, %ld, %ld] -> [%ld, %ld, %ld, %ld] (SubRectCnt=%u)\n",
    694700        pPresent->Flags.Blt ? "Blt" : (pPresent->Flags.Flip ? "Flip" : (pPresent->Flags.ColorFill ? "ColorFill" : "Unknown OP")),
    695701        pPresent->SrcRect.left, pPresent->SrcRect.top, pPresent->SrcRect.right, pPresent->SrcRect.bottom,
    696702        pPresent->DstRect.left, pPresent->DstRect.top, pPresent->DstRect.right, pPresent->DstRect.bottom,
    697703        pPresent->SubRectCnt));
    698     for (unsigned int i = 0; i < pPresent->SubRectCnt; i++)
    699         LogRel(("\tsub#%u = [%ld, %ld, %ld, %ld]\n", i, pPresent->pDstSubRects[i].left, pPresent->pDstSubRects[i].top, pPresent->pDstSubRects[i].right, pPresent->pDstSubRects[i].bottom));
    700 #endif
     704    if (GALOG_ENABLED(GALOG_GROUP_PRESENT))
     705        for (unsigned int i = 0; i < pPresent->SubRectCnt; ++i)
     706            GALOGG(GALOG_GROUP_PRESENT, ("   sub#%u = [%ld, %ld, %ld, %ld]\n",
     707                    i, pPresent->pDstSubRects[i].left, pPresent->pDstSubRects[i].top, pPresent->pDstSubRects[i].right, pPresent->pDstSubRects[i].bottom));
    701708
    702709    if (pPresent->Flags.Blt)
     
    705712        PVBOXWDDM_ALLOCATION pDstAlloc = vboxWddmGetAllocationFromAllocList(pDst);
    706713
    707         GALOG(("Blt: sid=%x -> sid=%x\n", pSrcAlloc->AllocData.hostID, pDstAlloc->AllocData.hostID));
     714        GALOGG(GALOG_GROUP_PRESENT, ("Blt: sid=%x -> sid=%x\n", pSrcAlloc->AllocData.hostID, pDstAlloc->AllocData.hostID));
    708715
    709716        /** @todo Review standard allocations (DxgkDdiGetStandardAllocationDriverData, etc).
     
    762769        PVBOXWDDM_ALLOCATION pSrcAlloc = vboxWddmGetAllocationFromAllocList(pSrc);
    763770
    764         GALOG(("Flip: sid=%x %dx%d\n",
    765                pSrcAlloc->AllocData.hostID, pSrcAlloc->AllocData.SurfDesc.width, pSrcAlloc->AllocData.SurfDesc.height));
    766 
    767         GALOG(("Flip: %d,%d %d,%d -> %d,%d %d,%d subrects %d\n",
    768                pPresent->SrcRect.left, pPresent->SrcRect.top, pPresent->SrcRect.right, pPresent->SrcRect.bottom,
    769                pPresent->DstRect.left, pPresent->DstRect.top, pPresent->DstRect.right, pPresent->DstRect.bottom,
    770                pPresent->SubRectCnt));
    771         uint32_t iSubRect;
    772         for (iSubRect = 0; iSubRect < pPresent->SubRectCnt; ++iSubRect)
    773         {
    774             GALOG(("Flip[%d]: %d,%d %d,%d\n",
    775                    pPresent->pDstSubRects[iSubRect].left, pPresent->pDstSubRects[iSubRect].top,
    776                    pPresent->pDstSubRects[iSubRect].right, pPresent->pDstSubRects[iSubRect].bottom,
    777                    iSubRect));
    778         }
     771        GALOGG(GALOG_GROUP_PRESENT, ("Flip: %s sid=%u %dx%d\n",
     772            vboxWddmAllocTypeString(pSrcAlloc),
     773            pSrcAlloc->AllocData.hostID, pSrcAlloc->AllocData.SurfDesc.width, pSrcAlloc->AllocData.SurfDesc.height));
    779774
    780775        /* Generate DMA buffer containing the present commands.
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