From patchwork Wed Jan 15 20:56:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Ho X-Patchwork-Id: 11336361 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 546EA13A0 for ; Thu, 16 Jan 2020 08:21:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3355420748 for ; Thu, 16 Jan 2020 08:21:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=brkho-com.20150623.gappssmtp.com header.i=@brkho-com.20150623.gappssmtp.com header.b="gemQ994Q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3355420748 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=brkho.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0A30B6EC36; Thu, 16 Jan 2020 08:21:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-vs1-xe63.google.com (mail-vs1-xe63.google.com [IPv6:2607:f8b0:4864:20::e63]) by gabe.freedesktop.org (Postfix) with ESMTPS id BCFA56EA9B for ; Wed, 15 Jan 2020 20:57:19 +0000 (UTC) Received: by mail-vs1-xe63.google.com with SMTP id b79so11307645vsd.9 for ; Wed, 15 Jan 2020 12:57:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brkho-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qHyeBb8P8MuXBOujO8Ub/x9es/mztS5rWLEPJQm2/Ko=; b=gemQ994QSr6JkWm5dYBVsYR1LIUE6WIVOW8OxEKlh9bU4AqNaICD0FbZpeOl6z/LAl vuC+aCpJJETBjSq2TECPu90Go2szUdkpo1gjupaHPIGJ9ZZooVYxI71Rirzmg6A4bu1L C/inqb7wdAsLxPei6JNCqpy1b5SAaEnWS23sMH6VFSBAKedca6LycF29bEiadY3uRsC2 5pyd9Vh82G2+fmvOBf/aPdjBWU9KkWz+IfbKfdlYWoElECqklH7jr3veHq3W7vdY5cHF /ZlDSYv6Igq7WkuojeDl6YSvE69k3n6aCqYrLg13TbuutyCBl5JkOU/tEG1KzumGXC9M Tfuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qHyeBb8P8MuXBOujO8Ub/x9es/mztS5rWLEPJQm2/Ko=; b=BFIjAGo0zPpEpSN+bXc4GkBbtL+sgaCs5sb1OQc3dxVjnPAsjGdk8hqlYQiPI3tsVa jNMbA2dxV9SFUnWBa6jxa78T+1Sy7TPUycL3aJpbKM946F2CQwvV5y0BtQ/FqlHvFbDb 6B01jsySvYhf51XntfoWrcdNBgnXaEYBD3rflIp73aXxL7Xh+4lJ3J7ht3lYCAKRWRQx VW4/cHE+q+AknSqqq8v1B42AVSz/X4fbjnsL6sUdaqT6T9rxVWXCV8yjxq3EPtZ1M67r qR9q4uavEHvV5MOicGJoTVpzqAn+0L4obvwBjWfJI/dsOkzqrc1wdSDCaHBZowM2gsZx /J0g== X-Gm-Message-State: APjAAAVjzWDm/3ShT19ztuwupsgKJlWeP4n2Dl5BnfPilouu1xXwO9H5 n/z//epoEC0sWOzrQbnumBllA/1CVDawFP+G6qvg4FsL+O7+8w== X-Google-Smtp-Source: APXvYqwa4eobrkUlejkxbm2vmrBfah47TV7vVGHvbgpZIUMZp/IuDRvCLBzND9WHntaSOfLkMYAbMYa3NIun X-Received: by 2002:a05:6102:3126:: with SMTP id f6mr5458988vsh.204.1579121838618; Wed, 15 Jan 2020 12:57:18 -0800 (PST) Received: from hob1.nyc.corp.google.com ([100.118.32.120]) by smtp-relay.gmail.com with ESMTPS id j26sm1472756uak.1.2020.01.15.12.57.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 12:57:18 -0800 (PST) X-Relaying-Domain: brkho.com From: Brian Ho To: freedreno@lists.freedesktop.org Subject: [PATCH v2 0/2] drm/msm: Add the MSM_WAIT_IOVA ioctl Date: Wed, 15 Jan 2020 15:56:47 -0500 Message-Id: <20200115205649.12971-1-brian@brkho.com> X-Mailer: git-send-email 2.25.0.rc1.283.g88dfdc4193-goog MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 16 Jan 2020 08:21:03 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robdclark@chromium.org, Brian Ho , "open list:DRM DRIVER FOR MSM ADRENO GPU" , open list , "open list:DRM DRIVER FOR MSM ADRENO GPU" , hoegsberg@chromium.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patch set implements the MSM_WAIT_IOVA ioctl which lets userspace sleep until the value at a given iova reaches a certain condition. This is needed in turnip to implement the VK_QUERY_RESULT_WAIT_BIT flag for vkGetQueryPoolResults. First, we add a GPU-wide wait queue that is signaled on all IRQs. We can then wait on this wait queue inside MSM_WAIT_IOVA until the condition is met. The corresponding merge request in mesa can be found at: https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3279 Changes in v2: * Updated cleanup logic on error * Added a mask * 32 bit values by default Brian Ho (2): drm/msm: Add a GPU-wide wait queue drm/msm: Add MSM_WAIT_IOVA ioctl drivers/gpu/drm/msm/msm_drv.c | 61 +++++++++++++++++++++++++++++++++-- drivers/gpu/drm/msm/msm_gpu.c | 4 +++ drivers/gpu/drm/msm/msm_gpu.h | 3 ++ include/uapi/drm/msm_drm.h | 14 ++++++++ 4 files changed, 80 insertions(+), 2 deletions(-) Reviewed-by: Kristian H. Kristensen