aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_connector.c
Commit message (Collapse)AuthorAgeFilesLines
* drm/atomic: Filter out redundant DPMS callsVille Syrjälä2025-03-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | Video players (eg. mpv) do periodic XResetScreenSaver() calls to keep the screen on while the video playing. The modesetting ddx plumbs these straight through into the kernel as DPMS setproperty ioctls, without any filtering whatsoever. When implemented via atomic these end up as empty commits on the crtc (which will nonetheless take one full frame), which leads to a dropped frame every time XResetScreenSaver() is called. Let's just filter out redundant DPMS property changes in the kernel to avoid this issue. v2: Explain the resulting commits a bit better (Sima) Document the behaviour in uapi docs (Sima) Cc: [email protected] Testcase: igt/kms_flip/flip-vs-dpms-on-nop Reviewed-by: Simona Vetter <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* Merge v6.13 into drm-nextSimona Vetter2025-01-231-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | A regression was caused by commit e4b5ccd392b9 ("drm/v3d: Ensure job pointer is set to NULL after job completion"), but this commit is not yet in next-fixes, fast-forward it. Note that this recreates Linus merge in 96c84703f1cf ("Merge tag 'drm-next-2025-01-17' of https://gitlab.freedesktop.org/drm/kernel") because I didn't want to backmerge a random point in the merge window. Signed-off-by: Simona Vetter <[email protected]>
| * drm/connector: hdmi: Validate supported_formats matches ycbcr_420_allowedCristian Ciocaltea2025-01-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Ensure HDMI connector initialization fails when the presence of HDMI_COLORSPACE_YUV420 in the given supported_formats bitmask doesn't match the value of drm_connector->ycbcr_420_allowed. Suggested-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Cristian Ciocaltea <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
* | drm/connector: implement generic HDMI audio helpersDmitry Baryshkov2025-01-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Several DRM drivers implement HDMI codec support (despite its name it applies to both HDMI and DisplayPort drivers). Implement generic framework to be used by these drivers. This removes a requirement to implement get_eld() callback and provides default implementation for codec's plug handling. Acked-by: Maxime Ripard <[email protected]> Tested-by: Dave Stevenson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
* | drm/connector: Warn if a connector is registered/added incorrectlyImre Deak2024-12-171-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All the drivers should be converted now to use drm_connector_dynamic_init() for MST connectors, hence drm_connector_dynamic_register()->drm_connector_add() can WARN now if this was not the case (for instance if a driver inited an MST connector with one of the drm_connector_init*() functions incorrectly). Reviewed-by: Lyude Paul <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Acked-by: Alex Deucher <[email protected]> Acked-by: Wayne Lin <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* | drm/connector: Add deprecation notes for drm_connector_register/unregisterImre Deak2024-12-171-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drivers should register/unregister only dynamic (MST) connectors manually using drm_connector_dynamic_register()/unregister(). Static connectors are registered/unregistered by the DRM core automatically. Some drivers still call drm_connector_register()/ unregister() for static connectors, both of which should be a nop for them and hence are scheduled to be removed. Update the function documentation for these functions accordingly. v2: s/deprication/deprecation in subject line. (Jani) Reviewed-by: Lyude Paul <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Acked-by: Alex Deucher <[email protected]> Acked-by: Wayne Lin <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* | drm/connector: Add a way to init/add a connector in separate stepsImre Deak2024-12-171-20/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Atm when the connector is added to the drm_mode_config::connector_list, the connector may not be fully initialized yet. This is not a problem for static connectors initialized/added during driver loading, for which the driver ensures that look-ups via the above list are not possible until all the connector and other required state is fully initialized already. It's also not a problem for user space looking up either a static or dynamic (see what this is below) connector, since this will be only possible once the connector is registered. A dynamic - atm only a DP MST - connector can be initialized and added after the load time initialization is done. Such a connector may be looked up by in-kernel users once it's added to the connector list. In particular a hotplug handler could perform a detection on all the connectors on the list and hence find a connector there which isn't yet initialized. For instance the connector's helper hooks may be unset, leading to a NULL dereference while the detect helper calls the connector's drm_connector_helper_funcs::detect() or detect_ctx() handler. To resolve the above issue, add a way for dynamic connectors to separately initialize the DRM core specific parts of the connector without adding it to the connector list - by calling the new drm_connector_dynamic_init() - and to add the connector to the list later once all the initialization is complete and the connector is registered - by calling the new drm_connector_dynamic_register(). Adding the above 2 functions was also motivated to make the distinction of the interface between static and dynamic connectors clearer: Drivers should manually initialize and register only dynamic connectors (with the above 2 functions). A driver should only initialize a static connector (with one of the drm_connector_init*, drmm_connector_init* functions) while the registration of the connector will be done automatically by DRM core. v2: (Jani) - Let initing DDC as well via drm_connector_init_core(). - Rename __drm_connector_init to drm_connector_init_core_and_add(). v3: - Rename drm_connector_init_core() to drm_connector_dynamic_init(). (Sima) - Instead of exporting drm_connector_add(), move adding the connector to the registration step via a new drm_connector_dynamic_register(). (Sima) - Update drm_connector_dynamic_init()'s function documentation and the commit log according to the above changes. - Update the commit log describing the problematic scenario during connector detection. (Maxime) Cc: Jani Nikula <[email protected]> Cc: Simona Vetter <[email protected]> Cc: Maxime Ripard <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> (v1) Reviewed-by: Lyude Paul <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Acked-by: Alex Deucher <[email protected]> Acked-by: Wayne Lin <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* | drm/connector: add mutex to protect ELD from concurrent accessDmitry Baryshkov2024-12-161-0/+1
|/ | | | | | | | | | | | | The connector->eld is accessed by the .get_eld() callback. This access can collide with the drm_edid_to_eld() updating the data at the same time. Add drm_connector.eld_mutex to protect the data from concurrenct access. Individual drivers are not updated (to reduce possible issues while applying the patch), maintainers are to find a best suitable way to lock that mutex while accessing the ELD data. Reviewed-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
* drm/connector: kerneldoc: Fix two missing newlines in drm_connector.cDaniel Yang2024-08-121-0/+4
| | | | | | | | | | | | | | | | | Fix the unexpected indentation errors. drm_connector.c has some kerneldoc comments that were missing newlines. This results in the following warnings when running make htmldocs: ./Documentation/gpu/drm-kms:538: ./drivers/gpu/drm/drm_connector.c:2344: WARNING: Definition list ends without a blank line; unexpected unindent. [docutils] ./Documentation/gpu/drm-kms:538: ./drivers/gpu/drm/drm_connector.c:2346: ERROR: Unexpected indentation. [docutils] ./Documentation/gpu/drm-kms:538: ./drivers/gpu/drm/drm_connector.c:2368: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils] ./Documentation/gpu/drm-kms:538: ./drivers/gpu/drm/drm_connector.c:2381: ERROR: Unexpected indentation. [docutils] Signed-off-by: Daniel Yang <[email protected]> Reviewed-by: Shuah Khan <[email protected]> [hmahfooz: append drm/connector prefix] Signed-off-by: Hamza Mahfooz <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/connector: Document destroy hook in drmm init functionsJosé Expósito2024-08-051-0/+4
| | | | | | | | | Document that the drm_connector_funcs.destroy hook must be NULL in drmm_connector_init() and drmm_connector_hdmi_init(). Signed-off-by: José Expósito <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* Revert "drm: Introduce 'power saving policy' drm property"Hamza Mahfooz2024-08-021-48/+0
| | | | | | | | | | This reverts commit 76299a557f36d624ca32500173ad7856e1ad93c0. It was merged without meeting userspace requirements. Signed-off-by: Hamza Mahfooz <[email protected]> Reviewed-by: Harry Wentland <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm: Introduce 'power saving policy' drm propertyMario Limonciello2024-07-101-0/+48
| | | | | | | | | | | | | | The `power saving policy` DRM property is an optional property that can be added to a connector by a driver. This property is for compositors to indicate intent of policy of whether a driver can use power saving features that may compromise the experience intended by the compositor. Acked-by: Leo Li <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Hamza Mahfooz <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/drm_connector: Document Colorspace property variantsSebastian Wick2024-07-091-16/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial idea of the Colorspace prop was that this maps 1:1 to InfoFrames/SDP but KMS does not give user space enough information nor control over the output format to figure out which variants can be used for a given KMS commit. At the same time, properties like Broadcast RGB expect full range quantization range being produced by user space from the CRTC and drivers to convert to the range expected by the sink for the chosen output format, mode, InfoFrames, etc. This change documents the reality of the Colorspace property. The Default variant unfortunately is very much driver specific and not reflected by the EDID. The BT2020 variants are in active use by generic compositors which have expectations from the driver about the conversions it has to do when selecting certain output formats. Everything else is also marked as undefined. Coming up with valid behavior that makes it usable from user space and consistent with other KMS properties for those variants is left as an exercise for whoever wants to use them. v2: * Talk about "pixel operation properties" that user space configures * Mention that user space is responsible for checking the EDID for sink support * Make it clear that drivers can choose between RGB and YCbCr on their own Signed-off-by: Sebastian Wick <[email protected]> Reviewed-by: Pekka Paalanen <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm: Add DRM_MODE_TV_MODE_MONOCHROMENick Hollinghurst2024-06-181-0/+7
| | | | | | | | | | | | | | | | Add this as a value for enum_drm_connector_tv_mode, represented by the string "Mono", to generate video with no colour encoding or bursts. Define it to have no pedestal (since only NTSC-M calls for a pedestal). Change default mode creation to acommodate the new tv_mode value which comprises both 525-line and 625-line formats. Acked-by: Daniel Vetter <[email protected]> Signed-off-by: Nick Hollinghurst <[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]
* drm/connector: hdmi: Add Infoframes generationMaxime Ripard2024-05-281-0/+14
| | | | | | | | | | | | | | | | Infoframes in KMS is usually handled by a bunch of low-level helpers that require quite some boilerplate for drivers. This leads to discrepancies with how drivers generate them, and which are actually sent. Now that we have everything needed to generate them in the HDMI connector state, we can generate them in our common logic so that drivers can simply reuse what we precomputed. Cc: Ville Syrjälä <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* drm/connector: hdmi: Add Broadcast RGB propertyMaxime Ripard2024-05-281-0/+88
| | | | | | | | | | | | | | | | | | | The i915 driver has a property to force the RGB range of an HDMI output. The vc4 driver then implemented the same property with the same semantics. KWin has support for it, and a PR for mutter is also there to support it. Both drivers implementing the same property with the same semantics, plus the userspace having support for it, is proof enough that it's pretty much a de-facto standard now and we can provide helpers for it. Let's plumb it into the newly created HDMI connector. Reviewed-by: Dave Stevenson <[email protected]> Acked-by: Pekka Paalanen <[email protected]> Reviewed-by: Sebastian Wick <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* drm/connector: hdmi: Add custom hook to filter TMDS character rateMaxime Ripard2024-05-281-0/+4
| | | | | | | | | | | | | | | | | | | | Most of the HDMI controllers have an upper TMDS character rate limit they can't exceed. On "embedded"-grade display controllers, it will typically be lower than what high-grade monitors can provide these days, so drivers will filter the TMDS character rate based on the controller capabilities. To make that easier to handle for drivers, let's provide an optional hook to be implemented by drivers so they can tell the HDMI controller helpers if a given TMDS character rate is reachable for them or not. This will then be useful to figure out the best format and bpc count for a given mode. Reviewed-by: Dave Stevenson <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* drm/connector: hdmi: Add support for output formatMaxime Ripard2024-05-281-0/+31
| | | | | | | | | | | | Just like BPC, we'll add support for automatic selection of the output format for HDMI connectors. Let's add the needed defaults and fields for now. Reviewed-by: Dave Stevenson <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* drm/connector: hdmi: Add output BPC to the connector stateMaxime Ripard2024-05-281-1/+19
| | | | | | | | | | We'll add automatic selection of the output BPC in a following patch, but let's add it to the HDMI connector state already. Reviewed-by: Dave Stevenson <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* drm/connector: Introduce an HDMI connector initialization functionMaxime Ripard2024-05-281-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | A lot of the various HDMI drivers duplicate some logic that depends on the HDMI spec itself and not really a particular hardware implementation. Output BPC or format selection, infoframe generation are good examples of such areas. This creates a lot of boilerplate, with a lot of variations, which makes it hard for userspace to rely on, and makes it difficult to get it right for drivers. In the next patches, we'll add a lot of infrastructure around the drm_connector and drm_connector_state structures, which will allow to abstract away the duplicated logic. This infrastructure comes with a few requirements though, and thus we need a new initialization function. Hopefully, this will make drivers simpler to handle, and their behaviour more consistent. Reviewed-by: Dave Stevenson <[email protected]> Reviewed-by: Sui Jingfeng <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* drm/connector: Add \n to message about demoting connector force-probesDouglas Anderson2024-05-071-1/+1
| | | | | | | | | | | The debug print clearly lacks a \n at the end. Add it. Fixes: 8f86c82aba8b ("drm/connector: demote connector force-probes for non-master clients") Reviewed-by: Abhinav Kumar <[email protected]> Reviewed-by: Simon Ser <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Douglas Anderson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20240502153234.1.I2052f01c8d209d9ae9c300b87c6e4f60bd3cc99e@changeid
* drm/doc: describe PATH format for DP MSTSimon Ser2023-10-271-0/+6
| | | | | | | | | | | | | | | | This is already uAPI, xserver parses it. It's useful to document since user-space might want to lookup the parent connector. Additionally, people (me included) have misunderstood the PATH property for being stable across reboots, but since a KMS object ID is baked in there that's not the case. So PATH shouldn't be used as-is in config files and such. Signed-off-by: Simon Ser <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Acked-by: Pekka Paalanen <[email protected]> Cc: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm: Add HPD state to drm_connector_oob_hotplug_event()Bjorn Andersson2023-10-111-2/+4
| | | | | | | | | | | | | | | | | | | In some implementations, such as the Qualcomm platforms, the display driver has no way to query the current HPD state and as such it's impossible to distinguish between disconnect and attention events. Add a parameter to drm_connector_oob_hotplug_event() to pass the HPD state. Also push the test for unchanged state in the displayport altmode driver into the i915 driver, to allow other drivers to act upon each update. Signed-off-by: Bjorn Andersson <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Acked-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* Merge tag 'drm-intel-next-2023-09-29' of ↵Dave Airlie2023-10-041-1/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 feature pull for v6.7: Features and functionality: - Early Xe2 LPD / Lunarlake (LNL) display enabling (Lucas, Matt, Gustavo, Stanislav, Luca, Clint, Juha-Pekka, Balasubramani, Ravi) - Plenty of various DSC improvements and fixes (Ankit) - Add DSC PPS state readout and verification (Suraj) - Improve fastsets for VRR, LRR and M/N updates (Ville) - Use connector->ddc to create (non-DP MST) connector sysfs ddc symlinks (Ville) - Various DSB improvements, load LUTs using DSB (Ville) - Improve shared link bandwidth management, starting with FDI (Imre) - Optimize get param ioctl for PXP status (Alan) - Remove DG2 pre-production hardware workarounds (Matt) - Add more RPL P/U PCI IDs (Dnyaneshwar) - Add new DG2-G12 stepping (Swati) - Add PSR sink error status to debugfs (Jouni) - Add DP enhanced framing to crtc state checker (Ville) Refactoring and cleanups: - Simplify TileY/Tile4 tiling selftest enumeration (Matt) - Remove some unused power domain code (Gustavo) - Check stepping of display IP version rather than MTL platform (Matt) - DP audio compute config cleanups (Vinod) - SDVO cleanups and refactoring, more robust failure handling (Ville) - Color register definition and readout cleanups (Jani) - Reduce header interdependencies for frontbuffer tracking (Jani) - Continue replacing struct edid with struct drm_edid (Jani) - Use source physical address instead of EDID for CEC (Jani) - Clean up Type-C port lane count functions (Luca) - Clean up DSC PPS register definitions and readout (Jani) - Stop using GEM_BUG_ON()/GEM_WARN_ON() in display code (Jani) - Move more of the display probe to display code (Jani) - Remove redundant runtime suspended state flag (Jouni) - Move display info printing to display code (Balasubramani) - Frontbuffer tracking improvements (Jouni) - Add trailing newlines to debug logging (Jim Cromie) - Separate display workarounds from clock gating init (Matt) - Reduce dmesg log spamming for combo PHY, PLL state, FEC, DP MST (Ville, Imre) Fixes: - Fix hotplug poll detect loops via suspend/resume (Imre) - Fix hotplug detect for forced connectors (Imre) - Fix DSC first_line_bpg_offset calculation (Suraj) - Fix debug prints for SDP CRC16 (Arun) - Fix PXP runtime resume (Alan) - Fix cx0 PHY lane handling (Gustavo) - Fix frontbuffer tracking locking in debugfs (Juha-Pekka) - Fix SDVO detect on some models (Ville) - Fix SDP split configuration for DP MST (Vinod) - Fix AUX usage and reads for HDCP on DP MST (Suraj) - Fix PSR workaround (Jouni) - Fix redundant AUX power get/put in DP force (Imre) - Fix ICL DSI TCLK POST by letting hardware handle it (William) - Fix IRQ reset for XE LP+ (Gustavo) - Fix h/vsync_end instead of h/vtotal in VBT (Ville) - Fix C20 PHY msgbus timeout issues (Gustavo) - Fix pre-TGL FEC pipe A vs. DDI A mixup (Ville) - Fix FEC state readout for DP MST (Ville) DRM subsystem core changes: - Assume sink supports 8 bpc when DSC is supported (Ankit) - Add drm_edid_is_digital() helper (Jani) - Parse source physical address from EDID (Jani) - Add function to attach CEC without EDID (Jani) - Reorder connector sysfs/debugfs remove (Ville) - Register connector sysfs ddc symlink later (Ville) Media subsystem changes: - Add comments about CEC source physical address usage (Jani) Merges: - Backmerge drm-next to get v6.6-rc1 (Jani) Signed-off-by: Dave Airlie <[email protected]> # Conflicts: # drivers/gpu/drm/i915/i915_drv.h From: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
| * drm/sysfs: Register "ddc" symlink laterVille Syrjälä2023-09-151-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently drm_sysfs_connector_add() attempts to register the "ddc" symlink (based one connector->ddc) before the driver's .early_register() hook has been called. That is too early for i915 which only fully registers the aux ch and associated i2c bus from said hook (to prevent half initialized stuff getting exposed to userspace). This causes my attempt at using drm_connector_init_with_ddc() to fail, and the entire connector disappears from sysfs on account of sysfs_create_link() failing. To fix that split the sysfs symlink stuff into separate functions (drm_sysfs_connector_add_late() and drm_sysfs_connector_remove_early()) which are called on the opposite side of the .later_register() and .early_unregister() hooks. Cc: Andrzej Pietrasiewicz <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Andrzej Hajda <[email protected]> Cc: Emil Velikov <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Neil Armstrong <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]> Acked-by: Thomas Zimmermann <[email protected]> #irc
| * drm: Reorder drm_sysfs_connector_remove() vs. drm_debugfs_connector_remove()Ville Syrjälä2023-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the standard onion peeling approach and call drm_debugfs_connector_remove() and drm_sysfs_connector_remove() in the reverse order in drm_connector_unregister() than what we called their add counterpartse in drm_connector_register(). The error unwiding in drm_connector_register() is already doing this the correct way around. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]> Acked-by: Thomas Zimmermann <[email protected]> #irc
* | Merge tag 'drm-misc-fixes-2023-09-07' of ↵Daniel Vetter2023-09-141-0/+2
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | git://anongit.freedesktop.org/drm/drm-misc into drm-fixes One doc fix for drm/connector, one fix for amdgpu for an crash when VRAM usage is high, and one fix in gm12u320 to fix the timeout units in the code Signed-off-by: Daniel Vetter <[email protected]> From: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/w5nlld5ukeh6bgtljsxmkex3e7s7f4qquuqkv5lv4cv3uxzwqr@pgokpejfsyef
| * drm/drm_connector: Provide short description of param 'supported_colorspaces'Lee Jones2023-08-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/drm_connector.c:2215: warning: Function parameter or member 'supported_colorspaces' not described in 'drm_mode_create_hdmi_colorspace_property' drivers/gpu/drm/drm_connector.c:2239: warning: Function parameter or member 'supported_colorspaces' not described in 'drm_mode_create_dp_colorspace_property' Signed-off-by: Lee Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* | drm/sysfs: rename drm_sysfs_connector_status_event()Simon Ser2023-06-231-4/+4
|/ | | | | | | | | | | | | | | | | Rename drm_sysfs_connector_status_event() to drm_sysfs_connector_property_event(). Indeed, "status" is a bit vague: it can easily be confused with the connected/disconnected status of the connector. This function has nothing to do with connected/disconnected: it merely sends a notification that a connector's property has changed (e.g. HDCP, privacy screen, etc). Signed-off-by: Simon Ser <[email protected]> Cc: Manasi Navare <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Harry Wentland <[email protected]> Cc: Daniel Vetter <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/connector: Allow drivers to pass list of supported colorspacesHarry Wentland2023-06-091-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drivers might not support all colorspaces defined in dp_colorspaces and hdmi_colorspaces. This results in undefined behavior when userspace is setting an unsupported colorspace. Allow drivers to pass the list of supported colorspaces when creating the colorspace property. v2: - Use 0 to indicate support for all colorspaces (Jani) - Print drm_dbg_kms message when drivers pass 0 to signal that drivers should specify supported colorspaecs explicity (Jani) v3: - Move changes to create a common colorspace_names array to separate patch v6: - Avoid magic when passing 0 for supported_colorspaces; be explicit in treating it as "all DP/HDMI" Signed-off-by: Harry Wentland <[email protected]> Reviewed-by: Sebastian Wick <[email protected]> Reviewed-by: Joshua Ashton <[email protected]> Reviewed-by: Simon Ser <[email protected]> Cc: Pekka Paalanen <[email protected]> Cc: Sebastian Wick <[email protected]> Cc: [email protected] Cc: Uma Shankar <[email protected]> Cc: Ville Syrjälä <[email protected]> Cc: Joshua Ashton <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Simon Ser <[email protected]> Cc: Melissa Wen <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Alex Deucher <[email protected]>
* drm/connector: Print connector colorspace in state debugfsHarry Wentland2023-06-091-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | v3: Fix kerneldocs (kernel test robot) v4: Avoid returning NULL from drm_get_colorspace_name Signed-off-by: Harry Wentland <[email protected]> Reviewed-by: Sebastian Wick <[email protected]> Reviewed-by: Joshua Ashton <[email protected]> Reviewed-by: Simon Ser <[email protected]> Cc: Pekka Paalanen <[email protected]> Cc: Sebastian Wick <[email protected]> Cc: [email protected] Cc: Uma Shankar <[email protected]> Cc: Ville Syrjälä <[email protected]> Cc: Joshua Ashton <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Simon Ser <[email protected]> Cc: Melissa Wen <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Alex Deucher <[email protected]>
* drm/connector: Use common colorspace_names arrayHarry Wentland2023-06-091-53/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We an use bitfields to track the support ones for HDMI and DP. This allows us to print colorspaces in a consistent manner without needing to know whether we're dealing with DP or HDMI. v4: - Rename _MAX to _COUNT and leave comment to indicate it's not a valid value - Fix misplaced function doc v6: - Drop magic in drm_mode_create_colorspace_property for dealing with "0" supported_colorspaces. Expect the caller to always provide a non-zero supported_colorspaces. - Improve error checking and logging Signed-off-by: Harry Wentland <[email protected]> Reviewed-by: Sebastian Wick <[email protected]> Reviewed-by: Joshua Ashton <[email protected]> Reviewed-by: Simon Ser <[email protected]> Cc: Pekka Paalanen <[email protected]> Cc: Sebastian Wick <[email protected]> Cc: [email protected] Cc: Uma Shankar <[email protected]> Cc: Ville Syrjälä <[email protected]> Cc: Joshua Ashton <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Simon Ser <[email protected]> Cc: Melissa Wen <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Alex Deucher <[email protected]>
* drm/connector: Pull out common create_colorspace_property codeHarry Wentland2023-06-091-27/+27
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Harry Wentland <[email protected]> Reviewed-by: Sebastian Wick <[email protected]> Reviewed-by: Joshua Ashton <[email protected]> Reviewed-by: Simon Ser <[email protected]> Cc: Pekka Paalanen <[email protected]> Cc: Sebastian Wick <[email protected]> Cc: [email protected] Cc: Uma Shankar <[email protected]> Cc: Ville Syrjälä <[email protected]> Cc: Joshua Ashton <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Simon Ser <[email protected]> Cc: Melissa Wen <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Alex Deucher <[email protected]>
* drm: fix typo in margin connector properties docsSimon Ser2023-03-181-1/+1
| | | | | | | | | | | | | | | This was pointed out by Ville and Pekka in their replies, but forgot to apply the change properly before pushing. Sorry for the noise! Signed-off-by: Simon Ser <[email protected]> Fixes: 409f07d353b3 ("drm: document connector margin properties") Cc: Ville Syrjälä <[email protected]> Cc: Pekka Paalanen <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Dave Stevenson <[email protected]> Reviewed-by: Pekka Paalanen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm: remove outdated doc TODO for subconnector propertySimon Ser2023-03-051-1/+0
| | | | | | | | | | | | This is already documented under "standard connector properties". Signed-off-by: Simon Ser <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Pekka Paalanen <[email protected]> Cc: Noralf Trønnes <[email protected]> Cc: Mateusz Kwiatkowski <[email protected]> Acked-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm: document connector margin propertiesSimon Ser2023-03-051-4/+14
| | | | | | | | | | | | | | | | | | | Add docs for "{left,right,top,bottom} margin" properties. v2: - Mention the purpose: mitigate underscan on TVs - Move out of analog TV section into standard props (Pekka) - Mention HDMI AVI InfoFrames (Pekka, Ville) Signed-off-by: Simon Ser <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Noralf Trønnes <[email protected]> Cc: Mateusz Kwiatkowski <[email protected]> Cc: Ville Syrjälä <[email protected]> Acked-by: Pekka Paalanen <[email protected]> Acked-by: Maxime Ripard <[email protected]> Reviewed-by: Dave Stevenson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm: Include <video/cmdline.h> for mode parsingThomas Zimmermann2023-02-201-3/+6
| | | | | | | | | | | | | | Include <video/cmdline.h> in drm_connector.c to get video_get_options() and avoid the dependency on <linux/fb.h>. The replaced function fb_get_options() is just a tiny wrapper around video_get_opions(). No functional changes. Include <linux/property.h> to get fwnode_handle_put(), which had been provided via <linux/fb.h>. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/edid: parse VICs from CTA VDB earlyJani Nikula2023-01-191-0/+1
| | | | | | | | | | | | | | | A number of places need access to the VICs. Just parse them early for easy access. Gracefully handle multiple CTA VDBs. It's unlikely to have more than one, but the CTA-861 references "Video Data Block(s)", so err on the safe side. Start parsing them now, convert users in follow-up to have fewer moving parts in one go. Cc: Ville Syrjälä <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/7989b2b37837be68953c5d20afd3e93762bfd626.1672826282.git.jani.nikula@intel.com
* drm/connector: fix a kernel-doc bad line warningRandy Dunlap2023-01-191-1/+1
| | | | | | | | | | | | | | | | | | | Building the kernel documentation causes this warning 7 times. Fix it by adding a " *" line instead of a blank line. drivers/gpu/drm/drm_connector.c:1849: warning: bad line: Fixes: 7d63cd8526f1 ("drm/connector: Add TV standard property") 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] Reviewed-by: Simon Ser <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/connector: Add a function to lookup a TV mode by its nameMaxime Ripard2022-11-241-0/+24
| | | | | | | | | | | | | | | As part of the command line parsing rework coming in the next patches, we'll need to lookup drm_connector_tv_mode values by their name, already defined in drm_tv_mode_enum_list. In order to avoid any code duplication, let's do a function that will perform a lookup of a TV mode name and return its value. 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]>
* drm/connector: Add TV standard propertyMaxime Ripard2022-11-241-1/+121
| | | | | | | | | | | | | | | | | | | | | The TV mode property has been around for a while now to select and get the current TV mode output on an analog TV connector. Despite that property name being generic, its content isn't and has been driver-specific which makes it hard to build any generic behaviour on top of it, both in kernel and user-space. Let's create a new enum tv norm property, that can contain any of the analog TV standards currently supported by kernel drivers. Each driver can then pass in a bitmask of the modes it supports, and the property creation function will filter out the modes not supported. We'll then be able to phase out the older tv mode property. 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]>
* drm/connector: Rename drm_mode_create_tv_propertiesMaxime Ripard2022-11-241-6/+6
| | | | | | | | | | | | | | | | | drm_mode_create_tv_properties(), among other things, will create the "mode" property that stores the analog TV mode that connector is supposed to output. However, that property is getting deprecated, so let's rename that function to mention it's deprecated. We'll introduce a new variant of that function creating the property superseeding it in a later patch. Reviewed-by: Lyude Paul <[email protected]> # nouveau 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]>
* drm/connector: Only register TV mode property if presentMaxime Ripard2022-11-241-8/+11
| | | | | | | | | | | | | | The drm_create_tv_properties() will create the TV mode property unconditionally. However, since we'll gradually phase it out, let's register it only if we have a list passed as an argument. This will make the transition easier. Acked-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]>
* drm/connector: Rename legacy TV propertyMaxime Ripard2022-11-241-3/+3
| | | | | | | | | | | | | | | | | The current tv_mode has driver-specific values that don't allow to easily share code using it, either at the userspace or kernel level. Since we're going to introduce a new, generic, property that fit the same purpose, let's rename this one to legacy_tv_mode to make it obvious we should move away from it. Acked-by: Thomas Zimmermann <[email protected]> Reviewed-by: Lyude Paul <[email protected]> # nouveau 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]>
* Merge tag 'drm-misc-next-2022-10-27' of ↵Dave Airlie2022-10-281-0/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 6.2: UAPI Changes: Cross-subsystem Changes: Core Changes: - connector: Send hotplug event on cleanup - edid: logging/debug improvements - plane_helper: Improve tests Driver Changes: - bridge: - it6505: Synchronization improvements - panel: - panel-edp: Add INX N116BGE-EA2 C2 and C4 support. - nouveau: Fix page-fault handling - vmwgfx: fb and cursor refactoring, convert to generic hashtable Signed-off-by: Dave Airlie <[email protected]> From: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20221027073407.c2tlaczvzjrnzazi@houat
| * drm/edid: detach debugfs EDID override from EDID property updateJani Nikula2022-10-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having the EDID override debugfs directly update the EDID property is problematic. The update is partial only. The driver has no way of knowing it's been updated. Mode list is not updated. It's an inconsistent state. Detach debugfs EDID override from the property update completely. Only set and reset a separate override EDID copy from debugfs, and have it take effect only at detect (via EDID read). The copy is at connector->edid_override, protected by connector->edid_override_mutex. This also brings override EDID closer to firmware EDID in behaviour. Add validation of the override EDID which we completely lacked. Note that IGT already forces a detect whenever tests update the override EDID. v2: Add locking (Ville) Signed-off-by: Jani Nikula <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/4c875f8e06c4499f498fcf876e1233cbb155ec8a.1666614699.git.jani.nikula@intel.com
| * drm/connector: send hotplug uevent on connector cleanupSimon Ser2022-10-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A typical DP-MST unplug removes a KMS connector. However care must be taken to properly synchronize with user-space. The expected sequence of events is the following: 1. The kernel notices that the DP-MST port is gone. 2. The kernel marks the connector as disconnected, then sends a uevent to make user-space re-scan the connector list. 3. User-space notices the connector goes from connected to disconnected, disables it. 4. Kernel handles the IOCTL disabling the connector. On success, the very last reference to the struct drm_connector is dropped and drm_connector_cleanup() is called. 5. The connector is removed from the list, and a uevent is sent to tell user-space that the connector disappeared. The very last step was missing. As a result, user-space thought the connector still existed and could try to disable it again. Since the kernel no longer knows about the connector, that would end up with EINVAL and confused user-space. Fix this by sending a hotplug uevent from drm_connector_cleanup(). Signed-off-by: Simon Ser <[email protected]> Cc: [email protected] Cc: Daniel Vetter <[email protected]> Cc: Lyude Paul <[email protected]> Cc: Jonas Ådahl <[email protected]> Tested-by: Jonas Ådahl <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* | drm/connector: Set DDC pointer in drmm_connector_initMaxime Ripard2022-10-201-1/+1
|/ | | | | | | | | | | | | | | | | Commit 35a3b82f1bdd ("drm/connector: Introduce drmm_connector_init") introduced the function drmm_connector_init() with a parameter for an optional ddc pointer to the i2c controller used to access the DDC bus. However, the underlying call to __drm_connector_init() was always setting it to NULL instead of passing the ddc argument around. This resulted in unexpected null pointer dereference on platforms expecting to get a DDC controller. Fixes: 35a3b82f1bdd ("drm/connector: Introduce drmm_connector_init") Reviewed-by: Thomas Zimmermann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* drm/connector: Introduce drmm_connector_initMaxime Ripard2022-07-131-0/+60
| | | | | | | | | | | | | Unlike other DRM entities, there's no helper to create a DRM-managed initialisation of a connector. Let's create an helper to initialise a connector that would be passed as an argument, and handle the cleanup through a DRM-managed action. Acked-by: Sam Ravnborg <[email protected]> Acked-by: Thomas Zimmermann <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* drm/connector: Check for destroy implementationMaxime Ripard2022-07-131-0/+6
| | | | | | | | | | | Connectors need to be cleaned up with a call to drm_connector_cleanup() in their drm_connector_funcs.destroy implementation. Let's check for this and complain if there's no such function. Acked-by: Thomas Zimmermann <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/[email protected]