From patchwork Wed Nov 18 13:50:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Y, Kishore" X-Patchwork-Id: 61015 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAIDobMf022706 for ; Wed, 18 Nov 2009 13:50:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757080AbZKRNu3 (ORCPT ); Wed, 18 Nov 2009 08:50:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757022AbZKRNu2 (ORCPT ); Wed, 18 Nov 2009 08:50:28 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:50959 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756676AbZKRNu2 convert rfc822-to-8bit (ORCPT ); Wed, 18 Nov 2009 08:50:28 -0500 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id nAIDoVlW026746 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Nov 2009 07:50:33 -0600 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id nAIDoUVq024601; Wed, 18 Nov 2009 19:20:30 +0530 (IST) Received: from dbde02.ent.ti.com ([172.24.170.145]) by dbde70.ent.ti.com ([172.24.170.148]) with mapi; Wed, 18 Nov 2009 19:20:30 +0530 From: "Y, Kishore" To: "linux-media@vger.kernel.org" CC: "linux-omap@vger.kernel.org" Date: Wed, 18 Nov 2009 19:20:29 +0530 Subject: [PATCH] V4L2: clear buf when vrfb buf not allocated Thread-Topic: [PATCH] V4L2: clear buf when vrfb buf not allocated Thread-Index: AcpoVhc98ddTjCSOTXKYLk2O62i9Vg== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c index 7092ef2..0a9fdd7 100644 --- a/drivers/media/video/omap/omap_vout.c +++ b/drivers/media/video/omap/omap_vout.c @@ -223,9 +223,11 @@ static int omap_vout_allocate_vrfb_buffers(struct omap_vout_device *vout, unsigned int *count, int startindex) { int i, j; + int buffer_set; for (i = 0; i < *count; i++) { - if (!vout->smsshado_virt_addr[i]) { + buffer_set = vout->smsshado_virt_addr[i]; + if (!buffer_set) { vout->smsshado_virt_addr[i] = omap_vout_alloc_buffer(vout->smsshado_size, &vout->smsshado_phy_addr[i]); @@ -247,8 +249,10 @@ static int omap_vout_allocate_vrfb_buffers(struct omap_vout_device *vout, *count = 0; return -ENOMEM; } - memset((void *) vout->smsshado_virt_addr[i], 0, - vout->smsshado_size); + if (!buffer_set) { + memset((void *) vout->smsshado_virt_addr[i], 0, + vout->smsshado_size); + } } return 0; }