From 2cfc1d86771a0835abdef86a6f6fcd914506da86 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 29 Jun 2018 13:26:00 +0300 Subject: kmstest: set props in legacy modesetting too Signed-off-by: Tomi Valkeinen --- utils/kmstest.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'utils') diff --git a/utils/kmstest.cpp b/utils/kmstest.cpp index 62b103f..aecb089 100644 --- a/utils/kmstest.cpp +++ b/utils/kmstest.cpp @@ -722,7 +722,7 @@ static void print_outputs(const vector& outputs) if (!o.legacy_fbs.empty()) { auto fb = o.legacy_fbs[0]; - printf(" (Fb %u %ux%u-%s)", fb->id(), fb->width(), fb->height(), PixelFormatToFourCC(fb->format()).c_str()); + printf(" Fb %u %ux%u-%s\n", fb->id(), fb->width(), fb->height(), PixelFormatToFourCC(fb->format()).c_str()); } for (unsigned j = 0; j < o.planes.size(); ++j) { @@ -764,30 +764,41 @@ static void set_crtcs_n_planes_legacy(Card& card, const vector& outp } for (const OutputInfo& o : outputs) { + int r; auto conn = o.connector; auto crtc = o.crtc; - if (!o.conn_props.empty() || !o.crtc_props.empty()) - printf("WARNING: properties not set without atomic modesetting"); + for (const PropInfo& prop : o.conn_props) { + r = conn->set_prop_value(prop.prop, prop.val); + EXIT_IF(r, "failed to set connector property %s\n", prop.name.c_str()); + } + + for (const PropInfo& prop : o.crtc_props) { + r = crtc->set_prop_value(prop.prop, prop.val); + EXIT_IF(r, "failed to set crtc property %s\n", prop.name.c_str()); + } if (!o.legacy_fbs.empty()) { auto fb = o.legacy_fbs[0]; - int r = crtc->set_mode(conn, *fb, o.mode); + r = crtc->set_mode(conn, *fb, o.mode); if (r) printf("crtc->set_mode() failed for crtc %u: %s\n", crtc->id(), strerror(-r)); } for (const PlaneInfo& p : o.planes) { + for (const PropInfo& prop : p.props) { + r = p.plane->set_prop_value(prop.prop, prop.val); + EXIT_IF(r, "failed to set plane property %s\n", prop.name.c_str()); + } + auto fb = p.fbs[0]; - int r = crtc->set_plane(p.plane, *fb, + r = crtc->set_plane(p.plane, *fb, p.x, p.y, p.w, p.h, 0, 0, fb->width(), fb->height()); if (r) printf("crtc->set_plane() failed for plane %u: %s\n", p.plane->id(), strerror(-r)); - if (!p.props.empty()) - printf("WARNING: properties not set without atomic modesetting"); } } } -- cgit v1.2.3