From patchwork Sun Aug 12 20:03:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haneen Mohammed X-Patchwork-Id: 10564505 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 762831390 for ; Mon, 13 Aug 2018 16:31:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FA4329570 for ; Mon, 13 Aug 2018 16:31:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 540CA29597; Mon, 13 Aug 2018 16:31:01 +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 86D63295A0 for ; Mon, 13 Aug 2018 16:30:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 839286E16A; Mon, 13 Aug 2018 16:30:58 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5ECAE89DE6; Sun, 12 Aug 2018 20:03:46 +0000 (UTC) Received: by mail-qt0-x241.google.com with SMTP id n6-v6so15420151qtl.4; Sun, 12 Aug 2018 13:03:46 -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=zm5MvK0hFd5cTzZF2lO5DE/R03bqS2TdirF/hRVx9Qg=; b=ShLsEhNiGbdFTplmUVNJ85l/iffZHmOFur8rsiNo8szXojphiKWeOSg8t6u6FtEhcA nVh8okkjJ/MJ99upW2RS9b4zhrgKY5cu9bU48V/DftF01lHSf7Swn6lwuV8aag1CYJ3K pagUQ+s6N/qQ5X8avwSvcSaBqRO4eaGHfeEuJjy/Q44f7aDbJlPcLEHmzKc2P20bjMZ1 fWSmEFPnhNBq2R7HFFhF9Moz4ZYCD6wr88WJSNfZqgayvM/DbbnFfWZw1kKZ0tubqfFQ wmpGEvQzmlA18Ja4zRXb3nBkLaWwfhjrR6qYcusP9wfzGkg+W/WsOu5jhpfRJLX5QDAV lDOw== X-Gm-Message-State: AOUpUlF7LNrcipHoiDHJgU6L8Fd55qVtryTIeS9jKbL76uCXOT864cXS DLvIztOMIxh8PqM5RNl9P7VrTvsQ X-Google-Smtp-Source: AA+uWPyD0IlGt4W4nzpXgU3OLehoOW31aNQfm/WOCnfODkLec1L3kcrgN9UaehzOC0A0twl6OEnu9w== X-Received: by 2002:aed:38a9:: with SMTP id k38-v6mr13594843qte.170.1534104225236; Sun, 12 Aug 2018 13:03:45 -0700 (PDT) Received: from haneenDRM ([172.58.224.175]) by smtp.gmail.com with ESMTPSA id h13-v6sm3437814qth.31.2018.08.12.13.03.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Aug 2018 13:03:44 -0700 (PDT) Date: Sun, 12 Aug 2018 23:03:41 +0300 From: Haneen Mohammed To: igt-dev@lists.freedesktop.org Message-ID: <20180812200341.GA17162@haneenDRM> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-Mailman-Approved-At: Mon, 13 Aug 2018 16:30:57 +0000 Subject: [Intel-gfx] [PATCH i-g-t] 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 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 --- 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..870d7fec 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 true; + + 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);