From 79394ef6686cd525471c20f9bda0b8c983b63010 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 9 Mar 2016 11:55:52 +0200 Subject: kmsview: scale down to fit into screen --- tests/kmsview.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/kmsview.cpp b/tests/kmsview.cpp index 07dc09a..aae7e80 100644 --- a/tests/kmsview.cpp +++ b/tests/kmsview.cpp @@ -14,8 +14,11 @@ static void read_frame(ifstream& is, DumbFramebuffer* fb, Crtc* crtc, Plane* pla for (unsigned i = 0; i < fb->num_planes(); ++i) is.read((char*)fb->map(i), fb->size(i)); + unsigned w = min(crtc->width(), fb->width()); + unsigned h = min(crtc->height(), fb->height()); + int r = crtc->set_plane(plane, *fb, - 0, 0, fb->width(), fb->height(), + 0, 0, w, h, 0, 0, fb->width(), fb->height()); ASSERT(r == 0); @@ -71,7 +74,7 @@ int main(int argc, char** argv) frame_size += fb->size(i); unsigned num_frames = fsize / frame_size; - printf("file size %u, frames %u\n", fsize, num_frames); + printf("file size %u, frame size %u, frames %u\n", fsize, frame_size, num_frames); for (unsigned i = 0; i < num_frames; ++i) { printf("frame %d\n", i); -- cgit v1.2.3