mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-20 05:50:12 +01:00
Fix ttmtest.
This commit is contained in:
parent
2d7eb4434f
commit
f3708b4c04
2 changed files with 21 additions and 19 deletions
|
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <drm/drm.h>
|
#include <drm/drm.h>
|
||||||
#include "xf86dri.h"
|
#include "xf86dri.h"
|
||||||
#include "xf86drm.h"
|
#include "xf86drm.h"
|
||||||
|
|
@ -176,13 +177,11 @@ benchmarkBuffer(TinyDRIContext * ctx, unsigned long size,
|
||||||
/*
|
/*
|
||||||
* Test system memory objects.
|
* Test system memory objects.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
oldTime = fastrdtsc();
|
oldTime = fastrdtsc();
|
||||||
BM_CKFATAL(drmBOCreate(ctx->drmFD, 0, size, 0, NULL,
|
BM_CKFATAL(drmBOCreate(ctx->drmFD, size, 0, NULL,
|
||||||
drm_bo_type_dc,
|
DRM_BO_FLAG_READ |
|
||||||
DRM_BO_FLAG_READ |
|
DRM_BO_FLAG_WRITE |
|
||||||
DRM_BO_FLAG_WRITE |
|
DRM_BO_FLAG_MEM_LOCAL, 0, &buf));
|
||||||
DRM_BO_FLAG_MEM_LOCAL /*| DRM_BO_FLAG_NO_MOVE*/, 0, &buf));
|
|
||||||
curTime = fastrdtsc();
|
curTime = fastrdtsc();
|
||||||
*ticks++ = time_diff(oldTime, curTime);
|
*ticks++ = time_diff(oldTime, curTime);
|
||||||
|
|
||||||
|
|
@ -216,12 +215,12 @@ benchmarkBuffer(TinyDRIContext * ctx, unsigned long size,
|
||||||
* Test TT bound buffer objects.
|
* Test TT bound buffer objects.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BM_CKFATAL(drmGetLock(ctx->drmFD, ctx->hwContext, 0));
|
|
||||||
oldTime = fastrdtsc();
|
oldTime = fastrdtsc();
|
||||||
BM_CKFATAL(drmBOValidate(ctx->drmFD, &buf,
|
BM_CKFATAL(drmBOSetStatus(ctx->drmFD, &buf,
|
||||||
DRM_BO_FLAG_MEM_TT, DRM_BO_MASK_MEM, DRM_BO_HINT_DONT_FENCE));
|
DRM_BO_FLAG_MEM_TT,
|
||||||
|
DRM_BO_MASK_MEM,
|
||||||
|
0,0,0));
|
||||||
curTime = fastrdtsc();
|
curTime = fastrdtsc();
|
||||||
BM_CKFATAL(drmUnlock(ctx->drmFD, ctx->hwContext));
|
|
||||||
*ticks++ = time_diff(oldTime, curTime);
|
*ticks++ = time_diff(oldTime, curTime);
|
||||||
|
|
||||||
oldTime = fastrdtsc();
|
oldTime = fastrdtsc();
|
||||||
|
|
@ -247,10 +246,9 @@ benchmarkBuffer(TinyDRIContext * ctx, unsigned long size,
|
||||||
|
|
||||||
BM_CKFATAL(drmBOUnmap(ctx->drmFD, &buf));
|
BM_CKFATAL(drmBOUnmap(ctx->drmFD, &buf));
|
||||||
|
|
||||||
BM_CKFATAL(drmGetLock(ctx->drmFD, ctx->hwContext, 0));
|
|
||||||
oldTime = fastrdtsc();
|
oldTime = fastrdtsc();
|
||||||
BM_CKFATAL(drmBOValidate(ctx->drmFD, &buf,
|
BM_CKFATAL(drmBOSetStatus(ctx->drmFD, &buf,
|
||||||
DRM_BO_FLAG_MEM_LOCAL, DRM_BO_MASK_MEM, DRM_BO_HINT_DONT_FENCE));
|
DRM_BO_FLAG_MEM_LOCAL, DRM_BO_MASK_MEM, 0, 0,0));
|
||||||
curTime = fastrdtsc();
|
curTime = fastrdtsc();
|
||||||
*ticks++ = time_diff(oldTime, curTime);
|
*ticks++ = time_diff(oldTime, curTime);
|
||||||
|
|
||||||
|
|
@ -259,15 +257,18 @@ benchmarkBuffer(TinyDRIContext * ctx, unsigned long size,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
oldTime = fastrdtsc();
|
oldTime = fastrdtsc();
|
||||||
ret = drmBOValidate(ctx->drmFD, &buf,
|
ret = drmBOSetStatus(ctx->drmFD, &buf,
|
||||||
DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_CACHED | DRM_BO_FLAG_FORCE_CACHING,
|
DRM_BO_FLAG_MEM_TT |
|
||||||
DRM_BO_MASK_MEMTYPE | DRM_BO_FLAG_FORCE_CACHING, DRM_BO_HINT_DONT_FENCE);
|
DRM_BO_FLAG_CACHED |
|
||||||
|
DRM_BO_FLAG_FORCE_CACHING,
|
||||||
|
DRM_BO_MASK_MEMTYPE |
|
||||||
|
DRM_BO_FLAG_FORCE_CACHING,
|
||||||
|
0, 0, 0);
|
||||||
curTime = fastrdtsc();
|
curTime = fastrdtsc();
|
||||||
drmUnlock(ctx->drmFD, ctx->hwContext);
|
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printf("Couldn't bind cached. Probably no support\n");
|
printf("Couldn't bind cached. Probably no support\n");
|
||||||
BM_CKFATAL(drmBODestroy(ctx->drmFD, &buf));
|
BM_CKFATAL(drmBOUnreference(ctx->drmFD, &buf));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
*ticks++ = time_diff(oldTime, curTime);
|
*ticks++ = time_diff(oldTime, curTime);
|
||||||
|
|
@ -295,7 +296,7 @@ benchmarkBuffer(TinyDRIContext * ctx, unsigned long size,
|
||||||
*ticks++ = time_diff(oldTime, curTime);
|
*ticks++ = time_diff(oldTime, curTime);
|
||||||
|
|
||||||
BM_CKFATAL(drmBOUnmap(ctx->drmFD, &buf));
|
BM_CKFATAL(drmBOUnmap(ctx->drmFD, &buf));
|
||||||
BM_CKFATAL(drmBODestroy(ctx->drmFD, &buf));
|
BM_CKFATAL(drmBOUnreference(ctx->drmFD, &buf));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include <X11/Xlibint.h>
|
#include <X11/Xlibint.h>
|
||||||
#include <X11/extensions/Xext.h>
|
#include <X11/extensions/Xext.h>
|
||||||
#include <X11/extensions/extutil.h>
|
#include <X11/extensions/extutil.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include "xf86dristr.h"
|
#include "xf86dristr.h"
|
||||||
|
|
||||||
static XExtensionInfo _xf86dri_info_data;
|
static XExtensionInfo _xf86dri_info_data;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue