From patchwork Tue Aug 30 05:00:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nabendu Maiti X-Patchwork-Id: 9304817 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0DC4F607F0 for ; Tue, 30 Aug 2016 04:49:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDF0928AB5 for ; Tue, 30 Aug 2016 04:49:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2F4428AC0; Tue, 30 Aug 2016 04:49:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 61AC928AB5 for ; Tue, 30 Aug 2016 04:49:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 178CE6E109; Tue, 30 Aug 2016 04:49:12 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 690A36E109 for ; Tue, 30 Aug 2016 04:49:10 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 29 Aug 2016 21:49:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.30,254,1470726000"; d="scan'208"; a="1043215636" Received: from dispdev.iind.intel.com ([10.223.25.80]) by orsmga002.jf.intel.com with ESMTP; 29 Aug 2016 21:49:09 -0700 From: Nabendu Maiti To: intel-gfx@lists.freedesktop.org Date: Tue, 30 Aug 2016 10:30:55 +0530 Message-Id: <1472533261-30306-2-git-send-email-nabendu.bikash.maiti@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472533261-30306-1-git-send-email-nabendu.bikash.maiti@intel.com> References: <1472533261-30306-1-git-send-email-nabendu.bikash.maiti@intel.com> Subject: [Intel-gfx] [PATCH 1/7] drm/i915: Add pipe scaler pipe source drm property X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Initialization of pipe source size property as intel drm property to drm level to dynamically change pipe source size. Signed-off-by: Nabendu Maiti --- drivers/gpu/drm/drm_atomic.c | 10 ++++++++++ drivers/gpu/drm/drm_crtc.c | 16 ++++++++++++++++ include/drm/drm_crtc.h | 7 +++++++ 3 files changed, 33 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 0b8f33d..066f010 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -493,6 +493,12 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc, &replaced); state->color_mgmt_changed |= replaced; return ret; + } else if (property == config->prop_pipe_src_w) { + state->src_w = val; + state->pipescaler_changed = true; + } else if (property == config->prop_pipe_src_h) { + state->src_h = val; + state->pipescaler_changed = true; } else if (crtc->funcs->atomic_set_property) return crtc->funcs->atomic_set_property(crtc, state, property, val); else @@ -535,6 +541,10 @@ drm_atomic_crtc_get_property(struct drm_crtc *crtc, *val = (state->ctm) ? state->ctm->base.id : 0; else if (property == config->gamma_lut_property) *val = (state->gamma_lut) ? state->gamma_lut->base.id : 0; + else if (property == config->prop_pipe_src_w) + *val = state->src_w; + else if (property == config->prop_pipe_src_h) + *val = state->src_h; else if (crtc->funcs->atomic_get_property) return crtc->funcs->atomic_get_property(crtc, state, property, val); else diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 9316a2b..6fd6dd8 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -377,6 +377,10 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc, if (drm_core_check_feature(dev, DRIVER_ATOMIC)) { drm_object_attach_property(&crtc->base, config->prop_active, 0); drm_object_attach_property(&crtc->base, config->prop_mode_id, 0); + drm_object_attach_property(&crtc->base, + config->prop_pipe_src_w, 0); + drm_object_attach_property(&crtc->base, + config->prop_pipe_src_h, 0); } return 0; @@ -943,6 +947,18 @@ static int drm_mode_create_standard_properties(struct drm_device *dev) return -ENOMEM; dev->mode_config.gamma_lut_size_property = prop; + prop = drm_property_create_range(dev, DRM_MODE_PROP_ATOMIC, + "PIPE_SRC_W", 0, INT_MAX); + if (!prop) + return -ENOMEM; + dev->mode_config.prop_pipe_src_w = prop; + + prop = drm_property_create_range(dev, DRM_MODE_PROP_ATOMIC, + "PIPE_SRC_H", 0, INT_MAX); + if (!prop) + return -ENOMEM; + dev->mode_config.prop_pipe_src_h = prop; + return 0; } diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index bb214a1..4d6b580 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -197,6 +197,9 @@ struct drm_crtc_state { struct drm_pending_vblank_event *event; struct drm_atomic_state *state; + + bool pipescaler_changed; + u32 src_w, src_h; }; /** @@ -1942,6 +1945,10 @@ struct drm_mode_config { */ struct drm_property *prop_mode_id; + /* pipe scaler properties */ + struct drm_property *prop_pipe_src_w; + struct drm_property *prop_pipe_src_h; + /** * @dvi_i_subconnector_property: Optional DVI-I property to * differentiate between analog or digital mode.