From patchwork Fri Mar 30 01:02:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 7524 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A969623E00 for ; Fri, 30 Mar 2012 01:02:57 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 6ED5BA186BA for ; Fri, 30 Mar 2012 01:02:57 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so301148iag.11 for ; Thu, 29 Mar 2012 18:02:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-forwarded-to:x-forwarded-for:delivered-to :received-spf:dkim-signature:sender:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references:x-gm-message-state; bh=V8Da2V3Lc4NqRTbBitavSmin2CpWOxzc+2uWPZL+Fok=; b=C4Tf7IBNBY2ylPUa9DLeJxukCQonuCiaRTKN+bpvpGjDsJaJtqJkG8xLSuCVOssDpW dGHCdBvPnS0L5UHBbyn7dC9HbiswnDZz/6ivva4J8VQT7OtEG01zNY+RJIVvkPONzR95 ZHj9N758QskTTuet0dOX3NnHxOdw26nnIXfIxhNxsPvnycX2KBMHH1bWUpKgRN4a5aEd +jJo/8trACjNfecaajwgSIhl4CCreJv+aL+y9aMBVuzVLsF5eNyy0W9ejQZ8DkPnkZm4 CZPUGqngRy6BRRxA0K4vn8t1gM+QRYtT52Ipik8Z8P2HVsg3sjnFqGzM8qvp8Ek+n68Q JdcQ== MIME-Version: 1.0 Received: by 10.50.186.161 with SMTP id fl1mr51817igc.44.1333069377211; Thu, 29 Mar 2012 18:02:57 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.5.205 with SMTP id 13csp1657ibw; Thu, 29 Mar 2012 18:02:56 -0700 (PDT) Received: by 10.182.52.104 with SMTP id s8mr216231obo.59.1333069376683; Thu, 29 Mar 2012 18:02:56 -0700 (PDT) Received: from mail-ob0-f178.google.com (mail-ob0-f178.google.com [209.85.214.178]) by mx.google.com with ESMTPS id v6si5050200obc.103.2012.03.29.18.02.56 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 29 Mar 2012 18:02:56 -0700 (PDT) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.214.178 as permitted sender) client-ip=209.85.214.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.214.178 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-ob0-f178.google.com with SMTP id tb18so258501obb.37 for ; Thu, 29 Mar 2012 18:02:56 -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=V8Da2V3Lc4NqRTbBitavSmin2CpWOxzc+2uWPZL+Fok=; b=D1u3WJ6ibFm+0EXTiy6Iir47J3v6CPY32GuE71d3VASsZbMu6qsXvllpXCiwYL22H0 jvv43BzKgqlEKiWM8hGtPppeqvFnwW6LYQhE55GueOtDq3EYWmWjtoEGqG0CWZGoYe/X EBwUt/BD9QruAbC5io2tqzBP8DhSQ1Etk1lwpIqwegZ1qvXBhiDJtoWnGb9K94wbaipt LLcwnoVhLZVa4rjX1GPdiCXj9MGXvPmijxGN/RaTbPxfXwjU882GVOC2j/YB6OdU1soE LOm66SgtFB81tdIO1FF6Flk1CGlDRk06f2NoHVPqMX604CsWu7y18RCQeRoUdKyc5JW6 Dwmw== Received: by 10.60.14.226 with SMTP id s2mr306108oec.29.1333069376554; Thu, 29 Mar 2012 18:02:56 -0700 (PDT) Received: from localhost (ppp-70-129-134-19.dsl.rcsntx.swbell.net. [70.129.134.19]) by mx.google.com with ESMTPS id g2sm7780435obw.10.2012.03.29.18.02.55 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 29 Mar 2012 18:02:56 -0700 (PDT) Sender: Rob Clark From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: patches@linaro.org, Rob Clark Subject: [PATCH RFC 2/2] drm: add plane properties Date: Thu, 29 Mar 2012 20:02:46 -0500 Message-Id: <1333069366-2774-2-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1333069366-2774-1-git-send-email-rob.clark@linaro.org> References: <1333069366-2774-1-git-send-email-rob.clark@linaro.org> X-Gm-Message-State: ALoCoQkABly7GJnUThnr1JgnkExJFHj6I7fSO/lkDkCGyvBp1grAabTJLATstS2m1Hoe8l26T3J0 From: Rob Clark The omapdrm driver uses this for setting per-overlay rotation. It is likely also useful for setting YUV->RGB colorspace conversion matrix, etc. --- drivers/gpu/drm/drm_crtc.c | 19 +++++++++++++++++++ include/drm/drm_crtc.h | 5 +++++ 2 files changed, 24 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 2b462f6..b158b72 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -606,6 +606,7 @@ int drm_plane_init(struct drm_device *dev, struct drm_plane *plane, if (ret) goto out; + plane->base.properties = &plane->properties; plane->dev = dev; plane->funcs = funcs; plane->format_types = kmalloc(sizeof(uint32_t) * format_count, @@ -3163,6 +3164,21 @@ static int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj, return ret; } +static int drm_mode_plane_set_obj_prop(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t value) +{ + int ret = -EINVAL; + struct drm_plane *plane = obj_to_plane(obj); + + if (plane->funcs->set_property) + ret = plane->funcs->set_property(plane, property, value); + if (!ret) + drm_object_property_set_value(obj, property, value); + + return ret; +} + int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { @@ -3268,6 +3284,9 @@ int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data, case DRM_MODE_OBJECT_CRTC: ret = drm_mode_crtc_set_obj_prop(arg_obj, property, arg->value); break; + case DRM_MODE_OBJECT_PLANE: + ret = drm_mode_plane_set_obj_prop(arg_obj, property, arg->value); + break; } out: diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 28e9a78..b5017c9 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -618,6 +618,9 @@ struct drm_plane_funcs { uint32_t src_w, uint32_t src_h); int (*disable_plane)(struct drm_plane *plane); void (*destroy)(struct drm_plane *plane); + + int (*set_property)(struct drm_plane *plane, + struct drm_property *property, uint64_t val); }; /** @@ -657,6 +660,8 @@ struct drm_plane { const struct drm_plane_funcs *funcs; void *helper_private; + + struct drm_object_properties properties; }; /**