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: 1327961 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 9E606DFFF9 for ; Wed, 15 Aug 2012 20:18:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755373Ab2HOUSp (ORCPT ); Wed, 15 Aug 2012 16:18:45 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:35087 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755528Ab2HOUSn (ORCPT ); Wed, 15 Aug 2012 16:18:43 -0400 Received: by mail-ob0-f174.google.com with SMTP id uo13so2563161obb.19 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 Cc: patches@linaro.org, Greg KH , Tomi Valkeinen , Andy Gross , Andre Renaud , Rob Clark 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> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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;