From patchwork Wed Mar 7 08:21:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 130852 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp4909854lja; Wed, 7 Mar 2018 00:21:29 -0800 (PST) X-Google-Smtp-Source: AG47ELts3xeaWjqh1A+afAra8iUGRdShibZD10KpGnYywc7xWiI1rQDXIDBYcbPTZ5aD7a2sdu66 X-Received: by 2002:a17:902:8289:: with SMTP id y9-v6mr19503944pln.242.1520410888854; Wed, 07 Mar 2018 00:21:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520410888; cv=none; d=google.com; s=arc-20160816; b=bDDOF5tssXnbKn0GwxaQijNFofxui+G1/F5/uCoLHOdKaP9M3rR1uutU7PH3feGAF3 48cXrOcwWOiPXEz42+dK82bJcu71Stf2VxMpcOCGH7noSG/Zd3u+RecpAgiv6KI86heJ AC4EmSOefPnmCmyxVp1TcJYcAY0qjlDsP/C3FgBWzmn24r+JK0pZiy6Eb1zjLk4gxPBI N5RrHHNiTCqbsLpMTsbTLQr6M0xS1eGb9mxeGdeoRJBA/fGy1Gg3wOnQUucwS6PgSNcK 144pkdMytaA1ZFhft3JhN/Un+3jlqhVY4bb9143mq6Cz23Q3ljHsbSMWVU5iKE658nGr z3pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=Q/s2ruyQ86A68RxShdZvU9bCq6oN+PhXU+yWojkXCgA=; b=ETBcw5rkdxtXVjO3j5+H3UUuSQ0lo8uLP/EpO5BEMgEdaHdqgFTzmiOzgMams/XbbO lttWT7KBBg1INZLFEtq/NAAzkXN0rYZJVNpPioHe/6/eJKVnfEFq1Xk2Ibm+zyhMd5qr CUIYlrIDz+EAJL7JNnMQBmuMv9ZA5MCzgVGnZAgz5MU2rUpLpxpypfjoqK2VUhPlE+kY ANzOF4ij3KshD+F70yo32phyqTEPGpF46Y87al7LFdAoJUuqLEQGCArb+Aihrn3Cpsxu 7izbxUuulYUSVwol2mJwz400vWblPI5Wdo+XrpmAhEB+gHrmz886zjPk/7aBZgXvaRa9 sNrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BLSN2Ga7; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id be3-v6si9434152plb.581.2018.03.07.00.21.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Mar 2018 00:21:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BLSN2Ga7; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B0B066E6B2; Wed, 7 Mar 2018 08:21:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x244.google.com (mail-lf0-x244.google.com [IPv6:2a00:1450:4010:c07::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id A6C786E6B2 for ; Wed, 7 Mar 2018 08:21:26 +0000 (UTC) Received: by mail-lf0-x244.google.com with SMTP id 37-v6so1942186lfs.7 for ; Wed, 07 Mar 2018 00:21:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ftg04JmrUOImFw4T5nuv6N4sV237//MctluR9WnxIMI=; b=BLSN2Ga7lL4IrzbQT5wyR3BYP/zd65tnDFvWVdPXAEeosn/bmJndpeKvCOfYEuD/0I pHxW312npWN/uHs8keS9doucyeQP007ogsoc5XTcsObJhYcIqGm0L62lWtHpRqGltLPO hgy0JOfcBa8Bt47NtpIDD34WGAoJVjSo2pUNc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ftg04JmrUOImFw4T5nuv6N4sV237//MctluR9WnxIMI=; b=aXDBqUpiJlR36BIM75Bdihtt+t0HewkKbwgY6drD9vOGySQiVPxDbrlnzHnBo1GuOq Tn0YbijnjzFrL1vkOaIWnxqLxDMnizrqSQ4dbUn4r8V+iIsyv7xGiYC7Ml1yq43mCxT3 84Zn3KX54RC2eP/e2f8/4FLJoqcuo1tX9o7JdUhjvw1avrubtfOJcBYhDjccBlw3uLjM qJ/GI+LZHl84nX1CzGFU3aH5VrSTw3HyNHTtv+rflWH/GDyVMsB5G+3s7WlF23UrXoYe Ud5Fmj/xiAEqpcti5GJN0jRIckF3pzYW7faRQP666nF6HaCFWgVQyjbP19gVzzg5rS82 q+ag== X-Gm-Message-State: APf1xPA10V00eGJ2w6jTthrCnNR+Wbi9PzZh9hH0hjDr0sqyeNTL/HBH ViMb96SwD0ilp9bIL4od6oKKEg== X-Received: by 10.46.54.12 with SMTP id d12mr14565751lja.31.1520410884726; Wed, 07 Mar 2018 00:21:24 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 70sm3577899lft.2.2018.03.07.00.21.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Mar 2018 00:21:23 -0800 (PST) From: Linus Walleij To: Daniel Vetter , Jani Nikula , Sean Paul , Eric Anholt , Liviu Dudau Subject: [PATCH] drm/pl111: Enable device-specific assigned memory Date: Wed, 7 Mar 2018 09:21:16 +0100 Message-Id: <20180307082116.13568-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 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: Mali DP Maintainers , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The Versatile Express has 8 MB of dedicated video RAM (VRAM) on the motherboard, which is what we should be using for the PL111 if available. On this platform, the memory backplane is constructed so that only this memory will work properly with the CLCD on the motherboard, using any other memory region just gives random snow on the display. The CA9 Versatile Express also has a PL111 instance on its core tile. This is OK, it has been tested with the motherboard VRAM and that works just as fine as regular CMA memory. The memory is assigned to the device using the memory-region device tree property and a "shared-dma-pool" reserved memory pool like this: reserved-memory { #address-cells = <1>; #size-cells = <1>; ranges; vram: vram@48000000 { compatible = "shared-dma-pool"; reg = <0x48000000 0x00800000>; no-map; }; }; clcd@1f000 { compatible = "arm,pl111", "arm,primecell"; (...) memory-region = <&vram>; }ยท; Cc: Liviu Dudau Cc: Mali DP Maintainers Signed-off-by: Linus Walleij --- drivers/gpu/drm/pl111/pl111_drv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c index b469aa317d9d..e301f2a719a3 100644 --- a/drivers/gpu/drm/pl111/pl111_drv.c +++ b/drivers/gpu/drm/pl111/pl111_drv.c @@ -60,6 +60,7 @@ #include #include #include +#include #include #include @@ -262,6 +263,10 @@ static int pl111_amba_probe(struct amba_device *amba_dev, drm->dev_private = priv; priv->variant = variant; + ret = of_reserved_mem_device_init(dev); + if (!ret) + dev_info(dev, "using device-specific reserved memory\n"); + if (of_property_read_u32(dev->of_node, "max-memory-bandwidth", &priv->memory_bw)) { dev_info(dev, "no max memory bandwidth specified, assume unlimited\n");