From patchwork Thu Aug 16 20:56:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haneen Mohammed X-Patchwork-Id: 10568991 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0FD7A15E2 for ; Fri, 17 Aug 2018 14:55:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0209C2BC0B for ; Fri, 17 Aug 2018 14:55:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E87F62BC2D; Fri, 17 Aug 2018 14:55:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9C6192BC0B for ; Fri, 17 Aug 2018 14:55:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5C1606E64A; Fri, 17 Aug 2018 14:55:24 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yb0-x244.google.com (mail-yb0-x244.google.com [IPv6:2607:f8b0:4002:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 89E766E023; Thu, 16 Aug 2018 20:57:00 +0000 (UTC) Received: by mail-yb0-x244.google.com with SMTP id o17-v6so1165250yba.2; Thu, 16 Aug 2018 13:57:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=iAguT9HWBac0HowQ6EKhQcY+tJhajpMHiaidSMZKy14=; b=mPaO+VVLhUaHXWfQG5wBkYkkCMMbI+qR0rT/A4uMXlBxyjf8DGEkWCaBjXjzZ49Wwi Gxk2v7E1Sxoj1QGftgQbvXl68Ki1XkXw6KWIM976qVPlBLcJmTOjqqNGhb1I3JV2ZsZf Bl1kp3lGdDsDHzKgrOPS452XBH+pUWoTDx6sMIBjEKrnte+S8wRT6EwU+KloxyrM/EWT WX/ULTUAQ0v+KnPBt9lM8MIOkNSEcOYCd4MLWgv8h/+IxF8yrjw0kJU1ZiMZZcCTiZpM GUrhlTRXJs5xNPfvYvG2C8AbSl5M9LcbjWm3Dk/FR8bNACAdIhhi6L9HFYMqlhYosbmK wFCg== X-Gm-Message-State: AOUpUlGeFAww9L/l+xjK3fjTQPJUwD4CNd9ZDEVoQ86bu1+DgHja21sM eUTkx7sbo6axDKxTx6vexwa6WL1kPz4= X-Google-Smtp-Source: AA+uWPyOehhSmf8Y7JOW8NWdaDyVilaCSKO2p2SYuh+WFAlIEmpsvvgE4Xro1tQs7i5VWHUDahNdkA== X-Received: by 2002:a25:7d43:: with SMTP id y64-v6mr17036185ybc.153.1534453019340; Thu, 16 Aug 2018 13:56:59 -0700 (PDT) Received: from haneenDRM ([172.56.35.234]) by smtp.gmail.com with ESMTPSA id p134-v6sm139803ywe.30.2018.08.16.13.56.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Aug 2018 13:56:58 -0700 (PDT) Date: Thu, 16 Aug 2018 23:56:55 +0300 From: Haneen Mohammed To: igt-dev@lists.freedesktop.org Message-ID: <20180816205655.GA13515@haneenDRM> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-Mailman-Approved-At: Fri, 17 Aug 2018 14:55:22 +0000 Subject: [Intel-gfx] [PATCH i-g-t V2] tests/kms_cursor_crc: Open DRM device with DRIVER_ANY X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, seanpaul@chromium.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP So that this test can be run in drivers other than i915. Remove devid and only check it if the driver is i915. Signed-off-by: Haneen Mohammed --- changes in v2: - return false for has_nonsquare_cursors() when driver not i915. tests/kms_cursor_crc.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c index a164839e..99946b1a 100644 --- a/tests/kms_cursor_crc.c +++ b/tests/kms_cursor_crc.c @@ -59,7 +59,6 @@ typedef struct { int curw, curh; /* cursor size */ int cursor_max_w, cursor_max_h; igt_pipe_crc_t *pipe_crc; - uint32_t devid; unsigned flags; } data_t; @@ -108,6 +107,13 @@ static void cursor_disable(data_t *data) static bool chv_cursor_broken(data_t *data, int x) { + uint32_t devid; + + if (!is_i915_device(data->drm_fd)) + return false; + + devid = intel_get_drm_devid(data->drm_fd); + /* * CHV gets a FIFO underrun on pipe C when cursor x coordinate * is negative and the cursor visible. @@ -121,7 +127,7 @@ static bool chv_cursor_broken(data_t *data, int x) if (x >= 0) return false; - return IS_CHERRYVIEW(data->devid) && data->pipe == PIPE_C; + return IS_CHERRYVIEW(devid) && data->pipe == PIPE_C; } static bool cursor_visible(data_t *data, int x, int y) @@ -459,8 +465,15 @@ static void create_cursor_fb(data_t *data, int cur_w, int cur_h) igt_put_cairo_ctx(data->drm_fd, &data->fb, cr); } -static bool has_nonsquare_cursors(uint32_t devid) +static bool has_nonsquare_cursors(data_t *data) { + uint32_t devid; + + if (!is_i915_device(data->drm_fd)) + return false; + + devid = intel_get_drm_devid(data->drm_fd); + /* * Test non-square cursors a bit on the platforms * that support such things. @@ -616,19 +629,19 @@ static void run_test_generic(data_t *data) /* Using created cursor FBs to test cursor support */ igt_subtest_f("cursor-%dx%d-onscreen", w, h) { - igt_require(has_nonsquare_cursors(data->devid)); + igt_require(has_nonsquare_cursors(data)); run_test(data, test_crc_onscreen, w, h); } igt_subtest_f("cursor-%dx%d-offscreen", w, h) { - igt_require(has_nonsquare_cursors(data->devid)); + igt_require(has_nonsquare_cursors(data)); run_test(data, test_crc_offscreen, w, h); } igt_subtest_f("cursor-%dx%d-sliding", w, h) { - igt_require(has_nonsquare_cursors(data->devid)); + igt_require(has_nonsquare_cursors(data)); run_test(data, test_crc_sliding, w, h); } igt_subtest_f("cursor-%dx%d-random", w, h) { - igt_require(has_nonsquare_cursors(data->devid)); + igt_require(has_nonsquare_cursors(data)); run_test(data, test_crc_random, w, h); } @@ -647,9 +660,7 @@ igt_main igt_skip_on_simulation(); igt_fixture { - data.drm_fd = drm_open_driver_master(DRIVER_INTEL); - - data.devid = intel_get_drm_devid(data.drm_fd); + data.drm_fd = drm_open_driver_master(DRIVER_ANY); ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_WIDTH, &cursor_width); igt_assert(ret == 0 || errno == EINVAL);