From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6F20510EEF8 for ; Mon, 2 May 2022 21:50:25 +0000 (UTC) Received: by mail-pg1-x529.google.com with SMTP id 7so8749050pga.12 for ; Mon, 02 May 2022 14:50:25 -0700 (PDT) MIME-Version: 1.0 References: <20220429011117.147-1-quic_jesszhan@quicinc.com> In-Reply-To: <20220429011117.147-1-quic_jesszhan@quicinc.com> From: Rob Clark Date: Mon, 2 May 2022 14:50:12 -0700 Message-ID: To: Jessica Zhang Content-Type: text/plain; charset="UTF-8" Subject: Re: [igt-dev] [PATCH i-g-t v1] tests/kms_universal_plane: Skip pageflip_test_pipe subtest if pipe has more than 1 primary plane List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org, quic_aravindh@quicinc.com, petri.latvala@intel.com Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On Thu, Apr 28, 2022 at 6:11 PM Jessica Zhang wrote: > > Currently, IGT assumes that the first primary plane it encounters in > display->planes is the primary plane being assigned to the current pipe > in the driver [1]. However, this is not always the case when planes are > being shared between pipes and there are multiple possible primary > planes. I wonder if it is actually worse than that.. igt_pipe_t seems designed around the idea that CRTCs have exclusive ownership of planes. Not sure if there are any tests that drive multiple CRTCs at the same time, which could end up trying to use the same plane on multiple pipes.. BR, -R > It's possible for IGT to set pipe->plane_primary to a primary plane > that's different from the one being used in the driver, since IGT uses > possible_crtcs to find the primary planes and stops at the first match. > > Unfortunately, DRM doesn't expose which primary plane is being used by a > pipe, so let's skip pageflip_test_pipe for cases where there are > multiple possible primary planes. > > [1] > https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/blob/master/lib/igt_kms.c#L2305 > > Signed-off-by: Jessica Zhang > --- > tests/kms_universal_plane.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/tests/kms_universal_plane.c b/tests/kms_universal_plane.c > index 3cb6d704a6ef..95cae2be1aaf 100644 > --- a/tests/kms_universal_plane.c > +++ b/tests/kms_universal_plane.c > @@ -470,13 +470,25 @@ static void > pageflip_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output) > { > pageflip_test_t test = { .data = data }; > - igt_plane_t *primary; > + igt_plane_t *primary, *plane; > struct timeval timeout = { .tv_sec = 0, .tv_usec = 500 }; > drmEventContext evctx = { .version = 2 }; > > fd_set fds; > + int primary_plane_count = 0; > int ret = 0; > > + for_each_plane_on_pipe(&data->display, pipe, plane) > + if (plane->type == DRM_PLANE_TYPE_PRIMARY) > + primary_plane_count++; > + > + /* > + * Skip subtest when there are multiple primary planes since we > + * aren't able to distinguish which primary plane is actually being > + * assigned a pipe > + */ > + igt_skip_on(primary_plane_count > 1); > + > igt_require_pipe(&data->display, pipe); > > igt_output_set_pipe(output, pipe); > -- > 2.31.0 >