From patchwork Tue Apr 5 21:03:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 12801979 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7BBC0C4332F for ; Tue, 5 Apr 2022 21:04:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F60510EEC2; Tue, 5 Apr 2022 21:03:52 +0000 (UTC) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA5EC10EEB7 for ; Tue, 5 Apr 2022 21:03:49 +0000 (UTC) Received: by mail-wr1-x42e.google.com with SMTP id d3so321955wrb.7 for ; Tue, 05 Apr 2022 14:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ii3Nhkdc1PsQpJibVbASPuL+CL9a9pampKTaQUBuOx0=; b=Obh+/hdGsVQdKWDwQ2yyfDzOxXTaBbAJpPoi4FaoOu5W/e70H4xefbk6sMDFYxWfPk 7N8yvcTALGEADKT4KJ+PY9x63o299FO+L5MZ2nb6w6PsaV7BPLDnH3E4weZ0s0IhnhGo MWUkVUyziN4sdTOPBqyG3ALRPwR6uAILz9qms= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ii3Nhkdc1PsQpJibVbASPuL+CL9a9pampKTaQUBuOx0=; b=HvAKrAsvmidQw8ZeTZUO3b3UB5Lbo3RjeFeLq3/c0iHMIBUx9NN4JWgBUmFzQI7GyC IDWTsWFi1f0Dsks5B59H7eYuVFXBR82Ywsvb/6iI+W40bC+28KVbjelSOqfL/9u4qh6e NYMi5qEiXnpM0ScLbq+eC/xYTWHK4JD2lKqqkiPs1DAcYZDWAgwzI4OarrMC0BwASJ9s Or7K7DAGGbDeALiqQUXAfxUyJztl+u7juF+ifARMWNje26lASuRMJ9ivP5zMjmpenc2T wRPrv4iWrcyMYpzAPlQfQiSo7vcBkn3pwaj1r6cTTd8ug9f8Cc51nqcWSQF4Qo8HWt+7 F1XA== X-Gm-Message-State: AOAM532mZXqErUdDkMtFLNeLWJB8g6n8UHI3e2kQ5wwHV93qlZL66TPb rDYT0/tqRU1Osr9G0thJsYzKNaLcr1hCDPijoSM= X-Google-Smtp-Source: ABdhPJzcAQpi7DKeuKrAmthLzGnjqKZsxOGurILtUt9O/PqPsyylkpzrhTKBASPE+U17zvJh/H+w9g== X-Received: by 2002:adf:dbc6:0:b0:205:8e9a:29ab with SMTP id e6-20020adfdbc6000000b002058e9a29abmr4025866wrj.7.1649192628307; Tue, 05 Apr 2022 14:03:48 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id az19-20020a05600c601300b0038cadf3aa69sm4858569wmb.36.2022.04.05.14.03.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 14:03:47 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH v3 07/17] fbcon: Replace FBCON_FLAGS_INIT with a boolean Date: Tue, 5 Apr 2022 23:03:25 +0200 Message-Id: <20220405210335.3434130-8-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220405210335.3434130-1-daniel.vetter@ffwll.ch> References: <20220405210335.3434130-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , Du Cheng , Tetsuo Handa , Daniel Vetter , Intel Graphics Development , Claudio Suarez , Greg Kroah-Hartman , Daniel Vetter , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" It's only one flag and slightly tidier code. Acked-by: Thomas Zimmermann Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Tetsuo Handa Cc: Greg Kroah-Hartman Cc: Du Cheng Cc: Thomas Zimmermann Cc: Claudio Suarez --- drivers/video/fbdev/core/fbcon.c | 11 +++++------ drivers/video/fbdev/core/fbcon.h | 4 +--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 759299667023..81860ca80838 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -775,7 +775,7 @@ static void con2fb_init_display(struct vc_data *vc, struct fb_info *info, ops->currcon = fg_console; - if (info->fbops->fb_set_par && !(ops->flags & FBCON_FLAGS_INIT)) { + if (info->fbops->fb_set_par && !ops->initialized) { ret = info->fbops->fb_set_par(info); if (ret) @@ -784,7 +784,7 @@ static void con2fb_init_display(struct vc_data *vc, struct fb_info *info, "error code %d\n", ret); } - ops->flags |= FBCON_FLAGS_INIT; + ops->initialized = true; ops->graphics = 0; fbcon_set_disp(info, &info->var, unit); @@ -1103,8 +1103,7 @@ static void fbcon_init(struct vc_data *vc, int init) * We need to do it in fbcon_init() to prevent screen corruption. */ if (con_is_visible(vc) && vc->vc_mode == KD_TEXT) { - if (info->fbops->fb_set_par && - !(ops->flags & FBCON_FLAGS_INIT)) { + if (info->fbops->fb_set_par && !ops->initialized) { ret = info->fbops->fb_set_par(info); if (ret) @@ -1113,7 +1112,7 @@ static void fbcon_init(struct vc_data *vc, int init) "error code %d\n", ret); } - ops->flags |= FBCON_FLAGS_INIT; + ops->initialized = true; } ops->graphics = 0; @@ -1186,7 +1185,7 @@ static void fbcon_deinit(struct vc_data *vc) if (con_is_visible(vc)) fbcon_del_cursor_work(info); - ops->flags &= ~FBCON_FLAGS_INIT; + ops->initialized = false; finished: fbcon_free_font(p, free_font); diff --git a/drivers/video/fbdev/core/fbcon.h b/drivers/video/fbdev/core/fbcon.h index 6708ca0048aa..0eaf54a21151 100644 --- a/drivers/video/fbdev/core/fbcon.h +++ b/drivers/video/fbdev/core/fbcon.h @@ -18,8 +18,6 @@ #include -#define FBCON_FLAGS_INIT 1 - /* * This is the interface between the low-level console driver and the * low-level frame buffer device @@ -79,7 +77,7 @@ struct fbcon_ops { int blank_state; int graphics; int save_graphics; /* for debug enter/leave */ - int flags; + bool initialized; int rotate; int cur_rotate; char *cursor_data;