From patchwork Wed Dec 5 16:29:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10714579 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 72B9C13AF for ; Wed, 5 Dec 2018 16:30:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F70E2DCB5 for ; Wed, 5 Dec 2018 16:30:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51E472DC42; Wed, 5 Dec 2018 16:30:19 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91B042D024 for ; Wed, 5 Dec 2018 16:30:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726918AbeLEQaS (ORCPT ); Wed, 5 Dec 2018 11:30:18 -0500 Received: from mail-yw1-f67.google.com ([209.85.161.67]:40847 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727429AbeLEQaR (ORCPT ); Wed, 5 Dec 2018 11:30:17 -0500 Received: by mail-yw1-f67.google.com with SMTP id r130so8770918ywg.7 for ; Wed, 05 Dec 2018 08:30:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ngd2Aw/DW8VqdrZtDdTzB+U6Pf80gAkmc9rvJ2vnxo8=; b=egVH74RhhXbmixxLAHggGTDHVhm1VOE8Mmq5YZkZeW1i+TC63jNmIdj+NYMVP79qaY 4cdnLQG7IFP4WuPZDUUY4tpiFbTLz6vuyiieZY1qJ5JeCS2iF4ufSViWGM0z4nyfTtZf eTF22dH9G6tCm4mVRWj8xj1Q0J09L5XCbVpspvz9pwbEVlTWobl1D8BVXE/YVSIuuMkv KGC0lBtAOdfFafaVN13pifs2OCzCE4GVTudNtKidF5v9oBj+PUgu2F3QMDwVbJNBWR4w Otnm8STN6Chpe596VI+yPguZGaeED/o1/wbb+Bs23wTsTtvnyBHNV97I1Ju1D13h3aEO BimA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ngd2Aw/DW8VqdrZtDdTzB+U6Pf80gAkmc9rvJ2vnxo8=; b=XylCYMVqTFvkLa3hQIA+tm62pH1Vmp8D0hyPnKFtr7iJXcd8v3nLHOHyFkW+G2Lsa5 gZ6YPcvslbHjejW7OmcgL4+fkL0kyJuzgTWeXO52Hn+gitXEzUtj+wkMLZEgf2jzoNBY DwyGjV8e5I7eOiXa5Bcpn4k01muhsoW+NBMX35fXO0/VaXB92P1j2rJb99NtoZ6SOEXv WW6EVkPkKa/Ay+5hYfW1NsnNvoqxwANzxItsTujf6lxPt+bSxGyORUqCtKPHQiu0KlW7 CsytWVUQN8+KoDg81OldQ9COctApnXdQmbF/dUJitz8XYJ9gzCwoQSHqX4HUq3uzQV1h zdow== X-Gm-Message-State: AA+aEWakz8THco4Z0vbzvFLNFBlcXlUUoWsNsXvC9JnMQphPLYJXbFv6 MZPuuuRX2EDDINNx1Nyf5uW7A32r4Rc= X-Google-Smtp-Source: AFSGD/WIX8FCqz4FVWTStbtU/dFEvqvGAHDUzriYkEaOFZ/ghJxwW8jO9pqsaKjirTbHGSsdOXqqdA== X-Received: by 2002:a81:af27:: with SMTP id n39mr24976207ywh.452.1544027415700; Wed, 05 Dec 2018 08:30:15 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id n133sm6460470ywb.55.2018.12.05.08.30.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 08:30:15 -0800 (PST) From: Sean Paul Cc: robdclark@gmail.com, jsanka@codeaurora.org, Sean Paul , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 9/9] drm/msm: mdp5: Remove custom property code in plane Date: Wed, 5 Dec 2018 11:29:41 -0500 Message-Id: <20181205162958.25025-9-sean@poorly.run> X-Mailer: git-send-email 2.20.0.rc1.387.gf8505762e3-goog In-Reply-To: <20181205162958.25025-1-sean@poorly.run> References: <20181205162958.25025-1-sean@poorly.run> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul mdp5 only exposes one custom property, and it's zpos. Fortunately, we have a standard zpos property now, we can remove the hand-rolled property code entirely from mdp5 and rely on core. Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h | 3 - drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 101 +-------------------- drivers/gpu/drm/msm/msm_drv.h | 8 -- 4 files changed, 3 insertions(+), 111 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c index bfa97ec063965..4ccef117ced90 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c @@ -551,7 +551,7 @@ static int pstate_cmp(const void *a, const void *b) { struct plane_state *pa = (struct plane_state *)a; struct plane_state *pb = (struct plane_state *)b; - return pa->state->zpos - pb->state->zpos; + return pa->state->base.normalized_zpos - pb->state->base.normalized_zpos; } /* is there a helper for this? */ diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h index 8605a7dee44c1..44d03fc31e323 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h @@ -107,9 +107,6 @@ struct mdp5_plane_state { struct mdp5_hw_pipe *hwpipe; struct mdp5_hw_pipe *r_hwpipe; /* right hwpipe */ - /* aligned with property */ - uint8_t zpos; - /* assigned by crtc blender */ enum mdp_mixer_stage_id stage; }; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index 41590588a6f39..da999d236dff2 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -56,103 +56,13 @@ static void mdp5_plane_destroy(struct drm_plane *plane) static void mdp5_plane_install_properties(struct drm_plane *plane, struct drm_mode_object *obj) { - struct drm_device *dev = plane->dev; - struct msm_drm_private *dev_priv = dev->dev_private; - struct drm_property *prop; - -#define INSTALL_PROPERTY(name, NAME, init_val, fnc, ...) do { \ - prop = dev_priv->plane_property[PLANE_PROP_##NAME]; \ - if (!prop) { \ - prop = drm_property_##fnc(dev, 0, #name, \ - ##__VA_ARGS__); \ - if (!prop) { \ - dev_warn(dev->dev, \ - "Create property %s failed\n", \ - #name); \ - return; \ - } \ - dev_priv->plane_property[PLANE_PROP_##NAME] = prop; \ - } \ - drm_object_attach_property(&plane->base, prop, init_val); \ - } while (0) - -#define INSTALL_RANGE_PROPERTY(name, NAME, min, max, init_val) \ - INSTALL_PROPERTY(name, NAME, init_val, \ - create_range, min, max) - -#define INSTALL_ENUM_PROPERTY(name, NAME, init_val) \ - INSTALL_PROPERTY(name, NAME, init_val, \ - create_enum, name##_prop_enum_list, \ - ARRAY_SIZE(name##_prop_enum_list)) - - INSTALL_RANGE_PROPERTY(zpos, ZPOS, 1, 255, 1); - + drm_plane_create_zpos_property(plane, 1, 1, 255); drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0, DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180 | DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y); - -#undef INSTALL_RANGE_PROPERTY -#undef INSTALL_ENUM_PROPERTY -#undef INSTALL_PROPERTY -} - -static int mdp5_plane_atomic_set_property(struct drm_plane *plane, - struct drm_plane_state *state, struct drm_property *property, - uint64_t val) -{ - struct drm_device *dev = plane->dev; - struct mdp5_plane_state *pstate; - struct msm_drm_private *dev_priv = dev->dev_private; - int ret = 0; - - pstate = to_mdp5_plane_state(state); - -#define SET_PROPERTY(name, NAME, type) do { \ - if (dev_priv->plane_property[PLANE_PROP_##NAME] == property) { \ - pstate->name = (type)val; \ - DBG("Set property %s %d", #name, (type)val); \ - goto done; \ - } \ - } while (0) - - SET_PROPERTY(zpos, ZPOS, uint8_t); - - DRM_DEV_ERROR(dev->dev, "Invalid property\n"); - ret = -EINVAL; -done: - return ret; -#undef SET_PROPERTY -} - -static int mdp5_plane_atomic_get_property(struct drm_plane *plane, - const struct drm_plane_state *state, - struct drm_property *property, uint64_t *val) -{ - struct drm_device *dev = plane->dev; - struct mdp5_plane_state *pstate; - struct msm_drm_private *dev_priv = dev->dev_private; - int ret = 0; - - pstate = to_mdp5_plane_state(state); - -#define GET_PROPERTY(name, NAME, type) do { \ - if (dev_priv->plane_property[PLANE_PROP_##NAME] == property) { \ - *val = pstate->name; \ - DBG("Get property %s %lld", #name, *val); \ - goto done; \ - } \ - } while (0) - - GET_PROPERTY(zpos, ZPOS, uint8_t); - - DRM_DEV_ERROR(dev->dev, "Invalid property\n"); - ret = -EINVAL; -done: - return ret; -#undef SET_PROPERTY } static void @@ -168,7 +78,7 @@ mdp5_plane_atomic_print_state(struct drm_printer *p, drm_printf(p, "\tright-hwpipe=%s\n", pstate->r_hwpipe ? pstate->r_hwpipe->name : "(null)"); - drm_printf(p, "\tzpos=%u\n", pstate->zpos); + drm_printf(p, "\tzpos=%u\n", pstate->base.normalized_zpos); drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage)); } @@ -182,11 +92,6 @@ static void mdp5_plane_reset(struct drm_plane *plane) kfree(to_mdp5_plane_state(plane->state)); mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL); - if (plane->type == DRM_PLANE_TYPE_PRIMARY) - mdp5_state->zpos = STAGE_BASE; - else - mdp5_state->zpos = STAGE0 + drm_plane_index(plane); - mdp5_state->base.plane = plane; plane->state = &mdp5_state->base; @@ -225,8 +130,6 @@ static const struct drm_plane_funcs mdp5_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, .destroy = mdp5_plane_destroy, - .atomic_set_property = mdp5_plane_atomic_set_property, - .atomic_get_property = mdp5_plane_atomic_get_property, .reset = mdp5_plane_reset, .atomic_duplicate_state = mdp5_plane_duplicate_state, .atomic_destroy_state = mdp5_plane_destroy_state, diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index a578bad540130..60a7da09cf3b3 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -70,11 +70,6 @@ struct msm_file_private { int queueid; }; -enum msm_mdp_plane_property { - PLANE_PROP_ZPOS, - PLANE_PROP_MAX_NUM -}; - struct msm_vblank_ctrl { struct kthread_work work; struct list_head event_list; @@ -192,9 +187,6 @@ struct msm_drm_private { struct msm_drm_thread disp_thread[MAX_CRTCS]; struct msm_drm_thread event_thread[MAX_CRTCS]; - /* Properties */ - struct drm_property *plane_property[PLANE_PROP_MAX_NUM]; - /* VRAM carveout, used when no IOMMU: */ struct { unsigned long size;