From patchwork Tue May 31 21:11:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9145671 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 9182460752 for ; Tue, 31 May 2016 21:11:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8400720410 for ; Tue, 31 May 2016 21:11:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7899E208C2; Tue, 31 May 2016 21:11:29 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EAAE20410 for ; Tue, 31 May 2016 21:11:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 495A96E767; Tue, 31 May 2016 21:11:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0AC4C6E764 for ; Tue, 31 May 2016 21:11:23 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id a136so995087wme.0 for ; Tue, 31 May 2016 14:11:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=3qzIV5iiS/xrM0aRfvQO1NxDamBjFPwiQuf0bUic+fk=; b=AKQQI+YekfaQnC3vfuDs/rYEqjcgpNcY8OLnJ2C/w3OiZCLZIy6/FYuOh3KbSkhRvy llIDlQmo0Ktv5nePGQJlztMIbkLnfktsShYDgT5nZjYTf+OYuxJBV+vgD7fW6w8ZE0Jg LoYzR8iBJD0Z4/A4Mmb/2Qg8WS86TuZGwY6kE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3qzIV5iiS/xrM0aRfvQO1NxDamBjFPwiQuf0bUic+fk=; b=F740ZCmMIJ4MCGnbYODeGzWlPTYhEvMHmDvjYnUqwYjQ7MXvl6F2FTMNPhd086riwl KaJ5Y0rTUbvBLUYu4yE7Qpcp1ealFV7XizN15g2OqGzhW00giG/SmNqfi3NAU1nZlxIZ 6Xc/Dj07Wr3cplPj2qo1vtoiJbFE+ox/q6xn8vip7Eyzc0n2RvvgcyiS4vQ+JPtgREal 9+jNwzMXmfruj0s8k7gKSiYYzHyGYXqhWgKK1CofCu/vSXFvNA5CJFzmO3jEHXukf4Un T5YMtbZ8d9wTU+pb32jjzGg191ky+1+fGVImaq4r1okQVLeZy9VbmXwmxRY3lBfbmHJF ey1w== X-Gm-Message-State: ALyK8tIbBiuj4MjmRXcm5R1eAHTLa9ujwtlExdBhYHeK1F0+i0JlESmAWyQOyJ2Mhbp57w== X-Received: by 10.194.165.226 with SMTP id zb2mr89269wjb.172.1464729081163; Tue, 31 May 2016 14:11:21 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:56b5:0:ac27:b86c:7764:9429]) by smtp.gmail.com with ESMTPSA id dj4sm19852905wjc.13.2016.05.31.14.11.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 May 2016 14:11:20 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 1/6] drm/doc: Update kerneldoc for drm_crtc.h Date: Tue, 31 May 2016 23:11:10 +0200 Message-Id: <1464729075-22243-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.8.1 Cc: Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Apparently not everyone has been super dutiful with updating this stuff. I still decided to leave out the documentation for all the *_property pointers we have in drm_mode_config. Signed-off-by: Daniel Vetter Acked-by: Jani Nikula --- include/drm/drm_crtc.h | 80 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 67 insertions(+), 13 deletions(-) diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index c0edd87fa0ee..aa3f7ea41b1b 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -315,6 +315,7 @@ struct drm_plane_helper_funcs; * update to ensure framebuffer cleanup isn't done too early * @adjusted_mode: for use by helpers and drivers to compute adjusted mode timings * @mode: current mode timings + * @mode_blob: &drm_property_blob for @mode * @degamma_lut: Lookup table for converting framebuffer pixel data * before apply the conversion matrix * @ctm: Transformation matrix @@ -709,6 +710,7 @@ struct drm_crtc_funcs { * @dev: parent DRM device * @port: OF node used by drm_of_find_possible_crtcs() * @head: list management + * @name: human readable name, can be set by the driver * @mutex: per-CRTC locking * @base: base KMS object for ID tracking etc. * @primary: primary plane for this CRTC @@ -736,12 +738,13 @@ struct drm_crtc { char *name; - /* - * crtc mutex + /** + * @mutex: * * This provides a read lock for the overall crtc state (mode, dpms * state, ...) and a write lock for everything which can be update - * without a full modeset (fb, cursor data, ...) + * without a full modeset (fb, cursor data, crtc properties ...). Full + * modeset also need to grab dev->mode_config.connection_mutex. */ struct drm_modeset_lock mutex; @@ -1149,6 +1152,7 @@ struct drm_encoder { * @head: list management * @base: base KMS object * @name: connector name + * @connector_id: compacted connector id useful indexing arrays * @connector_type: one of the %DRM_MODE_CONNECTOR_ types from drm_mode.h * @connector_type_id: index into connector type enum * @interlace_allowed: can this connector handle interlaced modes? @@ -1161,7 +1165,6 @@ struct drm_encoder { * @funcs: connector control functions * @edid_blob_ptr: DRM property containing EDID if present * @properties: property tracking for this connector - * @path_blob_ptr: DRM blob property data for the DP MST path property * @polled: a %DRM_CONNECTOR_POLL_ value for core driven polling * @dpms: current dpms state * @helper_private: mid-layer private data @@ -1224,8 +1227,23 @@ struct drm_connector { struct drm_property_blob *edid_blob_ptr; struct drm_object_properties properties; + /** + * @path_blob_ptr: + * + * DRM blob property data for the DP MST path property. + */ struct drm_property_blob *path_blob_ptr; + /** + * @tile_blob_ptr: + * + * DRM blob property data for the tile property (used mostly by DP MST). + * This is meant for screens which are driven through separate display + * pipelines represented by &drm_crtc, which might not be in running + * with genlocked clocks. For tiled panels which are genlocked, like + * dual-link LVDS or dual-link DSI, the driver should try to not expose + * the tiling and virtual both &drm_crtc and &drm_plane if needed. + */ struct drm_property_blob *tile_blob_ptr; uint8_t polled; /* DRM_CONNECTOR_POLL_* */ @@ -1287,6 +1305,7 @@ struct drm_connector { * plane (in 16.16) * @src_w: width of visible portion of plane (in 16.16) * @src_h: height of visible portion of plane (in 16.16) + * @rotation: rotation of the plane * @state: backpointer to global drm_atomic_state */ struct drm_plane_state { @@ -1527,6 +1546,7 @@ enum drm_plane_type { * struct drm_plane - central DRM plane control structure * @dev: DRM device this plane belongs to * @head: for list management + * @name: human readable name, can be set by the driver * @base: base mode object * @possible_crtcs: pipes this plane can be bound to * @format_types: array of formats supported by this plane @@ -1540,6 +1560,7 @@ enum drm_plane_type { * @properties: property tracking for this plane * @type: type of plane (overlay, primary, cursor) * @state: current atomic state for this plane + * @helper_private: mid-layer private data */ struct drm_plane { struct drm_device *dev; @@ -1547,6 +1568,13 @@ struct drm_plane { char *name; + /** + * @mutex: + * + * Protects modeset plane state, together with the mutex of &drm_crtc + * this plane is linked to (when active, getting actived or getting + * disabled). + */ struct drm_modeset_lock mutex; struct drm_mode_object base; @@ -1719,6 +1747,10 @@ struct drm_bridge { /** * struct drm_crtc_commit - track modeset commits on a CRTC + * + * This structure is used to track asynchronously running atomic commit + * operations. For an implementation of how to use this look at + * drm_atomic_helper_setup_commit() from the atomic helper library. */ struct drm_crtc_commit { /** @@ -1764,7 +1796,7 @@ struct drm_crtc_commit { struct completion hw_done; /** - * cleanup_done: + * @cleanup_done: * * Will be signalled after old buffers have been cleaned up again by * calling drm_atomic_helper_cleanup_planes(). Since this can only @@ -1813,7 +1845,6 @@ struct __drm_connnectors_state { * @legacy_set_config: Disable conflicting encoders instead of failing with -EINVAL. * @planes: pointer to array of structures with per-plane data * @crtcs: pointer to array of CRTC pointers - * @crtc_states: pointer to array of CRTC states pointers * @num_connector: size of the @connectors and @connector_states arrays * @connectors: pointer to array of structures with per-connector data * @acquire_ctx: acquire context for this atomic modeset state update @@ -2137,8 +2168,6 @@ struct drm_mode_config_funcs { * @connection_mutex: ww mutex protecting connector state and routing * @acquire_ctx: global implicit acquire context used by atomic drivers for * legacy IOCTLs - * @idr_mutex: mutex for KMS ID allocation and management - * @crtc_idr: main KMS ID tracking object * @fb_lock: mutex to protect fb state and lists * @num_fb: number of fbs available * @fb_list: list of framebuffers available @@ -2160,6 +2189,7 @@ struct drm_mode_config_funcs { * @fb_base: base address of the framebuffer * @poll_enabled: track polling support for this device * @poll_running: track polling status for this device + * @delayed_event: track delayed poll uevent deliver for this device * @output_poll_work: delayed work for polling in process context * @property_blob_list: list of all the blob property objects * @blob_lock: mutex for blob property allocation and management @@ -2188,10 +2218,30 @@ struct drm_mode_config { struct mutex mutex; /* protects configuration (mode lists etc.) */ struct drm_modeset_lock connection_mutex; /* protects connector->encoder and encoder->crtc links */ struct drm_modeset_acquire_ctx *acquire_ctx; /* for legacy _lock_all() / _unlock_all() */ - struct mutex idr_mutex; /* for IDR management */ - struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */ - struct idr tile_idr; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */ - /* this is limited to one for now */ + + /** + * @idr_mutex: + * + * Mutex for KMS ID allocation and management. Protects both @crtc_idr + * and @tile_idr. + */ + struct mutex idr_mutex; + + /** + * @crtc_idr: + * + * Main KMS ID tracking object. Use this idr for all IDs, fb, crtc, + * connector, modes - just makes life easier to have only one. + */ + struct idr crtc_idr; + + /** + * @tile_idr: + * + * Use this idr for allocating new IDs for tiled sinks like use in some + * high-res DP MST screens. + */ + struct idr tile_idr; struct mutex fb_lock; /* proctects global and per-file fb lists */ int num_fb; @@ -2293,7 +2343,11 @@ struct drm_mode_config { /* whether async page flip is supported or not */ bool async_page_flip; - /* whether the driver supports fb modifiers */ + /** + * @allow_fb_modifiers: + * + * Whether the driver supports fb modifiers in the ADDFB2.1 ioctl call. + */ bool allow_fb_modifiers; /* cursor size */