From patchwork Wed May 16 08:58:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 8672 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 EFCA923E1B for ; Wed, 16 May 2012 08:59:24 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id B0750A18A5B for ; Wed, 16 May 2012 08:59:24 +0000 (UTC) Received: by mail-yx0-f180.google.com with SMTP id q6so519087yen.11 for ; Wed, 16 May 2012 01:59:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=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=F07/RLJtlW32uCyq8mNVSpYdgltzG47DzAXPI0YIGAY=; b=oPvJxYSKqohrl3AvVW6t5vwMc2kjf0zkPBB+//RvaBrOsLNRVeTKDNid0CGNz81e+U LcV91WDtFQyrHqAd4O8jahXRbbYIg7gRJPpGV6IIiwTxszi4J0YmnA6XwtzQL9Wg6qgj Bdlu8mp4En6Rrq7Ftg+cDD/+/cH2mdpV58yQ2nl0UVKLL3plh8pM/lI4O1dlxhi8Kgw+ wu1QnNvDsN9HXsTEqCo9z8Ax3meOJwx8h5DC5P5rPCK+ummFdNbt0AmkOXRFC8wv4mEZ LnW+hn1CuMpgAombFA1c+wZuAL1aRd6kBKJc0x5D0pAxs+sYMHc8OpzSSrZ6FQns1iL+ yoiA== Received: by 10.50.195.234 with SMTP id ih10mr1397803igc.0.1337158764146; Wed, 16 May 2012 01:59:24 -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.35.72 with SMTP id o8csp478584ibd; Wed, 16 May 2012 01:59:23 -0700 (PDT) Received: by 10.60.14.9 with SMTP id l9mr2076301oec.17.1337158763562; Wed, 16 May 2012 01:59:23 -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 k10si704317oeb.57.2012.05.16.01.59.23 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 May 2012 01:59:23 -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 eq6so1104943obc.37 for ; Wed, 16 May 2012 01:59:23 -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=F07/RLJtlW32uCyq8mNVSpYdgltzG47DzAXPI0YIGAY=; b=EDIpRacS1JRmMOUKf6Ri4a5H265wxp4sWnCY/3KXePwMWvndEpqVfS0K9AXYp1Xoy0 hm0v9nPtn9Cw3L9xtckdCj/NzYXhoLYFPWq0tnsM8Br8ss203POCyOykzhJY5q/qAXGE 6M5Xk7mBczoJwK99HWFXly4OgH0hOQ/0MDcFS+u/yWyvj8wdqweKSGMjvlIjxJebHLXo TWRjdq2fnX+PtkYnHdfl+8rJxhN88LsS2g7/TZn+xuCvNrWyx6LHYS1JaJZLW8Fnp3YZ Wc+MvA2vaYC4lBbc4t1Pa4Lvk3+oPb1aLlLbXsQNTox3H/zepTVSbiEmdusSZtTUnvbW zyAQ== Received: by 10.182.5.164 with SMTP id t4mr2207994obt.1.1337158763413; Wed, 16 May 2012 01:59:23 -0700 (PDT) Received: from localhost (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id r4sm1789014obz.9.2012.05.16.01.59.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 May 2012 01:59:23 -0700 (PDT) Sender: Rob Clark From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: patches@linaro.org, Paulo Zanoni , Rob Clark Subject: [PATCH 2/2] drm: add plane properties Date: Wed, 16 May 2012 02:58:58 -0600 Message-Id: <1337158738-31685-3-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1337158738-31685-1-git-send-email-rob.clark@linaro.org> References: <1337158738-31685-1-git-send-email-rob.clark@linaro.org> X-Gm-Message-State: ALoCoQkA7WJux/zjAHWua9+FlMh0HSnQcxrb7WwXyfAtUxkRk1xPHVuxAL9TBBrby1bbzAcolyjk 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. Signed-off-by: Rob Clark Reviewed-by: Paulo Zanoni --- drivers/gpu/drm/drm_crtc.c | 19 +++++++++++++++++++ include/drm/drm_crtc.h | 5 +++++ 2 files changed, 24 insertions(+) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 022873e..a9b2b497 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, @@ -3155,6 +3156,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) { @@ -3256,6 +3272,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 39e3e1c..c23789c 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; }; /**