diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-03-09 10:55:50 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-03-11 12:45:10 +0200 |
commit | 2e29af9f076e32a9971046acd42fde7b7eec1e68 (patch) | |
tree | 39ea47da728ce508d0ce0bc525eeac646fcce3d6 /tests | |
parent | 1c7a7a15af186866ce90d5f62eeb25f506be599f (diff) |
kmsview: support multiple planes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/kmsview.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/kmsview.cpp b/tests/kmsview.cpp index 7bd67a4..07dc09a 100644 --- a/tests/kmsview.cpp +++ b/tests/kmsview.cpp @@ -11,7 +11,8 @@ using namespace kms; static void read_frame(ifstream& is, DumbFramebuffer* fb, Crtc* crtc, Plane* plane) { - is.read((char*)fb->map(0), fb->size(0)); + for (unsigned i = 0; i < fb->num_planes(); ++i) + is.read((char*)fb->map(i), fb->size(i)); int r = crtc->set_plane(plane, *fb, 0, 0, fb->width(), fb->height(), @@ -65,7 +66,11 @@ int main(int argc, char** argv) FAIL_IF(!plane, "available plane not found"); - unsigned num_frames = fsize / fb->size(0); + unsigned frame_size = 0; + for (unsigned i = 0; i < fb->num_planes(); ++i) + frame_size += fb->size(i); + + unsigned num_frames = fsize / frame_size; printf("file size %u, frames %u\n", fsize, num_frames); for (unsigned i = 0; i < num_frames; ++i) { |