Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4158155ybi; Tue, 18 Jun 2019 12:54:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8jaALJQrtCRzHBc59WKPiaUqdMo4SAI1x51zjNfBe+cwBDY0N9jzSXMfM8CNyT+HOwT6R X-Received: by 2002:a63:3501:: with SMTP id c1mr4265462pga.115.1560887644385; Tue, 18 Jun 2019 12:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560887644; cv=none; d=google.com; s=arc-20160816; b=tgrwShyTddARsFmc+YAOTg5z+81LEhDOabDTecdFR4de82J0BQes+7Lry4KoDYkZHN JvfF7KFJaE0HLPHQ8bybtLUXD8amOf/VJtepB25RD0We0Tqp+w3DzkpJBWhHLgX69F7G UjqaqoziVmXCueuZ7Ua2mdMBnsk2Y7KZT5ekP2Nhq2oRZkFX2xDZPIB/oPRXLuao5t55 E2TDMDTJNqTsqbKywOzoI0+Psuw+1jOADEYxKd1DSgTzuuNIE3/MdwH/8RlbJdYOj8VW qD8pwDnvKPh57PSshbQpcC50GY20TY/onsbW3Lh5adkmazsNSgpw4OsUDaUr49EsiShU /dtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rKlvb5xlV7AjdrT+ymSYk12cKDt0ZQUtMF2LTHfZOts=; b=PEIqRrmls7Qp9ArZfKPwXgKuuOV3ju7ggkusKx1c6swMZH13bFrqw620VI2cFud38K nex860YIiRd4K+p2t2BWPbEaotvqEBrYAIwUUnUPhAJLzd4xwrWr7Etun3kvD9VM3IUj Qu58zvAkxL6Bwcx7uhNWVUWu9deU5MWFTLIs8hAuvu/LVE0um6CkQxJBKCf00CSBBl8b maMAdbRye+6Zwu6G4Ia+OovTubNzKDKRqrtxS3YCUU4J/7McgTEAAIKzz4+oBXiVnu9V Hw0WxMUQD+S1kXvVeHmolVNj7r/Np8GwKwSHv2YTNqEF+lCh0OV7pVwcPKt5D89Gz4i2 prDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=HIjadFGF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f24si941619pgi.289.2019.06.18.12.53.48; Tue, 18 Jun 2019 12:54:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=HIjadFGF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730388AbfFRTwH (ORCPT + 99 others); Tue, 18 Jun 2019 15:52:07 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:42856 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730189AbfFRTwH (ORCPT ); Tue, 18 Jun 2019 15:52:07 -0400 Received: by mail-qt1-f194.google.com with SMTP id s15so16923282qtk.9 for ; Tue, 18 Jun 2019 12:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rKlvb5xlV7AjdrT+ymSYk12cKDt0ZQUtMF2LTHfZOts=; b=HIjadFGFGEXpbxE64Z3ryg2YKt6x7P7r8lG5rpQv4JTlECfohUBliyZGbXhgixpAAu Jh5lrATzJzvIM0sM1dMb2n4ed8dlnUBxyR3JldHddNTi1HNu3GGNWGWrewNBWI4ZynHz YEC5el4Ts3kwt+UHyvyrsGzBVXkA1G+8HhuIwVSOhXc++BMwQtb8uOJHt2VFgvCtJjvJ 6a6x1rdEedYxVsntJDH2goukZi4FiHMQS5/zlqPjzn8Y2lXqybGFxntfiLAcnPH0BJub FwYwbC21szO0RkUWcuBWOEGq6+bVY7Z1y0PMyZDQZMqwEtoXnIEjplUs24QR6Wh2wXCa NS3g== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rKlvb5xlV7AjdrT+ymSYk12cKDt0ZQUtMF2LTHfZOts=; b=VIs98p8oS5hvzLbnm90hXwPMLQT/gN1WW6zgW7VsWu5J0p3ojIN2YWMWfaxZwtV2IX AKZIC/23QcQ5QCosMSTFErAope/VvmWmR1SXKYfcCBWK9Nq8ZkD3h2KhhcTxCloyAm5E hhsW5gNKXQ8ult2C4tPYoO/d19l4+qtHGCCUmpGcWccE53BixYmDJVzyHwoKZ1PAx2rr vRnsev6yk7FCTTLc1OS/7zXjlKO4B0DBH3/XWl8raL6jgqMRJ2xZMC+7zMaCkYyPL/8Z gnVOqiYRu5btexciBt5Kvt2LT3uiBwBWoqfU980TM7eu8tmd2OzR8Ou3KQcPuxt/HPm/ rMuw== X-Gm-Message-State: APjAAAUdRH1fsAZZEZg5WKlJ2flXFBh6OUMFCHCdz5sVemR9onEGbByk 1KJeCOxJqatMLDRpsXOpMtHneg== X-Received: by 2002:ac8:3132:: with SMTP id g47mr48006861qtb.155.1560887525765; Tue, 18 Jun 2019 12:52:05 -0700 (PDT) Received: from localhost ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id 102sm7628154qte.52.2019.06.18.12.52.04 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 18 Jun 2019 12:52:05 -0700 (PDT) Date: Tue, 18 Jun 2019 15:52:04 -0400 From: Sean Paul To: Serge Semin Cc: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , Christian Koenig , Huang Rui , Junwei Zhang , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Ralf Baechle , Paul Burton , James Hogan , "Vadim V . Vlasov" Subject: Re: [PATCH] drm: Permit video-buffers writecombine mapping for MIPS Message-ID: <20190618195204.GC25413@art_vandelay> References: <20190423123122.32573-1-fancer.lancer@gmail.com> <20190617134729.pd24boyqe2viyihm@mobilestation> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190617134729.pd24boyqe2viyihm@mobilestation> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 17, 2019 at 04:47:30PM +0300, Serge Semin wrote: > Hello folks, > > Any updates of this patch status? It has been here for about two months. > Sorry for the mixup, looks like this one just fell through the cracks. I've applied it to drm-misc-next with the attached Ack and Review. Sean > Regards, > -Sergey > > On Tue, Apr 23, 2019 at 03:31:22PM +0300, Serge Semin wrote: > > Since commit 4b050ba7a66c ("MIPS: pgtable.h: Implement the > > pgprot_writecombine function for MIPS") and commit c4687b15a848 ("MIPS: Fix > > definition of pgprot_writecombine()") write-combine vma mapping is > > available to be used by kernel subsystems for MIPS. In particular the > > uncached accelerated attribute is requested to be set by ioremap_wc() > > method and by generic PCI memory pages/ranges mapping methods. The same > > is done by the drm_io_prot()/ttm_io_prot() functions in case if > > write-combine flag is set for vma's passed for mapping. But for some > > reason the pgprot_writecombine() method calling is ifdefed to be a > > platform-specific with MIPS system being marked as lacking of one. At the > > very least it doesn't reflect the current MIPS platform implementation. > > So in order to improve the DRM subsystem performance on MIPS with UCA > > mapping enabled, we need to have pgprot_writecombine() called for buffers, > > which need store operations being combined. In case if particular MIPS > > chip doesn't support the UCA attribute, the mapping will fall back to > > noncached. > > > > Cc: Ralf Baechle > > Cc: Paul Burton > > Cc: James Hogan > > Signed-off-by: Vadim V. Vlasov > > Signed-off-by: Serge Semin > > --- > > drivers/gpu/drm/drm_vm.c | 5 +++-- > > drivers/gpu/drm/ttm/ttm_bo_util.c | 4 ++-- > > 2 files changed, 5 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c > > index c3301046dfaa..50178dc64060 100644 > > --- a/drivers/gpu/drm/drm_vm.c > > +++ b/drivers/gpu/drm/drm_vm.c > > @@ -62,7 +62,8 @@ static pgprot_t drm_io_prot(struct drm_local_map *map, > > /* We don't want graphics memory to be mapped encrypted */ > > tmp = pgprot_decrypted(tmp); > > > > -#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) > > +#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || \ > > + defined(__mips__) > > if (map->type == _DRM_REGISTERS && !(map->flags & _DRM_WRITE_COMBINING)) > > tmp = pgprot_noncached(tmp); > > else > > @@ -73,7 +74,7 @@ static pgprot_t drm_io_prot(struct drm_local_map *map, > > tmp = pgprot_writecombine(tmp); > > else > > tmp = pgprot_noncached(tmp); > > -#elif defined(__sparc__) || defined(__arm__) || defined(__mips__) > > +#elif defined(__sparc__) || defined(__arm__) > > tmp = pgprot_noncached(tmp); > > #endif > > return tmp; > > diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c > > index 895d77d799e4..9f918b992f7e 100644 > > --- a/drivers/gpu/drm/ttm/ttm_bo_util.c > > +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c > > @@ -539,13 +539,13 @@ pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp) > > tmp = pgprot_noncached(tmp); > > #endif > > #if defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || \ > > - defined(__powerpc__) > > + defined(__powerpc__) || defined(__mips__) > > if (caching_flags & TTM_PL_FLAG_WC) > > tmp = pgprot_writecombine(tmp); > > else > > tmp = pgprot_noncached(tmp); > > #endif > > -#if defined(__sparc__) || defined(__mips__) > > +#if defined(__sparc__) > > tmp = pgprot_noncached(tmp); > > #endif > > return tmp; > > -- > > 2.21.0 > > -- Sean Paul, Software Engineer, Google / Chromium OS