From patchwork Tue Jun 7 15:26:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 9161647 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4AD2960571 for ; Tue, 7 Jun 2016 15:26:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CBC5264F4 for ; Tue, 7 Jun 2016 15:26:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3183E2723E; Tue, 7 Jun 2016 15:26:49 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7FF7264F4 for ; Tue, 7 Jun 2016 15:26:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BF65A6E7E0; Tue, 7 Jun 2016 15:26:37 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9155D6E7D6; Tue, 7 Jun 2016 15:26:31 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id n184so25125983wmn.1; Tue, 07 Jun 2016 08:26:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Dk/eKsLb8qF54CCJKmHDDi0oA3AicyKGu6TcoqV8y9Q=; b=n/mOyiA/mgbCUSNQPlvG2iQnGtEDKaxQIWiDcznwS9jDBxh9O6mhj/Z4n3gdZQfQhP m83t6Ot4fD/Ja/Qdf53nqF7imVAG1BiVlagdZ/mHhGKFHdLJmFvXVEp2JHbM74bmPcxg MR79+0k2spjyXlLh1xy1PwI5pfpoYJJDx6oWX1TXpEx3bFJCMpJz2CcHM3sMpKUZwqGt jNKMNtt2cABfLVIQB4vr9wagQlwvvcOZcu4J5R7QNRcQ1nh4+GyGJhJOPGoT0v/pPiQ3 EXzFMKxa9MCe2fnvOrb3gWxC59ioxJYTTn/SvUQPNbPGWIeW24O8XzLKv6SrK2g9U29V UAEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Dk/eKsLb8qF54CCJKmHDDi0oA3AicyKGu6TcoqV8y9Q=; b=k6ytAYCa2omDNcXcOJqL8ilIOZ3DiuX8E8m0q7suE2JXZMVsd2amnOMGPXrv8ZQu1n orTdcZyXMmqIBOWFM5oibqzJN7IjbwzUbpEEJKLQSeDjA3SZ+BJjOcxfleQRVO0Sq/GE oR+eDcKliP/JbyW/qhmEI7FUWOtqH9AQZTaKC8Qzr8QTAl1PU4I9G37uwmDKZ5pCf63F XRpwFMFXYfFLFwll/fadp9MNdiZh5G5yGtjJTMhWKht6W/hMc97VZH5dy/jw3rMsoKGj ERIwpa18jKwU3ZGrc8sotXwgO7jrNeYD6+xiL1ViGpV0tKLqtraPG+VJzncOmO2/dCDz /mGw== X-Gm-Message-State: ALyK8tJ8KbT9w0UYTU9dcaVWU0/eGDbReui44nJ7d53z18Tu7lOlJmahJm3zh/EEyrxkjg== X-Received: by 10.194.246.129 with SMTP id xw1mr8829wjc.142.1465313189750; Tue, 07 Jun 2016 08:26:29 -0700 (PDT) Received: from localhost (port-9435.pppoe.wtnet.de. [84.46.36.255]) by smtp.gmail.com with ESMTPSA id u6sm25987587wjy.17.2016.06.07.08.26.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jun 2016 08:26:28 -0700 (PDT) From: Thierry Reding To: Daniel Vetter Date: Tue, 7 Jun 2016 17:26:17 +0200 Message-Id: <20160607152625.9511-2-thierry.reding@gmail.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20160607152625.9511-1-thierry.reding@gmail.com> References: <20160607152625.9511-1-thierry.reding@gmail.com> Cc: Boris Brezillon , Joonyoung Shim , Xinliang Liu , Chen Feng , intel-gfx@lists.freedesktop.org, Seung-Woo Kim , Xinwei Kong , dri-devel@lists.freedesktop.org, Inki Dae , Kyungmin Park , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= Subject: [Intel-gfx] [PATCH v2 1/9] drm/fb-helper: Cleanup checkpatch warnings X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding Fix up a couple of checkpatch warnings, such as whitespace or coding style issues. Signed-off-by: Thierry Reding --- drivers/gpu/drm/drm_fb_helper.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 7c2eb75db60f..7945620e7439 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -190,9 +190,9 @@ int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper, fb_helper_connector = fb_helper->connector_info[i]; drm_connector_unreference(fb_helper_connector->connector); - for (j = i + 1; j < fb_helper->connector_count; j++) { + for (j = i + 1; j < fb_helper->connector_count; j++) fb_helper->connector_info[j - 1] = fb_helper->connector_info[j]; - } + fb_helper->connector_count--; kfree(fb_helper_connector); @@ -290,6 +290,7 @@ int drm_fb_helper_debug_leave(struct fb_info *info) for (i = 0; i < helper->crtc_count; i++) { struct drm_mode_set *mode_set = &helper->crtc_info[i].mode_set; + crtc = mode_set->crtc; funcs = crtc->helper_private; fb = drm_mode_config_fb(crtc); @@ -317,7 +318,7 @@ static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper) struct drm_plane *plane; struct drm_atomic_state *state; int i, ret; - unsigned plane_mask; + unsigned int plane_mask; state = drm_atomic_state_alloc(dev); if (!state) @@ -349,7 +350,7 @@ retry: goto fail; } - for(i = 0; i < fb_helper->crtc_count; i++) { + for (i = 0; i < fb_helper->crtc_count; i++) { struct drm_mode_set *mode_set = &fb_helper->crtc_info[i].mode_set; ret = __drm_atomic_helper_set_config(mode_set, state); @@ -511,6 +512,7 @@ static bool drm_fb_helper_force_kernel_mode(void) static void drm_fb_helper_restore_work_fn(struct work_struct *ignored) { bool ret; + ret = drm_fb_helper_force_kernel_mode(); if (ret == true) DRM_ERROR("Failed to restore crtc configuration\n"); @@ -812,9 +814,8 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper) if (!list_empty(&fb_helper->kernel_fb_list)) { list_del(&fb_helper->kernel_fb_list); - if (list_empty(&kernel_fb_helper_list)) { + if (list_empty(&kernel_fb_helper_list)) unregister_sysrq_key('v', &sysrq_drm_fb_helper_restore_op); - } } drm_fb_helper_crtc_free(fb_helper); @@ -1059,6 +1060,7 @@ static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green, (blue << info->var.blue.offset); if (info->var.transp.length > 0) { u32 mask = (1 << info->var.transp.length) - 1; + mask <<= info->var.transp.offset; value |= mask; } @@ -1087,6 +1089,7 @@ static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green, if (fb->depth == 16) { u16 r, g, b; int i; + if (regno < 32) { for (i = 0; i < 8; i++) fb_helper->funcs->gamma_set(crtc, red, @@ -1298,7 +1301,7 @@ static int pan_display_atomic(struct fb_var_screeninfo *var, struct drm_atomic_state *state; struct drm_plane *plane; int i, ret; - unsigned plane_mask; + unsigned int plane_mask; state = drm_atomic_state_alloc(dev); if (!state) @@ -1307,7 +1310,7 @@ static int pan_display_atomic(struct fb_var_screeninfo *var, state->acquire_ctx = dev->mode_config.acquire_ctx; retry: plane_mask = 0; - for(i = 0; i < fb_helper->crtc_count; i++) { + for (i = 0; i < fb_helper->crtc_count; i++) { struct drm_mode_set *mode_set; mode_set = &fb_helper->crtc_info[i].mode_set; @@ -1416,8 +1419,8 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, memset(&sizes, 0, sizeof(struct drm_fb_helper_surface_size)); sizes.surface_depth = 24; sizes.surface_bpp = 32; - sizes.fb_width = (unsigned)-1; - sizes.fb_height = (unsigned)-1; + sizes.fb_width = (u32)-1; + sizes.fb_height = (u32)-1; /* if driver picks 8 or 16 by default use that for both depth/bpp */ @@ -1485,6 +1488,7 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, for (j = 0; j < mode_set->num_connectors; j++) { struct drm_connector *connector = mode_set->connectors[j]; + if (connector->has_tile) { lasth = (connector->tile_h_loc == (connector->num_h_tile - 1)); lastv = (connector->tile_v_loc == (connector->num_v_tile - 1)); @@ -1533,9 +1537,8 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, dev_info(fb_helper->dev->dev, "fb%d: %s frame buffer device\n", info->node, info->fix.id); - if (list_empty(&kernel_fb_helper_list)) { + if (list_empty(&kernel_fb_helper_list)) register_sysrq_key('v', &sysrq_drm_fb_helper_restore_op); - } list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list); @@ -1570,7 +1573,6 @@ void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, info->fix.accel = FB_ACCEL_NONE; info->fix.line_length = pitch; - return; } EXPORT_SYMBOL(drm_fb_helper_fill_fix); @@ -1592,6 +1594,7 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe uint32_t fb_width, uint32_t fb_height) { struct drm_framebuffer *fb = fb_helper->fb; + info->pseudo_palette = fb_helper->pseudo_palette; info->var.xres_virtual = fb->width; info->var.yres_virtual = fb->height; @@ -1902,6 +1905,7 @@ static bool drm_target_preferred(struct drm_fb_helper *fb_helper, int i; uint64_t conn_configured = 0, mask; int tile_pass = 0; + mask = (1 << fb_helper->connector_count) - 1; retry: for (i = 0; i < fb_helper->connector_count; i++) { @@ -1925,7 +1929,7 @@ retry: continue; } else { - if (fb_helper_conn->connector->tile_h_loc != tile_pass -1 && + if (fb_helper_conn->connector->tile_h_loc != tile_pass - 1 && fb_helper_conn->connector->tile_v_loc != tile_pass - 1) /* if this tile_pass doesn't cover any of the tiles - keep going */ continue; @@ -2105,6 +2109,7 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper) struct drm_display_mode *mode = modes[i]; struct drm_fb_helper_crtc *fb_crtc = crtcs[i]; struct drm_fb_offset *offset = &offsets[i]; + modeset = &fb_crtc->mode_set; if (mode && fb_crtc) {