From patchwork Tue Mar 26 13:20:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10871113 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 632E01390 for ; Tue, 26 Mar 2019 13:21:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 504522902B for ; Tue, 26 Mar 2019 13:21:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E92128FD4; Tue, 26 Mar 2019 13:21:18 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 072D528FD4 for ; Tue, 26 Mar 2019 13:21:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 43A676E07E; Tue, 26 Mar 2019 13:20:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by gabe.freedesktop.org (Postfix) with ESMTPS id 53AE96E068 for ; Tue, 26 Mar 2019 13:20:35 +0000 (UTC) Received: by mail-ed1-x541.google.com with SMTP id v21so10731404edq.4 for ; Tue, 26 Mar 2019 06:20:35 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=AMQjQ8p5IYKyc/k3Ozc5jkm9T3PqDPRFgUUMBsBd3h0=; b=uFmt4M6378G2LDn6XPesTS+9ZpnqpJlpJUpjMruypf3NOsluqXExVy8Zyeblg8V7OV VymFWjapwbdGh61d/3ndgvrVeX5jHozfIqyfXlhtE/XmIom5rJGoit1EY9bFR4aK4hAn g0SDHcANvfJ06xPfwOFDcajGOAytlJVASw1POp02YM4q3LTHGzLelnlkH5RtU3yc0ZOE h4uE7N0GNGGnFeqCIJeaNaX3jHrSwyt5k3/WOW14xwIKoViEoJ9i0ePtC4pK5t0C+iiH FZ+j+AWvwvrbEwryUAoATXG9XNvPRYezYfb3JvOllNyQLT1qVLi7hwB1f32iEWoR4J02 Kqcg== X-Gm-Message-State: APjAAAX7mSJM5KOY4jsVIt+xGAmlm67LPV+Jxwm5EzDzZwarJSyLJSGN hK4bbd3fpfnTKQm0eCeu0clPvPlWOws= X-Google-Smtp-Source: APXvYqxipfmejIl7kb7+2Y8E2zy9VageFcC52KvU7WNGeW1sVdr3YHXL3DDJCCNdEK7WU50liCcatQ== X-Received: by 2002:a17:906:1347:: with SMTP id x7mr9990190ejb.64.1553606432182; Tue, 26 Mar 2019 06:20:32 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id d10sm3668547ejh.66.2019.03.26.06.20.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Mar 2019 06:20:31 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 14/21] drm/nouveau: Use drm_fb_helper_fill_info Date: Tue, 26 Mar 2019 14:20:01 +0100 Message-Id: <20190326132008.11781-14-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190326132008.11781-1-daniel.vetter@ffwll.ch> References: <20190326132008.11781-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Mailman-Original-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=AMQjQ8p5IYKyc/k3Ozc5jkm9T3PqDPRFgUUMBsBd3h0=; b=GDPrKpVyRFBbY9AWRbzAwG6qdT8yD8qbUvYH7//1tItZ3mF9GH4WhffgXUAbftPGRH cVSygZ3GaJGSAyl0CIcCsaw/4PEKUGd9Fds7sqsQl192ump/+hIDavVOtugodrrE1ji1 vkOIz50de0CsTpmjytKHXnoMNxvsSUOzfcw3A= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nouveau@lists.freedesktop.org, Daniel Vetter , Intel Graphics Development , Ben Skeggs , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This changes the fb name from "nouveaufb" to "nouveaudrmfb". Aside: I wonder whether the in_interrupt() check is good enough for the nouveau acceleration. Cargo-cult says drm_can_sleep() is needed, which isn't actually working if you pick a .config without PREEMPT. For the generic fbdev defio support we've gone with offloading everything to a worker. For the non-accel callbacks (set_par, blank and friends) checking for oops_in_progress is good enough to catch all the evil calling contexts. v2: Rebase Signed-off-by: Daniel Vetter Cc: Ben Skeggs Cc: nouveau@lists.freedesktop.org Acked-by: Noralf Trønnes --- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 7 +------ drivers/gpu/drm/nouveau/nouveau_fbcon.h | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 9d6dba07c727..73cc3217068a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -366,12 +366,9 @@ nouveau_fbcon_create(struct drm_fb_helper *helper, goto out_unlock; } - info->par = fbcon; - /* setup helper */ fbcon->helper.fb = &fb->base; - strcpy(info->fix.id, "nouveaufb"); if (!chan) info->flags = FBINFO_HWACCEL_DISABLED; else @@ -386,9 +383,7 @@ nouveau_fbcon_create(struct drm_fb_helper *helper, info->screen_base = nvbo_kmap_obj_iovirtual(fb->nvbo); info->screen_size = fb->nvbo->bo.mem.num_pages << PAGE_SHIFT; - drm_fb_helper_fill_fix(info, fb->base.pitches[0], - fb->base.format->depth); - drm_fb_helper_fill_var(info, &fbcon->helper, sizes->fb_width, sizes->fb_height); + drm_fb_helper_fill_info(info, &fbcon->helper, sizes); /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */ diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.h b/drivers/gpu/drm/nouveau/nouveau_fbcon.h index db9d52047ef8..73a7eeba3973 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.h +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.h @@ -32,7 +32,7 @@ #include "nouveau_display.h" struct nouveau_fbdev { - struct drm_fb_helper helper; + struct drm_fb_helper helper; /* must be first */ unsigned int saved_flags; struct nvif_object surf2d; struct nvif_object clip;