From patchwork Wed Sep 5 08:25:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1406371 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6445640220 for ; Wed, 5 Sep 2012 08:27:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758103Ab2IEI16 (ORCPT ); Wed, 5 Sep 2012 04:27:58 -0400 Received: from na3sys009aog131.obsmtp.com ([74.125.149.247]:53732 "EHLO na3sys009aog131.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757911Ab2IEI0W (ORCPT ); Wed, 5 Sep 2012 04:26:22 -0400 Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]) (using TLSv1) by na3sys009aob131.postini.com ([74.125.148.12]) with SMTP ID DSNKUEcMra8gWWcJs7Vb2T7Mm04KL+xLGSpb@postini.com; Wed, 05 Sep 2012 01:26:22 PDT Received: by lagy9 with SMTP id y9so139314lag.19 for ; Wed, 05 Sep 2012 01:26:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=I6sYXjnbk6uYBq9aT3qfieyAE81I/uLtidyjpb9b5Sw=; b=SCWFi50cBtXJJBZAQeL9qAmBMjUBYR4BKASfl+eKeOcj3SBe2ZWbIEM4H009HVdxaD 2M7Ha2lSwoawmjpmRGwHk0b+SOKjmgF4p8Iuk0YCJ1lkmzpogQL/JeD1kklJHrPlimD2 W1PQzszxXUb5kLziWXZTnVIa9h3hULrLSUXZ5VEVhh7Y+X+Xf2V48QEwlkRG5EtIrJ/r aXmJTxD2q1TXe6XZakrKTVtkTN6W24eDiLEwiCX6fihelK2L+P7dJSfqj4U5nUg3EEtl Zoxj8sumarbconT/vv/R6/B6t0G7UQ1Ev/0lJcvS/cSDPDd3wECDBJaVIwUAreq9Yc/y jqzA== Received: by 10.152.112.233 with SMTP id it9mr19036836lab.40.1346833580137; Wed, 05 Sep 2012 01:26:20 -0700 (PDT) Received: from localhost.localdomain (a91-156-160-115.elisa-laajakaista.fi. [91.156.160.115]) by mx.google.com with ESMTPS id bc2sm279735lbb.3.2012.09.05.01.26.18 (version=SSLv3 cipher=OTHER); Wed, 05 Sep 2012 01:26:19 -0700 (PDT) From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, archit@ti.com Cc: Tomi Valkeinen Subject: [PATCH 05/17] OMAPFB: clear framebuffers with CPU Date: Wed, 5 Sep 2012 11:25:43 +0300 Message-Id: <1346833555-31258-6-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1346833555-31258-1-git-send-email-tomi.valkeinen@ti.com> References: <1346833555-31258-1-git-send-email-tomi.valkeinen@ti.com> X-Gm-Message-State: ALoCoQkvC6Z3hkzcYb+1IoM4bHtq45MeKtH4JX+q5eYHJX9pA0RJwqQtfOOrhzxTRVPSBwcS+GG8 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Currently vram.c clears the allocated memory automatically using OMAP system DMA. In an effort to reduce OMAP dependencies, we'll do the memory clear with CPU from now on. This patch implements clearing of the framebuffer in omapfb, using cfb_fillrect() to do the actual clear. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/omapfb/omapfb-main.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index fc671d3..7afdfcf 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c @@ -1592,6 +1592,20 @@ static int omapfb_allocate_all_fbs(struct omapfb2_device *fbdev) return 0; } +static void omapfb_clear_fb(struct fb_info *fbi) +{ + const struct fb_fillrect rect = { + .dx = 0, + .dy = 0, + .width = fbi->var.xres_virtual, + .height = fbi->var.yres_virtual, + .color = 0, + .rop = ROP_COPY, + }; + + cfb_fillrect(fbi, &rect); +} + int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type) { struct omapfb_info *ofbi = FB2OFB(fbi); @@ -1661,6 +1675,8 @@ int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type) goto err; } + omapfb_clear_fb(fbi); + return 0; err: omapfb_free_fbmem(fbi); @@ -1972,6 +1988,16 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev) } } + for (i = 0; i < fbdev->num_fbs; i++) { + struct fb_info *fbi = fbdev->fbs[i]; + struct omapfb_info *ofbi = FB2OFB(fbi); + + if (ofbi->region->size == 0) + continue; + + omapfb_clear_fb(fbi); + } + /* Enable fb0 */ if (fbdev->num_fbs > 0) { struct omapfb_info *ofbi = FB2OFB(fbdev->fbs[0]);