From patchwork Sat Feb 13 07:25:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Dimitrov X-Patchwork-Id: 8299561 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BBA03C02AE for ; Sat, 13 Feb 2016 07:26:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D4D4C203F3 for ; Sat, 13 Feb 2016 07:26:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EBE0C204FF for ; Sat, 13 Feb 2016 07:26:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750926AbcBMHZU (ORCPT ); Sat, 13 Feb 2016 02:25:20 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33064 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750851AbcBMHZS (ORCPT ); Sat, 13 Feb 2016 02:25:18 -0500 Received: by mail-wm0-f68.google.com with SMTP id c200so6427335wme.0; Fri, 12 Feb 2016 23:25:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=VNBesbVOM95LSXiiSFDc+6T/vVRjhEw/DPDBW0hgnaA=; b=x0+WwuUSF/W3lSlVFRIvLPF3mWmdDtM3+zjc6K/u6qHiPB/UtyECaokcHauH7iRYbf fBKibE6OBPbSebN5Ukm0Se6ROzfjlwubMxsjCDUMEzTpJ2nFrkeJ/CgyjuThoAKZX76N lSQZ4TK55Z8xFuiO39AY4+b/XwPOaXWo2+JYfT90SjM5YxIG3aF7/t5bZWzkVvcjbvgD p3jKRSgNrAi1FepCU15cnB7C8pqsIH/ppdH+Mjejo6ryyBBfQY6CQAP9YR++IRqcmNcL ySvmUCvMPPHVAlnK/HYyCTp4QnOK9ZUvFk8g0IY004WSyxyEhGUXNVbKJ3fsal6HARZU zMWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=VNBesbVOM95LSXiiSFDc+6T/vVRjhEw/DPDBW0hgnaA=; b=grxkuIniKuP+1EwJhL3jJIEz+BT5fJaZL7fLsgPgyL5VchoVn5I3RKtHRkFupJU3oh 80y8W8oqVgr5q7ddV0dth24N6fI+2zxU1JsRjreA5Oh8epDGGej1tJVagiRBDhPKp4SU FmzF9cnHhJD3NF+8PfGIjK2Yt1YQoGSQfndCVWcQoBQefIbXwBlI0oD1QEgozt+NP204 Ae3UigW7Nap/u13HAD0TRsh5HTzHLjR+2hmXZjxXlh29FBTTcR3DPT4Yur3DaQAq9SF6 /aaZCQTdi/kTQGR1+tzHhQTgzsoDHqc3XlyhqwcO9JFz33zyhQV/Pgy02C8tuCST6kum 48cQ== X-Gm-Message-State: AG10YOSKpH1RKHDJg0lEKv0GvNzXU3aqkTMvcVZgHDg4EfLERlQtXiWmhd+4tejnzk5R0g== X-Received: by 10.194.58.234 with SMTP id u10mr5659515wjq.174.1455348316736; Fri, 12 Feb 2016 23:25:16 -0800 (PST) Received: from [192.168.226.187] ([212.5.158.50]) by smtp.googlemail.com with ESMTPSA id 198sm5627160wml.22.2016.02.12.23.25.14 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Feb 2016 23:25:15 -0800 (PST) Subject: Re: [PATCH] ARM: omapfb: Add early framebuffer memory allocator To: Tomi Valkeinen , =?UTF-8?Q?Pali_Roh=c3=a1r?= References: <52A062A0.3070005@ti.com> <1388013159-3036-1-git-send-email-ivo.g.dimitrov.75@gmail.com> <201601011301.27415@pali> <568A5970.2000201@ti.com> <568A6DD1.5050700@gmail.com> <5693F5B7.8040608@ti.com> Cc: tony@atomide.com, linux@arm.linux.org.uk, pavel@ucw.cz, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Ivaylo Dimitrov From: Ivaylo Dimitrov Message-ID: <56BEDA57.4030300@gmail.com> Date: Sat, 13 Feb 2016 09:25:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <5693F5B7.8040608@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Tomi, On 11.01.2016 20:34, Tomi Valkeinen wrote: > > So, I'm not very enthusiastic about adding this feature as an omapfb > specific boot parameter. > What about something like (not properly formatted, just want your opinion on the idea): if (r < 0) { Regards, Ivo --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-omap2/fb.c b/arch/arm/mach-omap2/fb.c index 1f1ecf8..0d109d8 100644 --- a/arch/arm/mach-omap2/fb.c +++ b/arch/arm/mach-omap2/fb.c @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -110,6 +111,49 @@ int __init omap_init_fb(void) { return platform_device_register(&omap_fb_device); } + +static int rmem_omapfb_device_init(struct reserved_mem *rmem, struct device *dev) +{ + int dma; + + if (rmem->priv) + return 0; + + dma = dma_declare_coherent_memory(&omap_fb_device.dev, rmem->base, + rmem->base, rmem->size, + DMA_MEMORY_MAP | + DMA_MEMORY_EXCLUSIVE); + + if (!(dma & DMA_MEMORY_MAP)) { + pr_err("omapfb: dma_declare_coherent_memory failed\n"); + return -ENOMEM; + } + else + rmem->priv = omap_fb_device.dev.dma_mem; + + return 0; +} + +static void rmem_omapfb_device_release(struct reserved_mem *rmem, + struct device *dev) +{ + dma_release_declared_memory(&omap_fb_device.dev); +} + +static const struct reserved_mem_ops rmem_omapfb_ops = { + .device_init = rmem_omapfb_device_init, + .device_release = rmem_omapfb_device_release, +}; + +static int __init rmem_omapfb_setup(struct reserved_mem *rmem) +{ + rmem->ops = &rmem_omapfb_ops; + pr_info("omapfb: reserved %d bytes at %pa\n", rmem->size, &rmem->base); + + return 0; +} + +RESERVEDMEM_OF_DECLARE(dss, "ti,omapfb-memsize", rmem_omapfb_setup); #else int __init omap_init_fb(void) { return 0; } #endif diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 6ab13d1..6f0ba03 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -28,6 +28,7 @@ #include #include #include +#include #include