From patchwork Fri Jun 14 17:33:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 10996113 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 C356A13AD for ; Fri, 14 Jun 2019 17:35:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB2FD286B8 for ; Fri, 14 Jun 2019 17:35:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E899286C2; Fri, 14 Jun 2019 17:35:49 +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 1A364286B8 for ; Fri, 14 Jun 2019 17:35:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 34DAC89A32; Fri, 14 Jun 2019 17:35:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 52AF689A32; Fri, 14 Jun 2019 17:35:46 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id f17so594076wme.2; Fri, 14 Jun 2019 10:35: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:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bNJfkEuMYhEwSthauk+Wp2OmCzQgIDnt7UR4PLu0tKg=; b=EmGkDwAJIyhkPdM9Cys66Fk0OglWH52i5eCnTxwC3meGUKAVLZV4znBBWmYJfHbxVR XdCbg2mzk/wBpUV71wn8jEvNVkiA8+j92Uq23XVy3bLT1M6HIrMtH3+e+09Ds8FAeBeV QMKvfoBSexHGKK3Q1LoANVi/S/gzM5l4A3g6XzN1yqRSAr+MRWny4EUyUCGzchfYE3wy 0zg2+w2dfu7GCRkCl0oo+XnJ0BqESGuLIUbkwY0lZRzHLEPkHsic+aAefVP7HyfJ/56A WLgkrFVoGTUODBJ9XalSA9LlBbTFbNOC3qAAkTI02O3lpg0ooNYVVsScrLhHelZjioIR LZ5g== X-Gm-Message-State: APjAAAWF8qFfAske7mXZse7cNCnRby94h+1BDztyBsL37vTTG2Sn9KwZ svWDrLkJS5FJros1nRQHzSOGu9YB X-Google-Smtp-Source: APXvYqwsz8dS9aTyz7A34MT9FBSuU2gKT1Radv05A99uwRvphJLvWCIGepqvAzTEYDYMlGqpebZgSA== X-Received: by 2002:a1c:a1c1:: with SMTP id k184mr3584708wme.81.1560533743860; Fri, 14 Jun 2019 10:35:43 -0700 (PDT) Received: from arch-x1c3.cbg.collabora.co.uk ([2a00:5f00:102:0:9665:9cff:feee:aa4d]) by smtp.gmail.com with ESMTPSA id a81sm5628960wmh.3.2019.06.14.10.35.42 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 14 Jun 2019 10:35:43 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/amdgpu: extend AMDGPU_CTX_PRIORITY_NORMAL comment Date: Fri, 14 Jun 2019 18:33:35 +0100 Message-Id: <20190614173335.30907-1-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bNJfkEuMYhEwSthauk+Wp2OmCzQgIDnt7UR4PLu0tKg=; b=tj1hnAQN10SgBZ0riI3o8/amCboNepl/OAxZ9Ipz94c4/h9nRe87wfXhRiX+1Y50f7 Rzas58aDmwFk/SRtXAGTlduIq6YWhIMysB9DsgOScntXRq4UAB8cNbRQ/yrSRucY8MG9 dhxFTDPQ3oyn6Mv8Tcqr0vIRc6GGKazfvZf/hygnq2uA5iyY3rTlAusbnGal7/pVxtU1 8N4RMPZ+ul8EFACKZUEdhRE3OY5TfkSMLkpIRvtUTxXz4wPD8CzuqUeJV7ysrCHOVPIb bY0DSRNiadqnql+j3kq+/rWDuBmjWA1h10n7BxB7klwLwKkVMEM79tp/AZt8/J4j5eqU WFpw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , amd-gfx@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Emil Velikov Currently the AMDGPU_CTX_PRIORITY_* defines are used in both drm_amdgpu_ctx_in::priority and drm_amdgpu_sched_in::priority. Extend the comment to mention the CAP_SYS_NICE or DRM_MASTER requirement is only applicable with the former. Cc: Bas Nieuwenhuizen Cc: Christian König Cc: Alex Deucher Signed-off-by: Emil Velikov --- Mildly curious: why didn't one extend ctx_amdgpu_ctx instead of adding drm_amdgpu_sched? New flag + _u32 fd at the end (for the former) would have been enough (and tweaking the ioctl permission thingy). Speaking of flags, drm_amdgpu_sched_in lost its so extending it will be "fun" --- include/uapi/drm/amdgpu_drm.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h index 4788730dbe78..dfb10fba2fe8 100644 --- a/include/uapi/drm/amdgpu_drm.h +++ b/include/uapi/drm/amdgpu_drm.h @@ -219,7 +219,10 @@ union drm_amdgpu_bo_list { #define AMDGPU_CTX_PRIORITY_VERY_LOW -1023 #define AMDGPU_CTX_PRIORITY_LOW -512 #define AMDGPU_CTX_PRIORITY_NORMAL 0 -/* Selecting a priority above NORMAL requires CAP_SYS_NICE or DRM_MASTER */ +/* + * When used in struct drm_amdgpu_ctx_in, a priority above NORMAL requires + * CAP_SYS_NICE or DRM_MASTER +*/ #define AMDGPU_CTX_PRIORITY_HIGH 512 #define AMDGPU_CTX_PRIORITY_VERY_HIGH 1023 @@ -229,6 +232,7 @@ struct drm_amdgpu_ctx_in { /** For future use, no flags defined so far */ __u32 flags; __u32 ctx_id; + /** AMDGPU_CTX_PRIORITY_* */ __s32 priority; }; @@ -281,6 +285,7 @@ struct drm_amdgpu_sched_in { /* AMDGPU_SCHED_OP_* */ __u32 op; __u32 fd; + /** AMDGPU_CTX_PRIORITY_* */ __s32 priority; __u32 ctx_id; };