diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-03-09 11:55:52 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-03-11 12:45:10 +0200 |
commit | 79394ef6686cd525471c20f9bda0b8c983b63010 (patch) | |
tree | 796c63622a80d44b6df6bed072ba1c46bfb24d76 /tests | |
parent | 2e29af9f076e32a9971046acd42fde7b7eec1e68 (diff) |
kmsview: scale down to fit into screen
Diffstat (limited to 'tests')
-rw-r--r-- | tests/kmsview.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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); |