From patchwork Fri Nov 15 09:21:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11245467 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A9021393 for ; Fri, 15 Nov 2019 09:23:22 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 24CFB20733 for ; Fri, 15 Nov 2019 09:23:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="iPsLs/5c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24CFB20733 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iVXnM-0003qZ-Cq; Fri, 15 Nov 2019 09:21:36 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iVXnL-0003qU-2P for xen-devel@lists.xenproject.org; Fri, 15 Nov 2019 09:21:35 +0000 X-Inumbo-ID: 510a13e2-0789-11ea-984a-bc764e2007e4 Received: from mail-wm1-x342.google.com (unknown [2a00:1450:4864:20::342]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 510a13e2-0789-11ea-984a-bc764e2007e4; Fri, 15 Nov 2019 09:21:34 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id l1so8905210wme.2 for ; Fri, 15 Nov 2019 01:21:34 -0800 (PST) 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=7bn7YokeAeXm5BBJ6T/lvBeGEKknPiOWxZqo9r4HuKg=; b=iPsLs/5cfYIlrdmZTkqsrS08Xzs+mb1WigGIc8UF9mWaopmOt67NMkE/lXX4F+eOoG sp3k+sinSMfKknbC2E/NHc0xpYuS/w/dMw/+BuJ86EZXz8bPRSoOq9QAXYjPCB1Yvifq U2y8J/LVbYpFVejCPFSt7NoNf07QSjEGvzgEU= 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=7bn7YokeAeXm5BBJ6T/lvBeGEKknPiOWxZqo9r4HuKg=; b=OhyONHAPnYeV8xb2ITBdcI0Ot7M6o+UZjA5qmwPvV1OGQTZ/NJYKlB7+jfsul5rwXg 7tvvPI0Q7B936fk/UCV31NiOdT4tFya9euU4oBDGI01EJ4uB/UEVaEcTZcUljyUDkejz Q4flzJC3iXUutPccq6a8xMlLkgPyo80viRwc9i6huUinthQ+zXq9EmWzMFFJFCKneos+ 7EtTUVE85obuKqgvP5Irwoaak92U4dSpuy8KjACRiVsbu25ABUIZzqfTgnKYlYqWFSs2 JimrnsHK11a7ZyGlwD8I7vYo7qutsNxRnaUBwvKG36l0yy0jjGFNLgdKMxgwUoMjGADO ZR0w== X-Gm-Message-State: APjAAAVmf/mv1q2RPVO6PAWHvHyCet/etIs9ide1mSJXaS3cuad7/Ptn xnOJXQVXjk4y4YyxbozsdepYCg== X-Google-Smtp-Source: APXvYqw5pA6Z4/To2HtwhxA8s+cQMEm12J+4VegYlzVpaDN9QcIFr5+3oidjgBd15trxx9d517+bhw== X-Received: by 2002:a1c:62c5:: with SMTP id w188mr13020645wmb.77.1573809693584; Fri, 15 Nov 2019 01:21:33 -0800 (PST) Received: from phenom.ffwll.local (212-51-149-96.fiber7.init7.net. [212.51.149.96]) by smtp.gmail.com with ESMTPSA id 11sm8987506wmi.8.2019.11.15.01.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 01:21:32 -0800 (PST) From: Daniel Vetter To: DRI Development Date: Fri, 15 Nov 2019 10:21:18 +0100 Message-Id: <20191115092120.4445-7-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191115092120.4445-1-daniel.vetter@ffwll.ch> References: <20191115092120.4445-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 6/8] drm/xen: Simplify fb_create X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Intel Graphics Development , Oleksandr Andrushchenko , xen-devel@lists.xenproject.org, Daniel Vetter Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The current code is a pretty good wtf moment, since we drop the reference before we use it. It's not a big deal, because a) we only use the pointer, so doesn't blow up and the real reason b) fb->obj[0] already holds a full reference for us. Might as well take the real pointer ins't of complicated games that baffle. Signed-off-by: Daniel Vetter Cc: Oleksandr Andrushchenko Cc: xen-devel@lists.xenproject.org Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/xen/xen_drm_front_kms.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpu/drm/xen/xen_drm_front_kms.c b/drivers/gpu/drm/xen/xen_drm_front_kms.c index ff506bc99414..4f34c5208180 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_kms.c +++ b/drivers/gpu/drm/xen/xen_drm_front_kms.c @@ -63,14 +63,7 @@ fb_create(struct drm_device *dev, struct drm_file *filp, if (IS_ERR_OR_NULL(fb)) return fb; - gem_obj = drm_gem_object_lookup(filp, mode_cmd->handles[0]); - if (!gem_obj) { - DRM_ERROR("Failed to lookup GEM object\n"); - ret = -ENOENT; - goto fail; - } - - drm_gem_object_put_unlocked(gem_obj); + gem_obj = fb->obj[0]; ret = xen_drm_front_fb_attach(drm_info->front_info, xen_drm_front_dbuf_to_cookie(gem_obj),