From patchwork Thu Oct 29 10:35:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Stone X-Patchwork-Id: 7518081 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8C7599F750 for ; Thu, 29 Oct 2015 10:35:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D637D204FC for ; Thu, 29 Oct 2015 10:35:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B97AE204D5 for ; Thu, 29 Oct 2015 10:35:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0FCD46E645; Thu, 29 Oct 2015 03:35:43 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by gabe.freedesktop.org (Postfix) with ESMTPS id D6A326E63E for ; Thu, 29 Oct 2015 03:35:33 -0700 (PDT) Received: by wicll6 with SMTP id ll6so38152704wic.1 for ; Thu, 29 Oct 2015 03:35:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fooishbar_org.20150623.gappssmtp.com; s=20150623; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=lhz/MhxNAgdxvNkAs3G4g809c5KQEHDFi5gW/3n7KK0=; b=IrnczwGXPTqJjMMKZtYhW1pOnKvYUGo0LRU7LBvvekUtaQCM6rC7G73AucPW8eWmpY R189rQZgj6t/eCJIw0FqC5S3rNgYb2Tp9CGjaG90cFMY/zuPaYlklE3hy8bsR+LXcBs4 RLj4xyTEicvLbfH6g1IibnA8O9bZIrit1GMbItVXiR1c3WDxPBGimrj5GkT6BuGTFbkh qe0/WgBJUQwD5SXo/O7nMVPv7usWCUzUqWslox7WEEl5k97ybCPIVdfGLtIoAiM4weeN Lhlpy8gH+K7bryGYynpH9ORGWzVFuWARehUrB8rkiuw6fkkRe2arm0TXAWagilktP08X Q1eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=lhz/MhxNAgdxvNkAs3G4g809c5KQEHDFi5gW/3n7KK0=; b=ZlJx4cJnoTaOYMyyBp087dvOsZO4OWsagsUhfDOKJIlA0PQ2m/qoGK4mey+M3swJnm oBeR40t8gZcMyuQ6Uo46QKHQNdPt9aRMONkbqq7KPnYJvpVcp2a21vCddgzuS87KkvYf SnbW08MXPT9sjY9sSufVMcYgAJtEngwU8vppbq/RAQkBZ0K9bUdaHifSFSMrV4A1wXXt bGg5MI0VGV1m7WWvZv7ETJ9QKqdZrDuuvdEhaIhSxl882BpLttlG1uHjUmxrpyfQhd53 8HScL1Pv9qbruhzB1RdVY0CDn11cZ38F6wwXxv74Dq1+yRO5nbtoAZ2NKcq7O6DMqFA6 tvBw== X-Gm-Message-State: ALoCoQk31Z3l5CcNurjxoP9YqTuh+b8609mCVwwKwC/H1Ri6qPwI4BGtos7DAhwnrDnRoRf7dbzJ X-Received: by 10.28.21.17 with SMTP id 17mr6025640wmv.82.1446114932403; Thu, 29 Oct 2015 03:35:32 -0700 (PDT) Received: from fxhe.lan (93-97-222-139.zone5.bethere.co.uk. [93.97.222.139]) by smtp.gmail.com with ESMTPSA id iw8sm1109771wjb.5.2015.10.29.03.35.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Oct 2015 03:35:31 -0700 (PDT) From: Daniel Stone To: dri-devel@lists.freedesktop.org Subject: [PATCH igt v7 3/4] tests/core_prop_blob: Add multiple blobs per connection Date: Thu, 29 Oct 2015 10:35:23 +0000 Message-Id: <1446114924-7192-2-git-send-email-daniels@collabora.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1446114924-7192-1-git-send-email-daniels@collabora.com> References: <1446114679-6844-1-git-send-email-daniels@collabora.com> <1446114924-7192-1-git-send-email-daniels@collabora.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This should hit the bug fixed in: XXX FIXME INSERT SEANPAUL COMMIT CITE which was introduced with the initial blob support in: commit e2f5d2ea479b9b2619965d43db70939589afe43a Author: Daniel Stone Date: Fri May 22 13:34:51 2015 +0100 drm/mode: Add user blob-creation ioctl Add an ioctl which allows users to create blob properties from supplied data. Currently this only supports modes, creating a drm_display_mode from the userspace drm_mode_modeinfo. v2: Removed size/type checks. Rebased on new patches to allow error propagation from create_blob, as well as avoiding double-allocation. Signed-off-by: Daniel Stone Reviewed-by: Maarten Lankhorst Tested-by: Sean Paul Signed-off-by: Daniel Vetter Signed-off-by: Daniel Stone --- tests/core_prop_blob.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/core_prop_blob.c b/tests/core_prop_blob.c index df4f3ad..365d728 100644 --- a/tests/core_prop_blob.c +++ b/tests/core_prop_blob.c @@ -208,6 +208,43 @@ test_lifetime(int fd) } static void +test_multiple(int fd) +{ + uint32_t prop_ids[5]; + int fd2; + int i; + + fd2 = drm_open_driver(DRIVER_ANY); + igt_assert_fd(fd2); + + /* Ensure destroying multiple properties explicitly works as needed. */ + for (i = 0; i < ARRAY_SIZE(prop_ids); i++) { + prop_ids[i] = create_prop(fd2); + igt_assert_eq(validate_prop(fd, prop_ids[i]), 0); + igt_assert_eq(validate_prop(fd2, prop_ids[i]), 0); + } + for (i = 0; i < ARRAY_SIZE(prop_ids); i++) { + igt_assert_eq(destroy_prop(fd2, prop_ids[i]), 0); + igt_assert_eq(validate_prop(fd2, prop_ids[i]), ENOENT); + } + igt_assert_eq(close(fd2), 0); + + fd2 = drm_open_driver(DRIVER_ANY); + igt_assert_fd(fd2); + + /* Ensure that multiple properties get cleaned up on fd close. */ + for (i = 0; i < ARRAY_SIZE(prop_ids); i++) { + prop_ids[i] = create_prop(fd2); + igt_assert_eq(validate_prop(fd, prop_ids[i]), 0); + igt_assert_eq(validate_prop(fd2, prop_ids[i]), 0); + } + igt_assert_eq(close(fd2), 0); + + for (i = 0; i < ARRAY_SIZE(prop_ids); i++) + igt_assert_eq(validate_prop(fd, prop_ids[i]), ENOENT); +} + +static void test_core(int fd) { uint32_t prop_id; @@ -256,6 +293,9 @@ igt_main igt_subtest("blob-prop-lifetime") test_lifetime(fd); + igt_subtest("blob-multiple") + test_multiple(fd); + igt_fixture close(fd); }