From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 264C6C33CAA for ; Tue, 21 Jan 2020 06:44:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E788F21734 for ; Tue, 21 Jan 2020 06:44:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TQ0JYGNs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725972AbgAUGot (ORCPT ); Tue, 21 Jan 2020 01:44:49 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:31396 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725789AbgAUGot (ORCPT ); Tue, 21 Jan 2020 01:44:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579589087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=p1ciCsgpvdQJimUGOQLkhk5HqlTe0BRjeWb3MvBbv84=; b=TQ0JYGNsLOxoMYm84xVPk+1pvXqMGbv1uyFM5J+GcMUkK7KlmPHiSHHul3gaL22Hr8wwVu c6TEvyPpuh70pKteHbzG4Von6k6J11+P9n1AJ6SS0bANpLQ3U6BLw70ZpPB0vRNXKYpsxH DbP5bAz+2FT6D+zBaTUVrmBEHCnkjwQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-418--0EYtVwyOSymFcHfE3EhFw-1; Tue, 21 Jan 2020 01:44:44 -0500 X-MC-Unique: -0EYtVwyOSymFcHfE3EhFw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6A154100551A; Tue, 21 Jan 2020 06:44:41 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-106.ams2.redhat.com [10.36.116.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 12DA55C21B; Tue, 21 Jan 2020 06:44:38 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 196AD16E36; Tue, 21 Jan 2020 07:44:37 +0100 (CET) Date: Tue, 21 Jan 2020 07:44:37 +0100 From: Gerd Hoffmann To: Keiichi Watanabe Cc: Tomasz Figa , Dmitry Sepp , spice-devel@lists.freedesktop.org, virtio-dev@lists.oasis-open.org, Linux Media Mailing List , Alexandre Courbot , Alex Lau , Daniel Vetter , Dylan Reid , Enrico Granata , Frediano Ziglio , Hans Verkuil , =?utf-8?B?U3TDqXBoYW5l?= Marchesin , Pawel Osciak , David Stevens , uril@redhat.com Subject: Re: [virtio-dev] Re: [PATCH v2 0/1] VirtIO video device specification Message-ID: <20200121064437.jryf3lq72bucs6rr@sirius.home.kraxel.org> References: <20200113095636.blov62o4gbf27om5@sirius.home.kraxel.org> <12433898.dW097sEU6C@os-lin-dmo> <20200113110521.5ogc3fcy4zq32yzg@sirius.home.kraxel.org> <20200113132654.r4lhspfx2z7zse2v@sirius.home.kraxel.org> <20200115112640.52kemwg4lncuvvir@sirius.home.kraxel.org> <20200120104755.3hhxlx6x6o32bagf@sirius.home.kraxel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org > > > Can't this problem be solved by adding "offset" field in virtio_video_mem_entry? > > > > > > struct virtio_video_mem_entry { > > > le64 addr; > > > le32 length; > > > le32 offset; > > > u8 padding[4]; > > > }; > > > > > > Here, "addr" must be the same in every mem_entry for (1) hardware. > > > > No. virtio_video_mem_entry is basically a scatter list entry, you use > > an *array* of these entries to describe your buffer (unless you are > > using CMA due to hardware requirements, in this special case you have > > only one entry in your array). > > I see. I forgot about scatter list. > However, I'm still not sure about the usage for CMA. > if we're using CMA for a multiplanar format, how can the device know > where the second plane start from? > In my understanding, the number of entries in this case should be the > same with the number of planes and > "entries[0].addr + entries[0].length == entries[1].addr" should hold. With the one-buffer-per-frame model you could add a plane_offsets[4] field to virtio_video_resource_create. The virtio_video_mem_entry array describes the whole buffer for all planes, the plane_offsets array says where the individual planes start inside the buffer. cheers, Gerd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: virtio-dev-return-6676-cohuck=redhat.com@lists.oasis-open.org Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis-open.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id EA748985F08 for ; Tue, 21 Jan 2020 06:44:48 +0000 (UTC) Date: Tue, 21 Jan 2020 07:44:37 +0100 From: Gerd Hoffmann Message-ID: <20200121064437.jryf3lq72bucs6rr@sirius.home.kraxel.org> References: <20200113095636.blov62o4gbf27om5@sirius.home.kraxel.org> <12433898.dW097sEU6C@os-lin-dmo> <20200113110521.5ogc3fcy4zq32yzg@sirius.home.kraxel.org> <20200113132654.r4lhspfx2z7zse2v@sirius.home.kraxel.org> <20200115112640.52kemwg4lncuvvir@sirius.home.kraxel.org> <20200120104755.3hhxlx6x6o32bagf@sirius.home.kraxel.org> MIME-Version: 1.0 In-Reply-To: Subject: Re: [virtio-dev] Re: [PATCH v2 0/1] VirtIO video device specification Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline To: Keiichi Watanabe Cc: Tomasz Figa , Dmitry Sepp , spice-devel@lists.freedesktop.org, virtio-dev@lists.oasis-open.org, Linux Media Mailing List , Alexandre Courbot , Alex Lau , Daniel Vetter , Dylan Reid , Enrico Granata , Frediano Ziglio , Hans Verkuil , =?utf-8?B?U3TDqXBoYW5l?= Marchesin , Pawel Osciak , David Stevens , uril@redhat.com List-ID: > > > Can't this problem be solved by adding "offset" field in virtio_video= _mem_entry? > > > > > > struct virtio_video_mem_entry { > > > le64 addr; > > > le32 length; > > > le32 offset; > > > u8 padding[4]; > > > }; > > > > > > Here, "addr" must be the same in every mem_entry for (1) hardware. > > > > No. virtio_video_mem_entry is basically a scatter list entry, you use > > an *array* of these entries to describe your buffer (unless you are > > using CMA due to hardware requirements, in this special case you have > > only one entry in your array). >=20 > I see. I forgot about scatter list. > However, I'm still not sure about the usage for CMA. > if we're using CMA for a multiplanar format, how can the device know > where the second plane start from? > In my understanding, the number of entries in this case should be the > same with the number of planes and > "entries[0].addr + entries[0].length =3D=3D entries[1].addr" should hold. With the one-buffer-per-frame model you could add a plane_offsets[4] field to virtio_video_resource_create. The virtio_video_mem_entry array describes the whole buffer for all planes, the plane_offsets array says where the individual planes start inside the buffer. cheers, Gerd --------------------------------------------------------------------- To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org