aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_atomic_state_helper.c
AgeCommit message (Collapse)AuthorFilesLines
2023-12-13drm/drm_plane: track color mgmt changes per planeMelissa Wen1-0/+1
We will add color mgmt properties to DRM planes in the next patches and we want to track when one of this properties change to define atomic commit behaviors. Using a similar approach from CRTC color props, we set a color_mgmt_changed boolean whenever a plane color prop changes. Reviewed-by: Harry Wentland <[email protected]> Signed-off-by: Melissa Wen <[email protected]> Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-12-04Revert "drm: Introduce pixel_source DRM plane property"Dmitry Baryshkov1-1/+0
This reverts commit e50e5fed41c7eed2db4119645bf3480ec43fec11. Although the Solid Fill planes patchset got all reviews and acknowledgements, it doesn't fulfill requirements for the new uABI. It has neither corresponding open-source userspace implementation nor the IGT tests coverage. Reverting this patchset until userspace obligations are fulfilled. Acked-by: Simon Ser <[email protected]> Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-12-04Revert "drm: Introduce solid fill DRM plane property"Dmitry Baryshkov1-9/+0
This reverts commit 85863a4e16e77079ee14865905ddc3ef9483a640. Although the Solid Fill planes patchset got all reviews and acknowledgements, it doesn't fulfill requirements for the new uABI. It has neither corresponding open-source userspace implementation nor the IGT tests coverage. Reverting this patchset until userspace obligations are fulfilled. Acked-by: Simon Ser <[email protected]> Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-12-02drm: Introduce solid fill DRM plane propertyJessica Zhang1-0/+9
Document and add support for solid_fill property to drm_plane. In addition, add support for setting and getting the values for solid_fill. To enable solid fill planes, userspace must assign a property blob to the "solid_fill" plane property containing the following information: struct drm_mode_solid_fill { u32 r, g, b, pad; }; Acked-by: Harry Wentland <[email protected]> Acked-by: Sebastian Wick <[email protected]> Signed-off-by: Jessica Zhang <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-12-02drm: Introduce pixel_source DRM plane propertyJessica Zhang1-0/+1
Add support for pixel_source property to drm_plane and related documentation. In addition, force pixel_source to DRM_PLANE_PIXEL_SOURCE_FB in DRM_IOCTL_MODE_SETPLANE as to not break legacy userspace. This enum property will allow user to specify a pixel source for the plane. Possible pixel sources will be defined in the drm_plane_pixel_source enum. Currently, the only pixel sources are DRM_PLANE_PIXEL_SOURCE_FB (the default value) and DRM_PLANE_PIXEL_SOURCE_NONE. Acked-by: Dmitry Baryshkov <[email protected]> Acked-by: Pekka Paalanen <[email protected]> Acked-by: Harry Wentland <[email protected]> Acked-by: Sebastian Wick <[email protected]> Acked-by: Simon Ser <[email protected]> Signed-off-by: Jessica Zhang <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-11-24drm/atomic: Add support for mouse hotspotsZack Rusin1-0/+14
Atomic modesetting code lacked support for specifying mouse cursor hotspots. The legacy kms DRM_IOCTL_MODE_CURSOR2 had support for setting the hotspot but the functionality was not implemented in the new atomic paths. Due to the lack of hotspots in the atomic paths userspace compositors completely disable atomic modesetting for drivers that require it (i.e. all paravirtualized drivers). This change adds hotspot properties to the atomic codepaths throughtout the DRM core and will allow enabling atomic modesetting for virtualized drivers in the userspace. Signed-off-by: Zack Rusin <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-01-19drm/atomic-helper: fix kernel-doc problemsRandy Dunlap1-3/+3
Fix a kernel-doc warning and other kernel-doc formatting for drm_atomic_helper_connect_tv_check(). drivers/gpu/drm/drm_atomic_state_helper.c:560: warning: Cannot understand * @drm_atomic_helper_connector_tv_check: Validate an analog TV connector state on line 560 - I thought it was a doc line Fixes: 5a28cefda3a9 ("drm/atomic-helper: Add an analog TV atomic_check implementation") Signed-off-by: Randy Dunlap <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Maarten Lankhorst <[email protected]> CC: Thomas Zimmermann <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: [email protected] Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-11-24drm/atomic-helper: Add an analog TV atomic_check implementationMaxime Ripard1-0/+49
The analog TV connector drivers share some atomic_check logic, and the new TV standard property have created some boilerplate that can be shared across drivers too. Let's create an atomic_check helper for those use cases. Reviewed-by: Noralf Trønnes <[email protected]> Tested-by: Mateusz Kwiatkowski <[email protected]> Acked-in-principle-or-something-like-that-by: Daniel Vetter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2022-11-24drm/atomic-helper: Add a TV properties reset helperMaxime Ripard1-0/+75
The drm_tv_create_properties() function will create a bunch of properties, but it's up to each and every driver using that function to properly reset the state of these properties leading to inconsistent behaviours. Let's create a helper that will take care of it. Reviewed-by: Noralf Trønnes <[email protected]> Tested-by: Mateusz Kwiatkowski <[email protected]> Acked-in-principle-or-something-like-that-by: Daniel Vetter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2022-10-10drm/atomic-helper: Rename drm_atomic_helper_connector_tv_reset to avoid ↵Maxime Ripard1-3/+3
ambiguity We currently have two sets of TV properties. The first one is there to deal with analog TV properties, creating properties such as the TV mode, subconnectors, saturation, hue and so on. It's created by calling the drm_mode_create_tv_properties() function. The second one is there to deal with properties that might be useful on a TV, creating the overscan margins for example. It's created by calling the drm_mode_create_tv_margin_properties(). However, we also have a drm_atomic_helper_connector_tv_reset() function that will reset the TV margin properties to their default values, and thus is supposed to be called for the latter set. This creates an ambiguity due to the inconsistent naming. We can thus rename the drm_atomic_helper_connector_tv_reset() function to drm_atomic_helper_connector_tv_margins_reset() to remove that ambiguity and hopefully make it more obvious. Acked-by: Thomas Zimmermann <[email protected]> Reviewed-by: Noralf Trønnes <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2022-06-20drm: Drop drm_blend.h from drm_crtc.hVille Syrjälä1-0/+1
drm_crtc.h has no need for drm_blend.h, so don't include it. Avoids useless rebuilds of the entire universe when touching drm_blend.h. Quite a few placs do currently depend on drm_blend.h without actually including it directly. All of those need to be fixed up. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Acked-by: Sam Ravnborg <[email protected]> Acked-by: Jani Nikula <[email protected]>
2022-06-20drm: Drop drm_framebuffer.h from drm_crtc.hVille Syrjälä1-0/+1
drm_crtc.h has no need for drm_frambuffer.h, so don't include it. Avoids useless rebuilds of the entire universe when touching drm_framebuffer.h. Quite a few placs do currently depend on drm_framebuffer.h without actually including it directly. All of those need to be fixed up. v2: Fix up msm some more v2: Deal with ingenic and shmobile as well Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Acked-by: Sam Ravnborg <[email protected]> Acked-by: Jani Nikula <[email protected]>
2022-02-25drm/object: Add default color encoding and range value at resetDave Stevenson1-0/+14
The drm_plane_create_color_properties() function asks for an initial value for the color encoding and range, and will set the associated plane state variable with that value if a state is present. However, that function is usually called at a time where there's no state yet. Since the drm_plane_state reset helper doesn't take care of reading that value when it's called, it means that in most cases the initial value will be 0 (so DRM_COLOR_YCBCR_BT601 and DRM_COLOR_YCBCR_LIMITED_RANGE, respectively), or the drivers will have to work around it. Let's add some code in __drm_atomic_helper_plane_state_reset() to get the initial encoding and range value if the property has been attached in order to fix this. Reviewed-by: Harry Wentland <[email protected]> Signed-off-by: Dave Stevenson <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-02-25drm/object: Add default zpos value at resetDave Stevenson1-0/+11
The drm_plane_create_zpos_property() function asks for an initial value, and will set the associated plane state variable with that value if a state is present. However, that function is usually called at a time where there's no state yet. Since the drm_plane_state reset helper doesn't take care of reading that value when it's called, it means that in most cases the initial value will be 0, or the drivers will have to work around it. Let's add some code in __drm_atomic_helper_plane_state_reset() to get the initial zpos value if the property has been attached in order to fix this. Reviewed-by: Harry Wentland <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Dave Stevenson <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-16drm: fix some kernel-doc markupsMauro Carvalho Chehab1-1/+1
Some identifiers have different names between their prototypes and the kernel-doc markup. Others need to be fixed, as kernel-doc markups should use this format: identifier - description Signed-off-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Jani Nikula <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/12d4ca26f6843618200529ce5445063734d38c04.1605521731.git.mchehab+huawei@kernel.org
2020-07-02drm/atomic-helper: reset vblank on crtc resetDaniel Vetter1-0/+4
Only when vblanks are supported ofc. Some drivers do this already, but most unfortunately missed it. This opens up bugs after driver load, before the crtc is enabled for the first time. syzbot spotted this when loading vkms as a secondary output. Given how many drivers are buggy it's best to solve this once and for all in shared helper code. Aside from moving the few existing calls to drm_crtc_vblank_reset into helpers (i915 doesn't use helpers, so keeps its own) I think the regression risk is minimal: atomic helpers already rely on drivers calling drm_crtc_vblank_on/off correctly in their hooks when they support vblanks. And driver that's failing to handle vblanks after this is missing those calls already, and vblanks could only work by accident when enabling a CRTC for the first time right after boot. Big thanks to Tetsuo for helping track down what's going wrong here. There's only a few drivers which already had the necessary call and needed some updating: - komeda, atmel and tidss also needed to be changed to call __drm_atomic_helper_crtc_reset() intead of open coding it - tegra and msm even had it in the same place already, just code motion, and malidp already uses __drm_atomic_helper_crtc_reset(). - Laurent noticed that rcar-du and omap open-code their crtc reset and hence would actually be broken by this patch now. So fix them up by reusing the helpers, which brings the drm_crtc_vblank_reset() back. Only call left is in i915, which doesn't use drm_mode_config_reset, but has its own fastboot infrastructure. So that's the only case where we actually want this in the driver still. I've also reviewed all other drivers which set up vblank support with drm_vblank_init. After the previous patch fixing mxsfb all atomic drivers do call drm_crtc_vblank_on/off as they should, the remaining drivers are either legacy kms or legacy dri1 drivers, so not affected by this change to atomic helpers. v2: Use the drm_dev_has_vblank() helper. v3: Laurent pointed out that omap and rcar-du used drm_crtc_vblank_off instead of drm_crtc_vblank_reset. Adjust them too. v4: Laurent noticed that rcar-du and omap open-code their crtc reset and hence would actually be broken by this patch now. So fix them up by reusing the helpers, which brings the drm_crtc_vblank_reset() back. v5: also mention rcar-du and ompadrm in the proper commit message above (Laurent). Reviewed-by: Laurent Pinchart <[email protected]> Acked-by: Maxime Ripard <[email protected]> Cc: Laurent Pinchart <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Acked-by: Liviu Dudau <[email protected]> Acked-by: Thierry Reding <[email protected]> Link: https://syzkaller.appspot.com/bug?id=0ba17d70d062b2595e1f061231474800f076c7cb Reported-by: Tetsuo Handa <[email protected]> Reported-by: [email protected] Cc: Tetsuo Handa <[email protected]> Cc: "James (Qian) Wang" <[email protected]> Cc: Liviu Dudau <[email protected]> Cc: Mihail Atanassov <[email protected]> Cc: Brian Starkey <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Boris Brezillon <[email protected]> Cc: Nicolas Ferre <[email protected]> Cc: Alexandre Belloni <[email protected]> Cc: Ludovic Desroches <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Jonathan Hunter <[email protected]> Cc: Jyri Sarha <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: Rob Clark <[email protected]> Cc: Sean Paul <[email protected]> Cc: Brian Masney <[email protected]> Cc: Emil Velikov <[email protected]> Cc: zhengbin <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: Kieran Bingham <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-02-15drm/atomic-helper: fix kerneldocDaniel Vetter1-1/+0
Just a tiny copypasta mistake. Fixes: 751465913f04 ("drm/bridge: Add a drm_bridge_state object") Cc: Boris Brezillon <[email protected]> Acked-by: Boris Brezillon <[email protected]> Cc: Neil Armstrong <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-01-31drm/bridge: Add a drm_bridge_state objectBoris Brezillon1-0/+103
One of the last remaining objects to not have its atomic state. This is being motivated by our attempt to support runtime bus-format negotiation between elements of the bridge chain. This patch just paves the road for such a feature by adding a new drm_bridge_state object inheriting from drm_private_obj so we can re-use some of the existing state initialization/tracking logic. v10: * Add changelog to the commit message v9: * Clarify the fact that the bridge->atomic_reset() and {connector,plane,crtc,...}->reset() semantics are different * Move the drm_atomic_private_obj_init() call back to drm_bridge_attach() * Check the presence of ->atomic_duplicate_state instead of ->atomic_reset in drm_atomic_add_encoder_bridges() * Fix copy&paste errors in the atomic bridge state helpers doc * Add A-b/R-b tags v8: * Move bridge state helpers out of the CONFIG_DEBUGFS section v7: * Move helpers, struct-defs, ... to atomic helper files to avoid the drm -> drm_kms_helper -> drm circular dep * Stop providing default implementation for atomic state reset, duplicate and destroy hooks (has to do with the helper/core split) * Drop all R-b/T-b as helpers have now be moved to other places v6: * Made helpers private, removed doc and moved them to satisfy dependencies * Renamed helpers to _default_ v5: * Re-introduced the helpers from v4 v4: * Fix the doc * Kill default helpers (inlined) * Fix drm_atomic_get_bridge_state() to check for an ERR_PTR() * Add Neil's R-b v3: * No changes v2: * Use drm_for_each_bridge_in_chain() * Rename helpers to be more consistent with the rest of the DRM API * Improve/fix the doc Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-12-18drm: Add __drm_atomic_helper_crtc_state_reset() & co.Ville Syrjälä1-13/+65
Annoyingly __drm_atomic_helper_crtc_reset() does two totally separate things: a) reset the state to defaults values b) assign the crtc->state pointer I just want a) without the b) so let's split out part a) into __drm_atomic_helper_crtc_state_reset(). And of course we'll do the same thing for planes and connectors. v2: Fix conn__state vs. conn_state typo (Lucas) Make code and kerneldoc match for __drm_atomic_helper_plane_state_reset() Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Lucas De Marchi <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Acked-by: Daniel Vetter <[email protected]>
2019-09-18drm/atomic: Rename crtc_state->pageflip_flags to async_flipDaniel Vetter1-1/+1
It's the only flag anyone actually cares about. Plus if we're unlucky, the atomic ioctl might need a different flag for async flips. So better to abstract this away from the uapi a bit. Reviewed-by: Maarten Lankhorst <[email protected]> Reviewed-by: Nicholas Kazlauskas <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Michel Dänzer <[email protected]> Cc: Alex Deucher <[email protected]> Cc: Adam Jackson <[email protected]> Cc: Sean Paul <[email protected]> Cc: David Airlie <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Nicholas Kazlauskas <[email protected]> Cc: Leo Li <[email protected]> Cc: Harry Wentland <[email protected]> Cc: David Francis <[email protected]> Cc: Mario Kleiner <[email protected]> Cc: Bhawanpreet Lakha <[email protected]> Cc: Ben Skeggs <[email protected]> Cc: "Christian König" <[email protected]> Cc: Ilia Mirkin <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-06-19drm/atomic: Add a function to reset connector TV propertiesMaxime Ripard1-0/+18
During the connector reset, if that connector has a TV property, it needs to be reset to the value provided on the command line. Provide a helper to do that. Reviewed-by: Noralf Trønnes <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/84a7b657f09303a2850e1cc79e68f623547f3fdd.1560783090.git-series.maxime.ripard@bootlin.com
2019-06-13drm: Add helpers to kick off self refresh mode in driversSean Paul1-0/+4
This patch adds a new drm helper library to help drivers implement self refresh. Drivers choosing to use it will register crtcs and will receive callbacks when it's time to enter or exit self refresh mode. In its current form, it has a timer which will trigger after a driver-specified amount of inactivity. When the timer triggers, the helpers will submit a new atomic commit to shut the refreshing pipe off. On the next atomic commit, the drm core will revert the self refresh state and bring everything back up to be actively driven. From the driver's perspective, this works like a regular disable/enable cycle. The driver need only check the 'self_refresh_active' state in crtc_state. It should initiate self refresh mode on the panel and enter an off or low-power state. Changes in v2: - s/psr/self_refresh/ (Daniel) - integrated the psr exit into the commit that wakes it up (Jose/Daniel) - made the psr state per-crtc (Jose/Daniel) Changes in v3: - Remove the self_refresh_(active|changed) from connector state (Daniel) - Simplify loop in drm_self_refresh_helper_alter_state (Daniel) - Improve self_refresh_aware comment (Daniel) - s/self_refresh_state/self_refresh_data/ (Daniel) Changes in v4: - Move docbook location below panel (Daniel) - Improve docbook with references and more detailed explanation (Daniel) - Instead of register/unregister, use init/cleanup (Daniel) Changes in v5: - Resolved conflict in drm_atomic_helper.c #include block - Resolved conflict in rst with HDCP helper docs Changes in v6: - Fix include ordering, clean up forward declarations (Sam) Link to v1: https://patchwork.freedesktop.org/patch/msgid/[email protected] Link to v2: https://patchwork.freedesktop.org/patch/msgid/[email protected] Link to v3: https://patchwork.freedesktop.org/patch/msgid/[email protected] Link to v4: https://patchwork.freedesktop.org/patch/msgid/[email protected] Link to v5: https://patchwork.freedesktop.org/patch/msgid/[email protected] Cc: Daniel Vetter <[email protected]> Cc: Jose Souza <[email protected]> Cc: Zain Wang <[email protected]> Cc: Tomasz Figa <[email protected]> Cc: Ville Syrjälä <[email protected]> Cc: Sam Ravnborg <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Sean Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-05-27drm: drop use of drmP.h in drm/*Sam Ravnborg1-3/+4
The use of the drmP.h header file is deprecated. Remove use from all files in drm/* so people do not look there and follow a bad example. Build tested allyesconfig,allmodconfig on x86, arm etc. Including alpha that is as always more challenging than the rest. Signed-off-by: Sam Ravnborg <[email protected]> Acked-by: Daniel Vetter <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Sean Paul <[email protected]> Cc: David Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-05-22drm: Add reference counting on HDR metadata blobJonas Karlman1-0/+5
This adds reference count for HDR metadata blob, handled as part of duplicate and destroy connector state functions. v2: Removed the hdr_metadata_changed initialization as the variable is dropped and not required. Signed-off-by: Jonas Karlman <[email protected]> Signed-off-by: Uma Shankar <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-04-24drm/docs: Fix typo in __drm_atomic_helper_connector_resetMaarten Lankhorst1-1/+1
Signed-off-by: Maarten Lankhorst <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-04-24drm/atomic: Create __drm_atomic_helper_crtc_reset() for subclassing crtc_state.Maarten Lankhorst1-6/+28
We already have __drm_atomic_helper_connector_reset() and __drm_atomic_helper_plane_reset(), extend this to crtc as well. This will allow us to set default values in the crtc_state, without having to do it in each driver separately. Of all drivers that need conversion, only nouveau is done in this commit, because it wrote its own __drm_atomic_helper_crtc_reset(), clashing with the drm core. Signed-off-by: Maarten Lankhorst <[email protected]> Cc: Ben Skeggs <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-03-18drm: writeback: Fix leak of writeback jobLaurent Pinchart1-0/+4
Writeback jobs are allocated when the WRITEBACK_FB_ID is set, and deleted when the jobs complete. This results in both a memory leak of the job and a leak of the framebuffer if the atomic commit returns before the job is queued for processing, for instance if the atomic check fails or if the commit runs in test-only mode. Fix this by implementing the drm_writeback_cleanup_job() function and calling it from __drm_atomic_helper_connector_destroy_state(). As writeback jobs are removed from the state when they're queued for processing, any job left in the state when the state gets destroyed needs to be cleaned up. The existing declaration of the drm_writeback_cleanup_job() function without an implementation hints that this problem was considered, but never addressed. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Brian Starkey <[email protected]> Acked-by: Liviu Dudau <[email protected]>
2018-12-24drm: Put damage blob when destroy plane stateDeepak Rawat1-0/+3
Somehow the code to put the damage blob on destroy plane state and set the blob to NULL when duplicate plane state was not merged. May be because the files are refactored since the patch was written. With this fix add those. Cc: Daniel Vetter <[email protected]> Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Fixes: d3b21767821e ("drm: Add a new plane property to send damage during plane update") Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-30drm: Fix up drm_atomic_state_helper.[hc] extractionDaniel Vetter1-157/+0
I've misplaced two functions by accident: - drm_atomic_helper_duplicate_state is really part of the resume/suspend/shutdown device-wide helpers. - drm_atomic_helper_legacy_gamma_set is part of the legacy ioctl compat helpers. Move them both back. Fixes: 9ef8a9dc4b21 ("drm: Extract drm_atomic_state_helper.[hc]") Cc: Ville Syrjälä <[email protected]> Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-10-05drm: Extract drm_atomic_state_helper.[hc]Daniel Vetter1-0/+601
We already have a separate overview doc for this, makes sense to untangle it from the overall atomic helpers. v2: Rebase v3: Rebase more. Acked-by: Ville Syrjälä <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]