From patchwork Sat Jul 20 08:45:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11050817 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 97E0113B1 for ; Sat, 20 Jul 2019 08:46:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87C332898C for ; Sat, 20 Jul 2019 08:46:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 793162898E; Sat, 20 Jul 2019 08:46:08 +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,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 22DA82898C for ; Sat, 20 Jul 2019 08:46:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2A6E16E895; Sat, 20 Jul 2019 08:46:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0488F6E888; Sat, 20 Jul 2019 08:45:54 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id i21so32931526ljj.3; Sat, 20 Jul 2019 01:45:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=5bCKsoONVp9v/i0uE4V+7JVM6Ep6Ht+p5Byht1Y7c+M=; b=ezmj/lWYZ2w+g7NjAth3BjLR0nYbqX6TmiOd8GAJ0Tp2NbOBwdAM9I3jWdsfVWOnxX y+IxHzNQzgmLs62/9LEUhRlAZ4HIr700LoCv4UV/R3q7AHdYoJUfocdAiRhaBLB3z8VL /yVquGbbK7+lQdCC8IjoSNNWzvEKDFj1po7wacUoWUS5axw7Hu5j3qeQ2PeOT9ckSDQQ eaYaRNIw6SeHSxP0OGZ6jzs+TxiFj7/vDtXkvsiPb8trh1/p/lK/1EVbPIBzS7czip6L 5KQlWdaY3hnAz/Unju8sx9UqGUdAyZNGEfqI0X5q7bQCH7kPVRLPiR3erVGwq4WA5Vum zQGA== X-Gm-Message-State: APjAAAX1BWFz+CMFJ9hZv19fpP32yykHug+jhetLrgv3fufzAyeteaHt 69wC4NqAFgYLBdpDHW0LpanNm8VE3zs= X-Google-Smtp-Source: APXvYqzLmICwVJI0xuFdgtgJSFdzktOhdrpDLnrbrMd8ylnft4HiMlbf7I+U6N4rZQJfY4RI+gPrzA== X-Received: by 2002:a2e:720b:: with SMTP id n11mr30523480ljc.213.1563612352224; Sat, 20 Jul 2019 01:45:52 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id o3sm5047022lfb.40.2019.07.20.01.45.51 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 01:45:51 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, openchrome-devel@lists.freedesktop.org Subject: [PATCH v2 1/4] drm/via: drop use of DRM(READ|WRITE) macros Date: Sat, 20 Jul 2019 10:45:24 +0200 Message-Id: <20190720084527.12593-2-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190720084527.12593-1-sam@ravnborg.org> References: <20190720084527.12593-1-sam@ravnborg.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5bCKsoONVp9v/i0uE4V+7JVM6Ep6Ht+p5Byht1Y7c+M=; b=WwfrwhCCzIVz3MO7knrE0Y65hmceYpNrU9T1mpKSvSWVDBNU1CPPVCFQ5TwY79Rpro b9GvV3SjyOh6e5zQwjt4HjLAoVMXvP8tDSHAjcCySM/Fx0NPqOZ2lT9MNhp7aKou8kBF znrJIgg6rU0axYsoQrPEMtf0f5tZRwbC4aUpozNEUvh8NT8SdbSrSAGE0EpUAF4FE8cG HaXhGmy0dwLoGMGioA7clwg5Ck/EEwLgl7anEae1WPgK6+OGiqyudP6VVOkGDwZ3RUJZ KKazzPGLy7kDgVU4J14iYjd29EUNK0YYQ/nxGBOv9nf07DxHJPZ5mhn7+DK82GkJWVBa ARYA== 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: Thomas Hellstrom , Sam Ravnborg , "Gustavo A. R. Silva" , David Airlie , Daniel Vetter , =?utf-8?q?Michel_D=C3=A4nzer?= , Kevin Brace , Mike Marshall , Ira Weiny , Emil Velikov Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The DRM_READ, DRM_WRITE macros comes from the deprecated drm_os_linux.h header file. Remove their use to remove this dependency. Replace the use of the macros with open coded variants. Signed-off-by: Sam Ravnborg Cc: Kevin Brace Cc: Thomas Hellstrom Cc: "Gustavo A. R. Silva" Cc: Mike Marshall Cc: Ira Weiny Cc: Daniel Vetter Cc: Emil Velikov Cc: Michel Dänzer --- drivers/gpu/drm/via/via_drv.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h index 6d1ae834484c..d5a2b1ffd8c1 100644 --- a/drivers/gpu/drm/via/via_drv.h +++ b/drivers/gpu/drm/via/via_drv.h @@ -115,10 +115,17 @@ enum via_family { /* VIA MMIO register access */ #define VIA_BASE ((dev_priv->mmio)) -#define VIA_READ(reg) DRM_READ32(VIA_BASE, reg) -#define VIA_WRITE(reg, val) DRM_WRITE32(VIA_BASE, reg, val) -#define VIA_READ8(reg) DRM_READ8(VIA_BASE, reg) -#define VIA_WRITE8(reg, val) DRM_WRITE8(VIA_BASE, reg, val) +#define VIA_READ(reg) \ + readl(((void __iomem *)VIA_BASE->handle) + (reg)) + +#define VIA_WRITE(reg, val) \ + writel(val, ((void __iomem *)VIA_BASE->handle) + (reg)) + +#define VIA_READ8(reg) \ + readb(((void __iomem *)VIA_BASE->handle) + (reg)) + +#define VIA_WRITE8(reg, val) \ + writeb(val, ((void __iomem *)VIA_BASE->handle) + (reg)) extern const struct drm_ioctl_desc via_ioctls[]; extern int via_max_ioctl; From patchwork Sat Jul 20 08:45:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11050815 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 C3A9A13AC for ; Sat, 20 Jul 2019 08:46:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF1382898C for ; Sat, 20 Jul 2019 08:46:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2A3E2898E; Sat, 20 Jul 2019 08:46:06 +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,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 EF5F82898C for ; Sat, 20 Jul 2019 08:46:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 106D06E893; Sat, 20 Jul 2019 08:46:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1F4476E88A; Sat, 20 Jul 2019 08:45:55 +0000 (UTC) Received: by mail-lf1-x141.google.com with SMTP id c9so23282276lfh.4; Sat, 20 Jul 2019 01:45:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=DLIxb5xG1R1/AMn7Cxx7Gmv1fB7QRIbhWjnyMccdsgs=; b=mdUKUu3T05EuAYPEJ+7t8iU8F0qbw4OywDUQIHTQ6LOD/qWUBmByehQojOfWT4YqIz 9K22d9rCkzh6ApJ0S32/76X9yZVI8LXpNZHtmwftdaDMiaH6hmwqhISa/6ZO0YqtZIAS owazu+fJFJliOw2DhtPGZrKBUCS21j1hCUaFtJ/R5ccnV6XFhDgK/A78oTyH3JYxCDwA hamuK2A1eLxdWhnZPmZL6WVuD7NsdER1zqckh6svV5s3F81fD54i8AqqW2dbZlzOtuf5 Jl7SVc6A1HyO8XnBer5OxVMSDcekGQK1nSbzFi5GlM+6rGbLIGfAbnkIMu8yzz47vnD4 RgfA== X-Gm-Message-State: APjAAAUSjhmMUBWykSUzzIU/Dm0S6y9Tt+MjtB+33FEUbg6pboqUvtHk y7xN+vIOGeWl3Mj1Z7+4WaZ0wyrzYuU= X-Google-Smtp-Source: APXvYqwNuyA0w/+CrxrmuWb8MbtKhoIw9BqxmpQl8svk9III6lWiHYVVNHxjUkd+TR3+0/0Qai58FQ== X-Received: by 2002:ac2:5382:: with SMTP id g2mr25289409lfh.92.1563612353319; Sat, 20 Jul 2019 01:45:53 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id o3sm5047022lfb.40.2019.07.20.01.45.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 01:45:52 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, openchrome-devel@lists.freedesktop.org Subject: [PATCH v2 2/4] drm/via: add VIA_WAIT_ON() Date: Sat, 20 Jul 2019 10:45:25 +0200 Message-Id: <20190720084527.12593-3-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190720084527.12593-1-sam@ravnborg.org> References: <20190720084527.12593-1-sam@ravnborg.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DLIxb5xG1R1/AMn7Cxx7Gmv1fB7QRIbhWjnyMccdsgs=; b=M6YQwOtHxwTR0QGMSC1PCZvEqoZ6F40bLYP47IPQKadPckjY9/XTd0SlaU/+dV32Cl UQm2RecdFhp4jPTSbLhbTBd9MPiL++xEk/CkZ+XE8DPUH4Kc5Ggz9BHPgqxN8XPTYTGZ C6wJmS+fYaPdqXG9vMKqrRunJcdw8ewxKsrxX1xR3GK452zcug3Ty3AAJ75e6c0J0nZ/ v4F4j3sLDbJk3Vgd2NYdc6HSN9rKmWTXYTuJQOjwGa6KI7Eyk/gqh2KmB9/ewFyJhQcB CHKaSKxdE1vR97gCafnpQYJiV94ecw0C5jv+yrN6SEzPTutaCwL/Ds2uyhPI84+sa+l+ J+Ag== 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: Thomas Hellstrom , Sam Ravnborg , "Gustavo A. R. Silva" , David Airlie , Daniel Vetter , =?utf-8?q?Michel_D=C3=A4nzer?= , Kevin Brace , Mike Marshall , Ira Weiny , Emil Velikov Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP VIA_WAIT_ON() is a direct copy of DRM_WAIT_ON() from drm_os_linux.h. The copy is made so we can avoid the dependency on the legacy header. A more involved approach had been to introduce wait_event_* but for this legacy driver the simpler and more safe approach with a copy of the macro was selected. Added the relevant header files for the functions used in VIA_WAIT_ON. Users of the macro will come in a follow-up patch. Signed-off-by: Sam Ravnborg Cc: Kevin Brace Cc: Thomas Hellstrom Cc: "Gustavo A. R. Silva" Cc: Mike Marshall Cc: Ira Weiny Cc: Daniel Vetter Cc: Emil Velikov Cc: Michel Dänzer --- drivers/gpu/drm/via/via_drv.h | 42 ++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h index d5a2b1ffd8c1..664b7f8a20c4 100644 --- a/drivers/gpu/drm/via/via_drv.h +++ b/drivers/gpu/drm/via/via_drv.h @@ -24,8 +24,13 @@ #ifndef _VIA_DRV_H_ #define _VIA_DRV_H_ -#include +#include +#include +#include +#include + #include +#include #define DRIVER_AUTHOR "Various" @@ -127,6 +132,41 @@ enum via_family { #define VIA_WRITE8(reg, val) \ writeb(val, ((void __iomem *)VIA_BASE->handle) + (reg)) +/* + * Poll in a loop waiting for 'contidition' to be true. + * Note: A direct replacement with wait_event_interruptible_timeout() + * will not work unless driver is updated to emit wake_up() + * in relevant places that can impact the 'condition' + * + * Returns: + * ret keeps current value if 'condition' becomes true + * ret = -BUSY if timeout happens + * ret = -EINTR if a signal interrupted the waiting period + */ +#define VIA_WAIT_ON( ret, queue, timeout, condition ) \ +do { \ + DECLARE_WAITQUEUE(entry, current); \ + unsigned long end = jiffies + (timeout); \ + add_wait_queue(&(queue), &entry); \ + \ + for (;;) { \ + __set_current_state(TASK_INTERRUPTIBLE); \ + if (condition) \ + break; \ + if (time_after_eq(jiffies, end)) { \ + ret = -EBUSY; \ + break; \ + } \ + schedule_timeout((HZ/100 > 1) ? HZ/100 : 1); \ + if (signal_pending(current)) { \ + ret = -EINTR; \ + break; \ + } \ + } \ + __set_current_state(TASK_RUNNING); \ + remove_wait_queue(&(queue), &entry); \ +} while (0) + extern const struct drm_ioctl_desc via_ioctls[]; extern int via_max_ioctl; From patchwork Sat Jul 20 08:45:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11050811 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 BC97F13AC for ; Sat, 20 Jul 2019 08:46:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABE4628717 for ; Sat, 20 Jul 2019 08:46:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E3EE2883B; Sat, 20 Jul 2019 08:46:00 +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,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 EF67628717 for ; Sat, 20 Jul 2019 08:45:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4659D6E890; Sat, 20 Jul 2019 08:45:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4D1666E88A; Sat, 20 Jul 2019 08:45:56 +0000 (UTC) Received: by mail-lf1-x141.google.com with SMTP id b17so23323776lff.7; Sat, 20 Jul 2019 01:45:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=3CsnQP6tvpanmnXgS6dwE2otzR47Y3wWJh7ZT0YV+B4=; b=nAlCw8savWcdQpqGQc/zHpBJDiGkuD82gz2cxh9EfjkdUSz+Fr2/hQxcOXcYvZ1JGT wmYtD6p1ELcxMOUuqppOus/4XQocxcR26zGvycjYWkYi1iDqJZCw6Mgr9+pR1+p28tbY +j2df5hpsLjWF6DTKvWZ75vVIIixfkrCY9ajNxvvyoIHR1bGhWGeLWm58HX4wRQkIHDG 9OCeP7lukW9w4nuTyeYQf21Phs2r6SO4/9b7YKD5bdHkKqbWmRWknGKMwpgxzTkQ5er1 O/WLJbHaj1yS59BpK8z4JVWUVsBYEJsa5MdyKOztgoZUC/FkUWRAwh97qv+jrHpG+8xx uwFQ== X-Gm-Message-State: APjAAAVS1gyzzYUQnpAyfeQUoBLZYunyyjKAdjsI5EXq4YcelmU+D9l2 oYcz4N9E5Q0LslaITMyXdW05oCZzRxQ= X-Google-Smtp-Source: APXvYqxur/qbwDqruEq4ksD5w1kS/TYdrzOrfzSqrwv6bePsRUnApHByOB19SH9qsFTEC9Ssp/ClhQ== X-Received: by 2002:ac2:5bc7:: with SMTP id u7mr26589181lfn.167.1563612354532; Sat, 20 Jul 2019 01:45:54 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id o3sm5047022lfb.40.2019.07.20.01.45.53 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 01:45:54 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, openchrome-devel@lists.freedesktop.org Subject: [PATCH v2 3/4] drm/via: make via_drv.h self-contained Date: Sat, 20 Jul 2019 10:45:26 +0200 Message-Id: <20190720084527.12593-4-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190720084527.12593-1-sam@ravnborg.org> References: <20190720084527.12593-1-sam@ravnborg.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3CsnQP6tvpanmnXgS6dwE2otzR47Y3wWJh7ZT0YV+B4=; b=JFWxQSVDqV1HsL9KjilMsPcAvZfmwX6Vw2Vt1XiuXmYN/jpcCl7rzuzaETaOwyB0KU zy0wejb4PXXlYGeC+6fre3LYzFEneLtoAwDV3bi4NeF3EWicwMgdl29Rx7wTB79tXxB0 DOebm4uahnzRnMcSLQi/t9uAaAmRLrbOcI4L+lGwDeYp63GGkWe3YO2ihyLlsDIqFyCG hDRpYzSVPvS9pIjiQTCzf0NSuA0hVaznB/HfCArF7XCGqR3qhJus1unEkWfMjU/YvOG1 KMuNCJOg8o+4DEUI/hgNebzXGh0qvRGG9t2Rc5D/scAhwFJjZzaYF8iRl6RJk8eB0ev6 WREw== 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: Thomas Hellstrom , Sam Ravnborg , "Gustavo A. R. Silva" , David Airlie , Daniel Vetter , =?utf-8?q?Michel_D=C3=A4nzer?= , Kevin Brace , Mike Marshall , Ira Weiny , Emil Velikov Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Added include of header file to make this header file self-contained. Signed-off-by: Sam Ravnborg Cc: Kevin Brace Cc: Thomas Hellstrom Cc: "Gustavo A. R. Silva" Cc: Mike Marshall Cc: Ira Weiny Cc: Daniel Vetter Cc: Emil Velikov Cc: Michel Dänzer Reviewed-by: Emil Velikov --- drivers/gpu/drm/via/via_drv.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h index 664b7f8a20c4..a58af0ad5108 100644 --- a/drivers/gpu/drm/via/via_drv.h +++ b/drivers/gpu/drm/via/via_drv.h @@ -24,13 +24,16 @@ #ifndef _VIA_DRV_H_ #define _VIA_DRV_H_ +#include #include #include #include #include +#include #include #include +#include #define DRIVER_AUTHOR "Various" From patchwork Sat Jul 20 08:45:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11050813 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 63F9813AC for ; Sat, 20 Jul 2019 08:46:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51CDB28717 for ; Sat, 20 Jul 2019 08:46:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45CBE2883B; Sat, 20 Jul 2019 08:46:04 +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,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 95C6E28717 for ; Sat, 20 Jul 2019 08:46:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 033A86E894; Sat, 20 Jul 2019 08:46:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 94A946E88B; Sat, 20 Jul 2019 08:45:57 +0000 (UTC) Received: by mail-lj1-x243.google.com with SMTP id i21so32931610ljj.3; Sat, 20 Jul 2019 01:45:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=HkTWhLkVesH34oKnxktIb07MH+NW8JSgpCbLaEHYnEY=; b=iyHLkimSm55z7r/Eue+HfIBuJkGq6n4UEZkGTvtAhizGq+uUXNmV2j5+dzj0JGGCQL HMwRme4fA7Kow6ahKQeBXZfqncF/Aimfs3XIn6Wr33TcUI8TQxXbIsvXd7fxsur96Zim 1kRtCEsK4YWhGufWO9oufeOgMwZGhd4LmO00Fh93gl/aOzjOaRwB8D7WreBHetOchqjB D1XPYTALDeAK65uVc6Wvetm9CSXO+2qSgNY7lcKlq1zXcSYtHQ3b5zZvW/j/kDAplNKN GbisDzerPmY8CsEiYzewjRQ+kvpnzKAMMfLIaqZ05LwqKiDH93PyrwWD2haWX5lArsne NCTw== X-Gm-Message-State: APjAAAU0v1paQ+DW6NcvrnQ5CGM47bRZ140jb7Fq/bjmhvNQaslpE8ft W4IYUgP8pLLgwpE1OIt75Sir2PHOEkQ= X-Google-Smtp-Source: APXvYqwyEAXwfmOap3FBlbhnKueS2WLGEZglSrZ4ZmDNy62f6QBLkMHcPiXntqwY3rrDwxM5OMjIXQ== X-Received: by 2002:a2e:9a87:: with SMTP id p7mr29688579lji.133.1563612355706; Sat, 20 Jul 2019 01:45:55 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id o3sm5047022lfb.40.2019.07.20.01.45.54 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 01:45:55 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, openchrome-devel@lists.freedesktop.org Subject: [PATCH v2 4/4] drm/via: drop use of drmP.h Date: Sat, 20 Jul 2019 10:45:27 +0200 Message-Id: <20190720084527.12593-5-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190720084527.12593-1-sam@ravnborg.org> References: <20190720084527.12593-1-sam@ravnborg.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HkTWhLkVesH34oKnxktIb07MH+NW8JSgpCbLaEHYnEY=; b=Rb8qTvMKDmoRJtqge6jbiO4I+9ivpXd8M7h5PfEch4MMipuZWyoHDjE0cXChO6I4WV qgLY1SMzftKY5vabmXd/p38j1i5YfX+PY2rqnihioiykNdo3m7HREQ47Rf92sYXnKigT XEGe+RL60NqSfI/Aw1ytCbMiajkBayuUCpiutjaqNEiZbaOQtmOh2aceaSGVk52f2e48 huHFp0A4PnZFpa4Ifx3fUNYRAn+zfCh7Z4PZcojXDNVBr3nhHX29hJdwp9N0ghRh4L3m Jux+tLGDGZtD7lb77nWWWhi3MxhJUe1U+2XQSZMfmjkL+aRq8lZ5fXmzhKLMmMt6LLwX rgaw== 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: Thomas Hellstrom , Sam Ravnborg , "Gustavo A. R. Silva" , David Airlie , Daniel Vetter , =?utf-8?q?Michel_D=C3=A4nzer?= , Kevin Brace , Mike Marshall , Ira Weiny , Emil Velikov Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Drop use of the deprecated drmP.h header. While touching the files divide include files in blocks and sort the files alphabetically. v2: - Replace all uses of DRM_WAIT_ON() with VIA_WAIT_ON() and thus avoiding to pull in drm_os_linux.h Signed-off-by: Sam Ravnborg Cc: Kevin Brace Cc: Thomas Hellstrom Cc: "Gustavo A. R. Silva" Cc: Mike Marshall Cc: Ira Weiny Cc: Daniel Vetter Cc: Emil Velikov Cc: Michel Dänzer Reviewed-by: Emil Velikov --- drivers/gpu/drm/via/via_dma.c | 9 ++++++++- drivers/gpu/drm/via/via_dmablit.c | 17 ++++++++++------- drivers/gpu/drm/via/via_drv.c | 7 +++++-- drivers/gpu/drm/via/via_irq.c | 8 +++++--- drivers/gpu/drm/via/via_map.c | 6 +++++- drivers/gpu/drm/via/via_mm.c | 7 ++++++- drivers/gpu/drm/via/via_verifier.c | 10 +++++----- drivers/gpu/drm/via/via_video.c | 5 +++-- 8 files changed, 47 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/via/via_dma.c b/drivers/gpu/drm/via/via_dma.c index d17d8f245c1a..4e50834dd222 100644 --- a/drivers/gpu/drm/via/via_dma.c +++ b/drivers/gpu/drm/via/via_dma.c @@ -34,8 +34,15 @@ * Thomas Hellstrom. */ -#include +#include +#include + +#include +#include +#include +#include #include + #include "via_drv.h" #include "via_3d_reg.h" diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c index 062067438f1d..9fbedc488e62 100644 --- a/drivers/gpu/drm/via/via_dmablit.c +++ b/drivers/gpu/drm/via/via_dmablit.c @@ -34,13 +34,16 @@ * the same DMA mappings? */ -#include -#include -#include "via_drv.h" -#include "via_dmablit.h" - #include #include +#include + +#include +#include +#include + +#include "via_dmablit.h" +#include "via_drv.h" #define VIA_PGDN(x) (((unsigned long)(x)) & PAGE_MASK) #define VIA_PGOFF(x) (((unsigned long)(x)) & ~PAGE_MASK) @@ -436,7 +439,7 @@ via_dmablit_sync(struct drm_device *dev, uint32_t handle, int engine) int ret = 0; if (via_dmablit_active(blitq, engine, handle, &queue)) { - DRM_WAIT_ON(ret, *queue, 3 * HZ, + VIA_WAIT_ON(ret, *queue, 3 * HZ, !via_dmablit_active(blitq, engine, handle, NULL)); } DRM_DEBUG("DMA blit sync handle 0x%x engine %d returned %d\n", @@ -687,7 +690,7 @@ via_dmablit_grab_slot(drm_via_blitq_t *blitq, int engine) while (blitq->num_free == 0) { spin_unlock_irqrestore(&blitq->blit_lock, irqsave); - DRM_WAIT_ON(ret, blitq->busy_queue, HZ, blitq->num_free > 0); + VIA_WAIT_ON(ret, blitq->busy_queue, HZ, blitq->num_free > 0); if (ret) return (-EINTR == ret) ? -EAGAIN : ret; diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c index af6a12d3c058..666a16de84f9 100644 --- a/drivers/gpu/drm/via/via_drv.c +++ b/drivers/gpu/drm/via/via_drv.c @@ -24,11 +24,14 @@ #include -#include +#include +#include +#include +#include #include + #include "via_drv.h" -#include static int via_driver_open(struct drm_device *dev, struct drm_file *file) { diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c index c96830ccc0ec..138c3f8d0af2 100644 --- a/drivers/gpu/drm/via/via_irq.c +++ b/drivers/gpu/drm/via/via_irq.c @@ -35,8 +35,10 @@ * The refresh rate is also calculated for video playback sync purposes. */ -#include +#include +#include #include + #include "via_drv.h" #define VIA_REG_INTERRUPT 0x200 @@ -233,12 +235,12 @@ via_driver_irq_wait(struct drm_device *dev, unsigned int irq, int force_sequence cur_irq = dev_priv->via_irqs + real_irq; if (masks[real_irq][2] && !force_sequence) { - DRM_WAIT_ON(ret, cur_irq->irq_queue, 3 * HZ, + VIA_WAIT_ON(ret, cur_irq->irq_queue, 3 * HZ, ((VIA_READ(masks[irq][2]) & masks[irq][3]) == masks[irq][4])); cur_irq_sequence = atomic_read(&cur_irq->irq_received); } else { - DRM_WAIT_ON(ret, cur_irq->irq_queue, 3 * HZ, + VIA_WAIT_ON(ret, cur_irq->irq_queue, 3 * HZ, (((cur_irq_sequence = atomic_read(&cur_irq->irq_received)) - *sequence) <= (1 << 23))); diff --git a/drivers/gpu/drm/via/via_map.c b/drivers/gpu/drm/via/via_map.c index 2ad865870372..431c150df014 100644 --- a/drivers/gpu/drm/via/via_map.c +++ b/drivers/gpu/drm/via/via_map.c @@ -21,8 +21,12 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ -#include + +#include +#include +#include #include + #include "via_drv.h" static int via_do_init_map(struct drm_device *dev, drm_via_init_t *init) diff --git a/drivers/gpu/drm/via/via_mm.c b/drivers/gpu/drm/via/via_mm.c index 4217d66a5cc6..45cc9e900260 100644 --- a/drivers/gpu/drm/via/via_mm.c +++ b/drivers/gpu/drm/via/via_mm.c @@ -25,8 +25,13 @@ * Authors: Thomas Hellström */ -#include +#include + +#include +#include +#include #include + #include "via_drv.h" #define VIA_MM_ALIGN_SHIFT 4 diff --git a/drivers/gpu/drm/via/via_verifier.c b/drivers/gpu/drm/via/via_verifier.c index fb2609434df7..361a450058f2 100644 --- a/drivers/gpu/drm/via/via_verifier.c +++ b/drivers/gpu/drm/via/via_verifier.c @@ -28,13 +28,13 @@ * be very slow. */ -#include "via_3d_reg.h" -#include -#include +#include #include -#include "via_verifier.h" +#include + +#include "via_3d_reg.h" #include "via_drv.h" -#include +#include "via_verifier.h" typedef enum { state_command, diff --git a/drivers/gpu/drm/via/via_video.c b/drivers/gpu/drm/via/via_video.c index a9ffbad1cfdd..53b1f58f99b4 100644 --- a/drivers/gpu/drm/via/via_video.c +++ b/drivers/gpu/drm/via/via_video.c @@ -25,8 +25,9 @@ * Video and XvMC related functions. */ -#include +#include #include + #include "via_drv.h" void via_init_futex(drm_via_private_t *dev_priv) @@ -82,7 +83,7 @@ int via_decoder_futex(struct drm_device *dev, void *data, struct drm_file *file_ switch (fx->func) { case VIA_FUTEX_WAIT: - DRM_WAIT_ON(ret, dev_priv->decoder_queue[fx->lock], + VIA_WAIT_ON(ret, dev_priv->decoder_queue[fx->lock], (fx->ms / 10) * (HZ / 100), *lock != fx->val); return ret; case VIA_FUTEX_WAKE: