From patchwork Wed Jul 2 22:13:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?St=C3=A9phane_Marchesin?= X-Patchwork-Id: 4468251 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D0E16BEEAA for ; Wed, 2 Jul 2014 22:13:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0198920304 for ; Wed, 2 Jul 2014 22:13:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1C87C20222 for ; Wed, 2 Jul 2014 22:13:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D3736E3B2; Wed, 2 Jul 2014 15:13:49 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by gabe.freedesktop.org (Postfix) with ESMTP id D88506E3B2 for ; Wed, 2 Jul 2014 15:13:47 -0700 (PDT) Received: by mail-pd0-f176.google.com with SMTP id ft15so12664657pdb.21 for ; Wed, 02 Jul 2014 15:13:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=n2kkEIjYlsmX5xlAn/yKe0b/bWf27fn3PCnAsQDqlkE=; b=JygKUPTZQDpoSVFKODYCqsGVsBz+ecCt/XS9SEMBeJQACb/vWTeThldbYF7LmBlOA3 AidSDDen9elrPZAsPWlKC1wbENhH9Y3tj0vj9ONwMHIwza6cXpwLaRbfuJxfkO6DMxZG zdYm5OfGD2fYwPhSG/VlyPQ0mualMe0MNCXeE= 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:mime-version :content-type:content-transfer-encoding; bh=n2kkEIjYlsmX5xlAn/yKe0b/bWf27fn3PCnAsQDqlkE=; b=JGv56eJh2K3reKs4XBajZEGCb4mRyYyTylUoTVQ8vmk6ECIFIzcXfTsP66sugpw7+C PZJ3L/YspJ8kwrDAByjOdb7JkjmNLIcegFvtutrbNdUWRnoHn7OyP4m1X/qWcrgWQVu1 lUNmshLZnnwfaQuV3+ZHNfVOueIjEY99fVkop7Ww3Som5y7kfnwdJtv0WzPsimUWyyWV GsqSu6eP0nqmJWT1GDtEjg+mSq5avTJDcNxHgbv0R8+QMmsjjAitjtBVUROFXUTAhSGG IgRFlBTdaWRx3N1srcizNRuvQJWIHV4dXNIMHxanP3E0kwlc0GQ+REFQeYSTNFNy3XyC CXgQ== X-Gm-Message-State: ALoCoQmLfGpHHH8/pUUrfS8+46qts7z2c/bsT2UEKhI+uqt/KMPIlPy5u880oMWsNGV6cSDtbDrH X-Received: by 10.66.132.36 with SMTP id or4mr726048pab.42.1404339227692; Wed, 02 Jul 2014 15:13:47 -0700 (PDT) Received: from localhost ([2620:0:1000:1b01:2d7c:dd05:dfb0:fe7]) by mx.google.com with ESMTPSA id uv5sm38521775pbc.52.2014.07.02.15.13.45 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 02 Jul 2014 15:13:46 -0700 (PDT) From: =?UTF-8?q?St=C3=A9phane=20Marchesin?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/udl: add vblank support Date: Wed, 2 Jul 2014 15:13:42 -0700 Message-Id: <1404339223-7009-1-git-send-email-marcheu@chromium.org> X-Mailer: git-send-email 2.0.0.526.g5318336 MIME-Version: 1.0 Cc: =?UTF-8?q?St=C3=A9phane=20Marchesin?= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is needed to be able to send page flip completion events. Also while I'm at it, fix the error paths on init. Signed-off-by: Stéphane Marchesin --- drivers/gpu/drm/udl/udl_main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c index e1038a9..40436db 100644 --- a/drivers/gpu/drm/udl/udl_main.c +++ b/drivers/gpu/drm/udl/udl_main.c @@ -307,10 +307,23 @@ int udl_driver_load(struct drm_device *dev, unsigned long flags) DRM_DEBUG("\n"); ret = udl_modeset_init(dev); + if (ret) + goto err; ret = udl_fbdev_init(dev); + if (ret) + goto err; + + ret = drm_vblank_init(dev, 1); + if (ret) + goto err_fb; + return 0; +err_fb: + udl_fbdev_cleanup(dev); err: + if (udl->urbs.count) + udl_free_urb_list(dev); kfree(udl); DRM_ERROR("%d\n", ret); return ret; @@ -326,6 +339,8 @@ int udl_driver_unload(struct drm_device *dev) { struct udl_device *udl = dev->dev_private; + drm_vblank_cleanup(dev); + if (udl->urbs.count) udl_free_urb_list(dev);