From patchwork Wed Aug 15 20:18:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 1328031 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id AEE56DFFED for ; Wed, 15 Aug 2012 20:20:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 834029EEA4 for ; Wed, 15 Aug 2012 13:20:26 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 8C30B9EBA3 for ; Wed, 15 Aug 2012 13:18:43 -0700 (PDT) Received: by obbta17 with SMTP id ta17so2629076obb.36 for ; Wed, 15 Aug 2012 13:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=8koI+uPMuZcuODB2zvg87RUlU+0cd1qQgJke4fMoQ1Y=; b=D2iO9Vnro54vbNmD7B3IB9twh9x8vkyjel28E1yNDlezFI5esAtxXOSO9YMqd4ufVn k/5xqqIA7t4VuUtPTVhOlqfgKG28yYl9g66x12YVi5qGSA5YYhyx6xEs0ZDG0Ye18Itg yXXbufl+U4Mr5fsaY6UaEbkLgwEBU9i7jmbYedwz8jseWhQsT6YIC/ojYWcIohe7JZ// EPpSRhG+t4rsHzXAEb0R4pqg7gdcMwAwgsGb8fIZl4Au48nliAhv+yUm1nOVU2w8c6YF 3xnIrijxP+bxQoSIzQQ++enm9nfJbA3sstDrReWvLyyhOXpiwCa0dP3uUcqSry51SEgJ bIcw== Received: by 10.182.212.70 with SMTP id ni6mr24996390obc.44.1345061923145; Wed, 15 Aug 2012 13:18:43 -0700 (PDT) Received: from localhost (ppp-70-129-134-248.dsl.rcsntx.swbell.net. [70.129.134.248]) by mx.google.com with ESMTPS id u5sm2217964obk.2.2012.08.15.13.18.42 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Aug 2012 13:18:42 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org Subject: [PATCH 2/2] Expose the OMAP Z-Order property through DRM Date: Wed, 15 Aug 2012 15:18:02 -0500 Message-Id: <1345061882-9743-3-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1345061882-9743-1-git-send-email-rob.clark@linaro.org> References: <1345061882-9743-1-git-send-email-rob.clark@linaro.org> Cc: patches@linaro.org, Greg KH , Rob Clark X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Andre Renaud Added support for zorder changes through DRM plane properties Signed-off-by: Andre Renaud Signed-off-by: Rob Clark --- drivers/staging/omapdrm/omap_drv.h | 1 + drivers/staging/omapdrm/omap_plane.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/staging/omapdrm/omap_drv.h b/drivers/staging/omapdrm/omap_drv.h index b103d28..9dc72d1 100644 --- a/drivers/staging/omapdrm/omap_drv.h +++ b/drivers/staging/omapdrm/omap_drv.h @@ -62,6 +62,7 @@ struct omap_drm_private { /* properties: */ struct drm_property *rotation_prop; + struct drm_property *zorder_prop; }; /* this should probably be in drm-core to standardize amongst drivers */ diff --git a/drivers/staging/omapdrm/omap_plane.c b/drivers/staging/omapdrm/omap_plane.c index 6931d06..4bde639 100644 --- a/drivers/staging/omapdrm/omap_plane.c +++ b/drivers/staging/omapdrm/omap_plane.c @@ -433,6 +433,15 @@ void omap_plane_install_properties(struct drm_plane *plane, priv->rotation_prop = prop; } drm_object_attach_property(obj, prop, 0); + + prop = priv->zorder_prop; + if (!prop) { + prop = drm_property_create_range(dev, 0, "zorder", 0, 3); + if (prop == NULL) + return; + priv->zorder_prop = prop; + } + drm_object_attach_property(obj, prop, 0); } int omap_plane_set_property(struct drm_plane *plane, @@ -452,6 +461,16 @@ int omap_plane_set_property(struct drm_plane *plane, ret = omap_plane_dpms(plane, DRM_MODE_DPMS_ON); else ret = 0; + } else if (property == priv->zorder_prop) { + struct omap_overlay *ovl = omap_plane->ovl; + + DBG("%s: zorder: %d", ovl->name, (uint32_t)val); + omap_plane->info.zorder = val; + + if (ovl->is_enabled(ovl)) + ret = omap_plane_dpms(plane, DRM_MODE_DPMS_ON); + else + ret = 0; } return ret;