Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1176273pxf; Fri, 12 Mar 2021 03:54:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfRiKZKIXVoYAVGZlOJQ9BkolLuxeCyHGhjHYLyrav2n14xEaheXEfA5U8weAvu9qWoSmv X-Received: by 2002:a17:906:bd2:: with SMTP id y18mr8130373ejg.482.1615550066693; Fri, 12 Mar 2021 03:54:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615550066; cv=none; d=google.com; s=arc-20160816; b=SJEr9GK2bsRYihJN9GJMEpY05sUWk1xZwa5+2hFEUUU+8GBJVJGXTttjF/5+08mvtO v+UeBlzQAJXY6UrvgcOyPq7CnaW/Yp40zyXUBVGTQI/LpY0CD2LAOca3pGmavcUmDD+o /4WKcVO9wVQzUkS+IFp2zQpzxfvhtpR4osyYM8QLQDByft/Pl02EOVGcqMixtT1nKeoc wkK6G+lI8UbgMgPbQ84Cmi6xlIviysjrZod7OaJ5Nbuh8ed3maleL1+cOltoIDA6cCaS KTZPhM204Pwue1EdRyi9pxfGn4brc7QqDgqEA1xIYlbeeFzTrSkV9WSKg+ekXCa740s+ GakQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:cc:to:subject:from:date; bh=stiahqmd8k52Ax7NA/yvR/JPrmJm26v62rY9ylZm9aY=; b=qMXz+XBLqrw1oti2RR9BOQPjhddrVi/OgyUZcod9pS1jcYYYayngfka1u/W0gjn7Ut kEalQ1OpBUNCN1+BybcdRjPsSQ5bFheqgrx/R1o1U+CcD6Vilywary11Qxa+t9Dqbqbd uJxzY4+UP68PrEgr2uYwhqz3yA/g2zATDnu3Ggv+vZnbGlj8fynBLZf6YcLJeZSHSgEE ur8ggqxKN2hJ0frDFzSdVMOEiUJH58uFt+bZ13+bA7hnjAn3Gkj+k31mTF/tbBOgHXZ0 jVbE5I1BD9PgpNUzuF6R7Wtsibp+29oGQ0ZHONLGj4v4YxWrUKcppoiquGbixBENJrko g9ng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l19si4057038edq.269.2021.03.12.03.54.03; Fri, 12 Mar 2021 03:54:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231466AbhCLLwj convert rfc822-to-8bit (ORCPT + 99 others); Fri, 12 Mar 2021 06:52:39 -0500 Received: from aposti.net ([89.234.176.197]:38676 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231423AbhCLLwJ (ORCPT ); Fri, 12 Mar 2021 06:52:09 -0500 Date: Thu, 11 Mar 2021 12:33:31 +0000 From: Paul Cercueil Subject: Re: [PATCH v2 4/5] drm: Add and export function drm_gem_cma_sync_data To: Christoph Hellwig Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Sam Ravnborg , od@zcrc.me, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org Message-Id: In-Reply-To: <20210311122846.GC1739082@infradead.org> References: <20210307202835.253907-1-paul@crapouillou.net> <20210307202835.253907-5-paul@crapouillou.net> <20210311122846.GC1739082@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le jeu. 11 mars 2021 ? 12:28, Christoph Hellwig a ?crit : > On Sun, Mar 07, 2021 at 08:28:34PM +0000, Paul Cercueil wrote: >> + drm_atomic_for_each_plane_damage(&iter, &clip) { >> + for (i = 0; i < finfo->num_planes; i++) { >> + daddr = drm_fb_cma_get_gem_addr(state->fb, state, i); >> + >> + /* Ignore x1/x2 values, invalidate complete lines */ >> + offset = clip.y1 * state->fb->pitches[i]; >> + >> + dma_sync_single_for_device(dev, daddr + offset, >> + (clip.y2 - clip.y1) * state->fb->pitches[i], >> + DMA_TO_DEVICE); > > Are these helpers only ever used to transfer data to the device and > never from it? If so please clearly document that. Yes. In the DRM world, are there cases where we transfer data from the device? I assume these cases are handled by v4l2 instead. -Paul