summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-23 16:36:40 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-26 18:50:27 +0100
commit70182167d6d39e18d03109687918752d04165c32 (patch)
treead525ab1b007956599bfcc83031f43c318618c0d /lib
parent288e80f2788153cefda271e3847c82af3f40791c (diff)
lib: remove kmstest_create_fb
Use the new-style function using drm fourcc codes instead everywhere. To easily use thew fourcc based interface also expose bpp_depth_to_drm_format from the library. Finally include drm_fourcc.h from the igt_kms.h header since pretty much everyone needs this now. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_kms.c28
-rw-r--r--lib/igt_kms.h5
2 files changed, 3 insertions, 30 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 5b7aca71..c752490c 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -34,8 +34,6 @@
#include <linux/kd.h>
#include <errno.h>
-#include <drm_fourcc.h>
-
#include "drmtest.h"
#include "igt_kms.h"
#include "igt_aux.h"
@@ -278,7 +276,7 @@ static struct format_desc_struct {
#define for_each_format(f) \
for (f = format_desc; f - format_desc < ARRAY_SIZE(format_desc); f++)
-static uint32_t bpp_depth_to_drm_format(int bpp, int depth)
+uint32_t bpp_depth_to_drm_format(int bpp, int depth)
{
struct format_desc_struct *f;
@@ -290,30 +288,6 @@ static uint32_t bpp_depth_to_drm_format(int bpp, int depth)
}
/* Return fb_id on success, 0 on error */
-unsigned int kmstest_create_fb(int fd, int width, int height, int bpp,
- int depth, bool tiled, struct kmstest_fb *fb)
-{
- memset(fb, 0, sizeof(*fb));
-
- if (create_bo_for_fb(fd, width, height, bpp, tiled, &fb->gem_handle,
- &fb->size, &fb->stride) < 0)
- return 0;
-
- if (drmModeAddFB(fd, width, height, depth, bpp, fb->stride,
- fb->gem_handle, &fb->fb_id) < 0) {
- gem_close(fd, fb->gem_handle);
-
- return 0;
- }
-
- fb->width = width;
- fb->height = height;
- fb->tiling = tiled;
- fb->drm_format = bpp_depth_to_drm_format(bpp, depth);
-
- return fb->fb_id;
-}
-
uint32_t drm_format_to_bpp(uint32_t drm_format)
{
struct format_desc_struct *f;
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 19c2649c..1f613580 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -30,6 +30,7 @@
#include <cairo.h>
#include <xf86drmMode.h>
+#include <drm_fourcc.h>
#include "igt_display.h"
@@ -76,9 +77,6 @@ int kmstest_cairo_printf_line(cairo_t *cr, enum kmstest_text_align align,
double yspacing, const char *fmt, ...)
__attribute__((format (printf, 4, 5)));
-unsigned int kmstest_create_fb(int fd, int width, int height, int bpp,
- int depth, bool tiled,
- struct kmstest_fb *fb_info);
unsigned int kmstest_create_fb2(int fd, int width, int height, uint32_t format,
bool tiled, struct kmstest_fb *fb);
unsigned int kmstest_create_color_fb(int fd, int width, int height,
@@ -107,6 +105,7 @@ const char *kmstest_encoder_type_str(int type);
const char *kmstest_connector_status_str(int type);
const char *kmstest_connector_type_str(int type);
+uint32_t bpp_depth_to_drm_format(int bpp, int depth);
uint32_t drm_format_to_bpp(uint32_t drm_format);
/*