mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-23 22:32:57 +00:00
lib: extract kmstest_create_fb
We should get more kms tests soon, and not needing to copy-paste a nice test pattern should be useful. That establishes a firm depency of i-g-t on cairo over everything, but I don't care so much about that. Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <cairo.h>
|
||||
|
||||
#include "xf86drm.h"
|
||||
#include "intel_batchbuffer.h"
|
||||
@@ -74,6 +75,22 @@ void drmtest_init_aperture_trashers(drm_intel_bufmgr *bufmgr);
|
||||
void drmtest_trash_aperture(void);
|
||||
void drmtest_cleanup_aperture_trashers(void);
|
||||
|
||||
/* helpers to create nice-looking framebuffers */
|
||||
struct kmstest_fb {
|
||||
uint32_t fb_id;
|
||||
uint32_t gem_handle;
|
||||
unsigned stride;
|
||||
unsigned size;
|
||||
};
|
||||
|
||||
typedef void (*kmstest_paint_func)(cairo_t *cr, int width, int height, void *priv);
|
||||
|
||||
unsigned int kmstest_create_fb(int fd, int width, int height, int bpp,
|
||||
int depth, bool tiled,
|
||||
struct kmstest_fb *fb_info,
|
||||
kmstest_paint_func paint_func,
|
||||
void *func_arg);
|
||||
|
||||
inline static void _do_or_die(const char *function, int line, int ret)
|
||||
{
|
||||
if (ret == 0)
|
||||
|
||||
Reference in New Issue
Block a user