Received: by 10.213.65.68 with SMTP id h4csp235787imn; Mon, 12 Mar 2018 12:07:23 -0700 (PDT) X-Google-Smtp-Source: AG47ELvRdfaBzYjlu7gU3pghvZPTOjcbQGOOajFIWKZwbnIAzUdhnw5k+aSmexqF+HOnt/JlmJY1 X-Received: by 10.101.83.136 with SMTP id x8mr5536720pgq.288.1520881643721; Mon, 12 Mar 2018 12:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520881643; cv=none; d=google.com; s=arc-20160816; b=KKpRGYhpA+/xjwDDrxK0gXKN9ztLr5b9ywatBvaj1V15W6UALN7lZkPEsXAho4j6/r gjBUUWkaXO914ygOs1BFNnl2pZzQIXrCGCtm4ypytslQIKWVIs14hrgVyTMDavWGfgq3 pxo80e9HbN1vAYQbBTdzh/i1bHJc1jUT8OPeo8ViPtHgdYvf/qTjF9sdMYaJxjSVTlnJ focNx6hVghO12tLXh0fe0X1CVTIM7VGAf0nNxkonrJtOidCs/rO4mqINId/mEpToYG3z vATv8CVIm8gYAnoQH6e7DEdaBbYIy08/cY4xtafvjfd2Sx8WZNHnQmW4xkroVV0l1u/x CKUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=wKgONWsX6xH6UwJjLDs1hhEp15JRYh0TXVOHCMbWjvU=; b=YZUNZ6DvcXAgz5rVIwrFZ2ryFOCc8PYQ/cLSqLU11kze/TnbkTcylXQCpCDrcwkocW Stq5La4cp1dRNd3DBbH4R0dchWAqcgLeQU5xgIgnszKZ5NChNps+LbV+7vNpMM8mTBhT I7O6QvxO9e4Zly+Hu7DmCAwCzwWtFmIPcFInHyEWbGFGETiB/JY0vwvKC5ESmuH0LFPC EVYObn6ZYMeeZsp/I++XPgZPNaCMpHm9WxotjojIl/0R1Z2PFmaYEIISfjfSZNIrFJkt DeXgjnr0QU/7ixSixuNBI9LVXZN2SEfUTL+IUz9PIlqDpe3ScZqWCm24IwegPMMDOs+T nqQQ== ARC-Authentication-Results: i=1; mx.google.com; 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 h126si3347095pgc.817.2018.03.12.12.07.07; Mon, 12 Mar 2018 12:07:23 -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; 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 S932255AbeCLTFz convert rfc822-to-8bit (ORCPT + 99 others); Mon, 12 Mar 2018 15:05:55 -0400 Received: from claranet-outbound-smtp02.uk.clara.net ([195.8.89.35]:55701 "EHLO claranet-outbound-smtp02.uk.clara.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751275AbeCLTFy (ORCPT ); Mon, 12 Mar 2018 15:05:54 -0400 Received: from host86-141-215-231.range86-141.btcentralplus.com ([86.141.215.231]:45118 helo=spike.private.network) by relay02.mail.eu.clara.net (relay.clara.net [81.171.239.32]:1025) with esmtpa (authdaemon_login:iarmst) id 1evSlW-00009i-8d (return-path ); Mon, 12 Mar 2018 19:05:47 +0000 Date: Mon, 12 Mar 2018 19:05:41 +0000 From: Ian Armstrong To: Nick French Cc: "Luis R. Rodriguez" , Andy Lutomirski , "hans.verkuil@cisco.com" , "linux-kernel@vger.kernel.org" , "linux-media@vger.kernel.org" Subject: Re: ivtv: use arch_phys_wc_add() and require PAT disabled Message-ID: <20180312190541.797ef4de@spike.private.network> In-Reply-To: <20180312040401.GA4814@tivo.lan> References: <20180301171936.GU14069@wotan.suse.de> <20180307190205.GA14069@wotan.suse.de> <20180308040601.GQ14069@wotan.suse.de> <20180308041411.GR14069@wotan.suse.de> <20180311232438.2b204c51@spike.private.network> <20180312040401.GA4814@tivo.lan> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 11 Mar 2018 23:04:02 -0500 Nick French wrote: > On Sun, Mar 11, 2018 at 11:24:38PM +0000, Ian Armstrong wrote: > > On Sat, 10 Mar 2018 16:57:41 +0000 > > "French, Nicholas A." wrote: > > > > > > > No what if the framebuffer driver is just requested as a > > > > > secondary step after firmware loading? > > > > > > > > Its a possibility. The decoder firmware gets loaded at the > > > > beginning of the decoder memory range and we know its length, so > > > > its possible to ioremap_nocache enough room for the firmware > > > > only on init and then ioremap the remaining non-firmware > > > > decoder memory areas appropriately after the firmware load > > > > succeeds... > > > > > > I looked in more detail, and this would be "hard" due to the way > > > the rest of the decoder offsets are determined by either making > > > firmware calls or scanning the decoder memory range for magic > > > bytes and other mess. > > > > The buffers used for yuv output are fixed. They are located both > > before and after the framebuffer. Their offset is fixed at > > 'base_addr + IVTV_DECODER_OFFSET + yuv_offset[]'. The yuv offsets > > can be found in 'ivtv-yuv.c'. The buffers are 622080 bytes in > > length. > > > > The range would be from 'base_addr + 0x01000000 + 0x00029000' to > > 'base_addr + 0x01000000 + 0x00748200 + 0x97dff'. This is larger than > > required, but will catch the framebuffer and should not cause any > > problems. If you wanted to render direct to the yuv buffers, you > > would probably want this region included anyway (not that the > > current driver supports that). > > Am I correct that you are talking about the possibility of > re-ioremap()-ing the 'yuv-fb-yuv' area *after* loading the firmware, > not of mapping ranges correctly on the first go-around? > > Because unless my math is letting me down, the decoder firmware is > already loaded from 'base_addr + 0x01000000 + 0x0' to 'base_addr + > 0x01000000 + 0x3ffff' which overlaps the beginning of the yuv range. Good catch. I'd forgotten that the firmware moves after being loaded. Although ivtvfb.c requests the offset to the framebuffer via the firmware, I don't believe it ever actually moves. The firmware allows more memory to be allocated for video buffers, but will then reduce the length of the framebuffer. At present the ivtv driver requests two more video buffers, so the framebuffer is shortened (the start address doesn't move). Those two buffers are located at base_addr + 0x16B0400 and 0x1748200. The now shortened framebuffer is of size 1704960 bytes (0x1A0400). These two offsets, plus those of the other video buffers are hardcoded in ivtv-yuv.c. It was written on the assumption that the location of the video buffers on the card are fixed. To the best of my knowledge, this has never caused a problem. From ivtvfb.c : /* The osd buffer size depends on the number of video buffers allocated on the PVR350 itself. For now we'll hardcode the smallest osd buffer size to prevent any overlap. */ oi->video_buffer_size = 1704960; We know that one of the additional video buffers is at 0x16B0400, and that this is located at the end of the now shortened 1704960 byte framebuffer. 0x16B0400 - 0x1A0400 = 0x1510000. This gives us a 0x1A0400 byte framebuffer at base_addr + 0x1510000. Assuming the hardware is a PVR350 and is running stock firmware, I thinks its safe to say this won't change. -- Ian