From patchwork Sun Mar 10 05:13:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Turpin X-Patchwork-Id: 10846089 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5E1E139A for ; Sun, 10 Mar 2019 05:13:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0E7B28FB2 for ; Sun, 10 Mar 2019 05:13:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 906842900C; Sun, 10 Mar 2019 05:13:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 436C228FB2 for ; Sun, 10 Mar 2019 05:13:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725798AbfCJFNf (ORCPT ); Sun, 10 Mar 2019 00:13:35 -0500 Received: from mail-yw1-f68.google.com ([209.85.161.68]:37129 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725779AbfCJFNf (ORCPT ); Sun, 10 Mar 2019 00:13:35 -0500 Received: by mail-yw1-f68.google.com with SMTP id k14so1351120ywe.4 for ; Sat, 09 Mar 2019 21:13:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3ck99bfqb2nJOgkIgwkfe2g4GflvgRo2yOThrVTd3Uw=; b=JShVZCO1STg6A968MfeY9iX2jQakj2CKQJvNWUVey2ais7Z5N9k9WMcyz2MNgQ7UvA 5M5TmoEI0RfYIzcdfC+z0a7bB190YpLv5mzFKdQhUDN9ZnLW5FqhCcUmb7XcGP5b1i9E TasBpUKhL2RbmpOcPiN0mzVh4ERk+UByy4pX9mhJ6FKQFkaPloDne70nO0WMreGA3ohu jx2QzoXKbUAzJadw8b4E9Wq1oIsDiH1oVWIqbRwkNlUy/6tsSJ+/H5zdQpiMHWmWnmcl zSgd1qqUJykuvwbvJ+A5u9z3AdjqU1hY7g2q/GZ21go/R72kzXU7ScHzNaKN4ZTo6JM+ KKKA== 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=3ck99bfqb2nJOgkIgwkfe2g4GflvgRo2yOThrVTd3Uw=; b=uV+kPKKOyb34kDVZnr1PNPLqO/5ZLj0cp64bBrewtZU4pGonhmd2aSS4oECZzM2KON O2cDQ1VjxFV8q7ZFgyQwHPDUgSaOEN4d3qx4rbN8Ml6SX+N2f0/cdMmWCadJqGuePTwp 2rVtC+HB8De0y9vulm3vvubawE+WBhk+exi38aalWbCSnMvxWEmujbfgnmme+uXCV5oC HqlapC/TurQdukWDl+tVOviX/KXXZdINTR3ZLub2X3qjXPS4JBTMe3UZnLEAM69GwG7t PatGNK4cBKmHS4g1ADRNEXWbFsKRCDmLnfv65PIUMG4qMkjmYcNkRe6FY8+2tNBbT9Zw QWgw== X-Gm-Message-State: APjAAAWm3+hTygQEk+gyJfFT3Xs+sQBTb2Rt4q8eUBitrVqfvllDhOYP dckzkXQceKojFnxqGS8ZyfY= X-Google-Smtp-Source: APXvYqy5cp8RD2ItpBOTeyxwnj+b/UwtPMQYZkZwZ0FgffBM5jQWpi+9YG/cLykmHq84WF8MXUkfYQ== X-Received: by 2002:a25:c443:: with SMTP id u64mr22588832ybf.180.1552194813935; Sat, 09 Mar 2019 21:13:33 -0800 (PST) Received: from localhost.localdomain ([97.104.65.140]) by smtp.gmail.com with ESMTPSA id q7sm243767ywi.69.2019.03.09.21.13.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2019 21:13:33 -0800 (PST) From: Joe Turpin To: Greg Kroah-Hartman , Sudip Mukherjee , Teddy Wang , linux-fbdev@vger.kernel.org Cc: Joe Turpin Subject: [PATCH] Fix whitespace to conform to coding style Date: Sun, 10 Mar 2019 00:13:27 -0500 Message-Id: <20190310051327.13976-1-joe.turpin@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace spaces with tabs for indentation and add where missing. Reflow comments to remain within 80 chars line limit. Signed-off-by: Joe Turpin --- drivers/staging/sm750fb/sm750_accel.c | 160 ++++++++++++++------------ 1 file changed, 88 insertions(+), 72 deletions(-) diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index eed840b251da..fbbb406636f3 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -41,7 +41,7 @@ void sm750_hw_de_init(struct lynx_accel *accel) write_dpr(accel, DE_MASKS, 0xFFFFFFFF); /* dpr1c */ - reg = 0x3; + reg = 0x3; clr = DE_STRETCH_FORMAT_PATTERN_XY | DE_STRETCH_FORMAT_PATTERN_Y_MASK | @@ -61,7 +61,7 @@ void sm750_hw_de_init(struct lynx_accel *accel) write_dpr(accel, DE_COLOR_COMPARE, 0); clr = DE_CONTROL_TRANSPARENCY | DE_CONTROL_TRANSPARENCY_MATCH | - DE_CONTROL_TRANSPARENCY_SELECT; + DE_CONTROL_TRANSPARENCY_SELECT; /* dpr0c */ write_dpr(accel, DE_CONTROL, read_dpr(accel, DE_CONTROL) & ~clr); @@ -72,7 +72,6 @@ void sm750_hw_de_init(struct lynx_accel *accel) * but if you need dual framebuffer driver,need call set2dformat * every time you use 2d function */ - void sm750_hw_set2dformat(struct lynx_accel *accel, int fmt) { u32 reg; @@ -85,10 +84,8 @@ void sm750_hw_set2dformat(struct lynx_accel *accel, int fmt) write_dpr(accel, DE_STRETCH_FORMAT, reg); } -int sm750_hw_fillrect(struct lynx_accel *accel, - u32 base, u32 pitch, u32 Bpp, - u32 x, u32 y, u32 width, u32 height, - u32 color, u32 rop) +int sm750_hw_fillrect(struct lynx_accel *accel, u32 base, u32 pitch, u32 Bpp, + u32 x, u32 y, u32 width, u32 height, u32 color, u32 rop) { u32 deCtrl; @@ -105,45 +102,52 @@ int sm750_hw_fillrect(struct lynx_accel *accel, write_dpr(accel, DE_PITCH, ((pitch / Bpp << DE_PITCH_DESTINATION_SHIFT) & DE_PITCH_DESTINATION_MASK) | - (pitch / Bpp & DE_PITCH_SOURCE_MASK)); /* dpr10 */ + (pitch / Bpp & DE_PITCH_SOURCE_MASK)); /* dpr10 */ write_dpr(accel, DE_WINDOW_WIDTH, ((pitch / Bpp << DE_WINDOW_WIDTH_DST_SHIFT) & DE_WINDOW_WIDTH_DST_MASK) | - (pitch / Bpp & DE_WINDOW_WIDTH_SRC_MASK)); /* dpr44 */ + (pitch / Bpp & DE_WINDOW_WIDTH_SRC_MASK)); /* dpr44 */ write_dpr(accel, DE_FOREGROUND, color); /* DPR14 */ write_dpr(accel, DE_DESTINATION, ((x << DE_DESTINATION_X_SHIFT) & DE_DESTINATION_X_MASK) | - (y & DE_DESTINATION_Y_MASK)); /* dpr4 */ + (y & DE_DESTINATION_Y_MASK)); /* dpr4 */ write_dpr(accel, DE_DIMENSION, ((width << DE_DIMENSION_X_SHIFT) & DE_DIMENSION_X_MASK) | - (height & DE_DIMENSION_Y_ET_MASK)); /* dpr8 */ + (height & DE_DIMENSION_Y_ET_MASK)); /* dpr8 */ deCtrl = DE_CONTROL_STATUS | DE_CONTROL_LAST_PIXEL | - DE_CONTROL_COMMAND_RECTANGLE_FILL | DE_CONTROL_ROP_SELECT | - (rop & DE_CONTROL_ROP_MASK); /* dpr0xc */ + DE_CONTROL_COMMAND_RECTANGLE_FILL | DE_CONTROL_ROP_SELECT | + (rop & DE_CONTROL_ROP_MASK); /* dpr0xc */ write_dpr(accel, DE_CONTROL, deCtrl); return 0; } -int sm750_hw_copyarea( -struct lynx_accel *accel, -unsigned int sBase, /* Address of source: offset in frame buffer */ -unsigned int sPitch, /* Pitch value of source surface in BYTE */ -unsigned int sx, -unsigned int sy, /* Starting coordinate of source surface */ -unsigned int dBase, /* Address of destination: offset in frame buffer */ -unsigned int dPitch, /* Pitch value of destination surface in BYTE */ -unsigned int Bpp, /* Color depth of destination surface */ -unsigned int dx, -unsigned int dy, /* Starting coordinate of destination surface */ -unsigned int width, -unsigned int height, /* width and height of rectangle in pixel value */ -unsigned int rop2) /* ROP value */ +/** + * sm750_hw_copyarea() + * @accel: + * @sBase: Address of source: offset in frame buffer + * @sPitch: Pitch value of source surface in BYTE + * @sx: Starting x-coordinate of source surface + * @sy: Starting y-coordinate of source surface + * @dBase: Address of destination: offset in frame buffer + * @dPitch: Pitch value of destination surface in BYTE + * @Bpp: Color depth of destination surface + * @dx: Starting x-coordinate of destination surface + * @dy: Starting y-coordinate of destination surface + * @width: width and height of rectangle in pixel value + * @height: width and height of rectangle in pixel value + * @rop2: ROP value + */ +int sm750_hw_copyarea(struct lynx_accel *accel, unsigned int sBase, + unsigned int sPitch, unsigned int sx, unsigned int sy, + unsigned int dBase, unsigned int dPitch, unsigned int Bpp, + unsigned int dx, unsigned int dy, unsigned int width, + unsigned int height, unsigned int rop2) { unsigned int nDirection, de_ctrl; @@ -235,42 +239,43 @@ unsigned int rop2) /* ROP value */ */ write_dpr(accel, DE_WINDOW_DESTINATION_BASE, dBase); /* dpr44 */ - /* - * Program pitch (distance between the 1st points of two adjacent lines). - * Note that input pitch is BYTE value, but the 2D Pitch register uses - * pixel values. Need Byte to pixel conversion. - */ + /* + * Program pitch (distance between the 1st points of 2 adjacent lines). + * Note that input pitch is BYTE value, but the 2D Pitch register uses + * pixel values. Need Byte to pixel conversion. + */ write_dpr(accel, DE_PITCH, ((dPitch / Bpp << DE_PITCH_DESTINATION_SHIFT) & DE_PITCH_DESTINATION_MASK) | - (sPitch / Bpp & DE_PITCH_SOURCE_MASK)); /* dpr10 */ + (sPitch / Bpp & DE_PITCH_SOURCE_MASK)); /* dpr10 */ - /* - * Screen Window width in Pixels. - * 2D engine uses this value to calculate the linear address in frame buffer - * for a given point. - */ + /* + * Screen Window width in Pixels. + * 2D engine uses this value to calculate the linear address + * in frame buffer for a given point. + */ write_dpr(accel, DE_WINDOW_WIDTH, ((dPitch / Bpp << DE_WINDOW_WIDTH_DST_SHIFT) & DE_WINDOW_WIDTH_DST_MASK) | - (sPitch / Bpp & DE_WINDOW_WIDTH_SRC_MASK)); /* dpr3c */ + (sPitch / Bpp & + DE_WINDOW_WIDTH_SRC_MASK)); /* dpr3c */ if (accel->de_wait() != 0) return -1; write_dpr(accel, DE_SOURCE, ((sx << DE_SOURCE_X_K1_SHIFT) & DE_SOURCE_X_K1_MASK) | - (sy & DE_SOURCE_Y_K2_MASK)); /* dpr0 */ + (sy & DE_SOURCE_Y_K2_MASK)); /* dpr0 */ write_dpr(accel, DE_DESTINATION, ((dx << DE_DESTINATION_X_SHIFT) & DE_DESTINATION_X_MASK) | - (dy & DE_DESTINATION_Y_MASK)); /* dpr04 */ + (dy & DE_DESTINATION_Y_MASK)); /* dpr04 */ write_dpr(accel, DE_DIMENSION, ((width << DE_DIMENSION_X_SHIFT) & DE_DIMENSION_X_MASK) | - (height & DE_DIMENSION_Y_ET_MASK)); /* dpr08 */ + (height & DE_DIMENSION_Y_ET_MASK)); /* dpr08 */ de_ctrl = (rop2 & DE_CONTROL_ROP_MASK) | DE_CONTROL_ROP_SELECT | - ((nDirection == RIGHT_TO_LEFT) ? DE_CONTROL_DIRECTION : 0) | - DE_CONTROL_COMMAND_BITBLT | DE_CONTROL_STATUS; + ((nDirection == RIGHT_TO_LEFT) ? DE_CONTROL_DIRECTION : 0) | + DE_CONTROL_COMMAND_BITBLT | DE_CONTROL_STATUS; write_dpr(accel, DE_CONTROL, de_ctrl); /* dpr0c */ return 0; @@ -288,20 +293,31 @@ static unsigned int deGetTransparency(struct lynx_accel *accel) return de_ctrl; } -int sm750_hw_imageblit(struct lynx_accel *accel, - const char *pSrcbuf, /* pointer to start of source buffer in system memory */ - u32 srcDelta, /* Pitch value (in bytes) of the source buffer, +ive means top down and -ive mean button up */ - u32 startBit, /* Mono data can start at any bit in a byte, this value should be 0 to 7 */ - u32 dBase, /* Address of destination: offset in frame buffer */ - u32 dPitch, /* Pitch value of destination surface in BYTE */ - u32 bytePerPixel, /* Color depth of destination surface */ - u32 dx, - u32 dy, /* Starting coordinate of destination surface */ - u32 width, - u32 height, /* width and height of rectangle in pixel value */ - u32 fColor, /* Foreground color (corresponding to a 1 in the monochrome data */ - u32 bColor, /* Background color (corresponding to a 0 in the monochrome data */ - u32 rop2) /* ROP value */ +/** + * sm750_hw_imageblit() + * @accel: + * @pSrcbuf: pointer to start of source buffer in system memory + * @srcDelta: Pitch value (in bytes) of the source buffer, + * +ive means top down and -ive mean button up + * @startBit: Mono data can start at any bit in a byte, + * this value should be 0 to 7 + * @dBase: Address of destination: offset in frame buffer + * @dPitch: Pitch value of destination surface in BYTE + * @bytePerPixel: Color depth of destination surface + * @dx: Starting x-coordinate of destination surface + * @dy: Starting y-coordinate of destination surface + * @width: width of rectangle in pixel value + * @height: height of rectangle in pixel value + * @fColor: Foreground color + * (corresponding to a 1 in the monochrome data) + * @bColor: Background color + * (corresponding to a 0 in the monochrome data) + * @rop2: ROP value + */ +int sm750_hw_imageblit(struct lynx_accel *accel, const char *pSrcbuf, + u32 srcDelta, u32 startBit, u32 dBase, u32 dPitch, + u32 bytePerPixel, u32 dx, u32 dy, u32 width, u32 height, + u32 fColor, u32 bColor, u32 rop2) { unsigned int ulBytesPerScan; unsigned int ul4BytesPerScan; @@ -338,7 +354,8 @@ int sm750_hw_imageblit(struct lynx_accel *accel, write_dpr(accel, DE_PITCH, ((dPitch / bytePerPixel << DE_PITCH_DESTINATION_SHIFT) & DE_PITCH_DESTINATION_MASK) | - (dPitch / bytePerPixel & DE_PITCH_SOURCE_MASK)); /* dpr10 */ + (dPitch / bytePerPixel & + DE_PITCH_SOURCE_MASK)); /* dpr10 */ /* * Screen Window width in Pixels. @@ -348,31 +365,31 @@ int sm750_hw_imageblit(struct lynx_accel *accel, write_dpr(accel, DE_WINDOW_WIDTH, ((dPitch / bytePerPixel << DE_WINDOW_WIDTH_DST_SHIFT) & DE_WINDOW_WIDTH_DST_MASK) | - (dPitch / bytePerPixel & DE_WINDOW_WIDTH_SRC_MASK)); + (dPitch / bytePerPixel & DE_WINDOW_WIDTH_SRC_MASK)); - /* - * Note: For 2D Source in Host Write, only X_K1_MONO field is needed, - * and Y_K2 field is not used. - * For mono bitmap, use startBit for X_K1. - */ + /* + * Note: For 2D Source in Host Write, only X_K1_MONO field is needed, + * and Y_K2 field is not used. + * For mono bitmap, use startBit for X_K1. + */ write_dpr(accel, DE_SOURCE, (startBit << DE_SOURCE_X_K1_SHIFT) & - DE_SOURCE_X_K1_MONO_MASK); /* dpr00 */ + DE_SOURCE_X_K1_MONO_MASK); /* dpr00 */ write_dpr(accel, DE_DESTINATION, ((dx << DE_DESTINATION_X_SHIFT) & DE_DESTINATION_X_MASK) | - (dy & DE_DESTINATION_Y_MASK)); /* dpr04 */ + (dy & DE_DESTINATION_Y_MASK)); /* dpr04 */ write_dpr(accel, DE_DIMENSION, ((width << DE_DIMENSION_X_SHIFT) & DE_DIMENSION_X_MASK) | - (height & DE_DIMENSION_Y_ET_MASK)); /* dpr08 */ + (height & DE_DIMENSION_Y_ET_MASK)); /* dpr08 */ write_dpr(accel, DE_FOREGROUND, fColor); write_dpr(accel, DE_BACKGROUND, bColor); - de_ctrl = (rop2 & DE_CONTROL_ROP_MASK) | - DE_CONTROL_ROP_SELECT | DE_CONTROL_COMMAND_HOST_WRITE | - DE_CONTROL_HOST | DE_CONTROL_STATUS; + de_ctrl = (rop2 & DE_CONTROL_ROP_MASK) | DE_CONTROL_ROP_SELECT | + DE_CONTROL_COMMAND_HOST_WRITE | DE_CONTROL_HOST | + DE_CONTROL_STATUS; write_dpr(accel, DE_CONTROL, de_ctrl | deGetTransparency(accel)); @@ -393,4 +410,3 @@ int sm750_hw_imageblit(struct lynx_accel *accel, return 0; } -