summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/mgag200 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Revert "drm/mgag200: Add vblank support"Thomas Zimmermann2024-10-1711-178/+6
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6c9e14ee9f519ee605a3694fbfa4711284781d22. This reverts commit d5070c9b29440c270b534bbacd636b8fa558e82b. This reverts commit 89c6ea2006e2d39b125848fb0195c08fa0b354be. The VLINE interrupt doesn't work correctly on G200SE-A (at least). We have also seen missing interrupts on G200ER. So revert vblank support. Fixes frozen displays and warnings about missed vblanks. [ 33.818362] [CRTC:34:crtc-0] vblank wait timed out From the vblank code, the driver only keeps the register constants and the line that disables all interrupts in mgag200_device_init(). Both is still useful without vblank handling. Reported-by: Tony Luck <tony.luck@intel.com> Closes: https://lore.kernel.org/dri-devel/Zvx6lSi7oq5xvTZb@agluck-desk3.sc.intel.com/raw Tested-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241015063932.8620-1-tzimmermann@suse.de
* drm/mgag200: Remove BMC outputThomas Zimmermann2024-08-099-140/+0
| | | | | | | | | | | | | | | Mgag200's BMC connector tracks the status of an underlying physical connector and updates the BMC status accordingly. This functionality works around GNOME's settings app, which cannot handle multiple outputs on the same CRTC. The workaround is now obsolete as the VGA-BMC connector handles BMC support internally. Hence, remove the driver's code and the BMC output entirely. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240805130622.63458-6-tzimmermann@suse.de
* drm/mgag200: vga-bmc: Control BMC scanout from encoderThomas Zimmermann2024-08-095-15/+20
| | | | | | | | | | | | | | | Move calls to stop and start BMC scanout from CRTC helpers to the VGA-BMC encoder's atomic_disable and atomic_enable. Makes the BMC scanout transparent to the CRTC. DRM's atomic helpers call an encoder's atomic_disable and atomic_enable helpers for all enabled encoders. The BMC stops scanning out the VGA signal if modeset disables the VGA encoder, and starts scanning out if the modeset enables the VGA encoder. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240805130622.63458-5-tzimmermann@suse.de
* drm/mgag200: vga-bmc: Control CRTC VIDRST flag from encoderThomas Zimmermann2024-08-092-3/+18
| | | | | | | | | | | | | | | Control the VIDRST pin from the VGA-BMC encoder's atomic_check and remove the respective code from CRTC. Makes the VIDRST functionality fully composable. The VIDRST pin allows an external clock source to control the SYNC signals of the Matrox chip. The functionality is part of the CRTC, but depends on the presence of the clock source. This is the case for some BMCs, so control the pin from the VGA-BMC output. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240805130622.63458-4-tzimmermann@suse.de
* drm/mgag200: vga-bmc: Transparently handle BMCThomas Zimmermann2024-08-091-2/+48
| | | | | | | | | | | | | | | The VGA-BMC connector selects the VGA output if a display has been attached to the physical connector. Otherwise it selects the BMC output. In any case, the connector status is set to 'detected', so that the userspace compositor displays to it. Depending on the setting, the connector's display modes either come from the VGA monitor's EDID or from an internal list of BMC-compatible modes. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240805130622.63458-3-tzimmermann@suse.de
* drm/mgag200: Add VGA-BMC outputThomas Zimmermann2024-08-0910-7/+83
| | | | | | | | | | Duplicate VGA output to VGA-BMC output and update all code for Matrox server chips. The new output represents a VGA output that has a BMC attached to it. No functional changes so far. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240805130622.63458-2-tzimmermann@suse.de
* drm/mgag200: Fix VBLANK interrupt handlingThomas Zimmermann2024-08-013-3/+12
| | | | | | | | | | | | | | | | | | | | Fix support for VBLANK interrupts on G200ER, G200EV and G200SE, which use a slightly different implementation than the others. The original commits forgot to update the custom helpers when adding interrupt handling for VBLANK events. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Fixes: 89c6ea2006e2 ("drm/mgag200: Add vblank support") Fixes: d5070c9b2944 ("drm/mgag200: Implement struct drm_crtc_funcs.get_vblank_timestamp") Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Jocelyn Falempe <jfalempe@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Dave Airlie <airlied@redhat.com> Cc: dri-devel@lists.freedesktop.org Acked-by: Sui Jingfeng <sui.jingfeng@linux.dev> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240731071004.519566-1-tzimmermann@suse.de
* drm/mgag200: Implement struct drm_crtc_funcs.get_vblank_timestampThomas Zimmermann2024-07-192-2/+33
| | | | | | | | | | | Implement struct drm_crtc_funcs.get_vblank_timestamp with the DRM helper drm_crtc_vblank_helper_get_vblank_timestamp() with its helper get_scanout_position. Read the scanout position from the MGAREG_VCOUNT register. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240718104551.575912-8-tzimmermann@suse.de
* drm/mgag200: Add vblank supportThomas Zimmermann2024-07-1912-2/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no VBLANK interrupt on Matrox chipsets. The workaround that is being used here and in other free Matrox drivers is to program <linecomp> to the value of <vblkstr> and enable the VLINE interrupt. This triggers an interrupt at the time when VBLANK begins. VLINE uses separate registers for enabling and clearing pending interrupts. No extra synchronization between irq handler and the rest of the driver is required. v6: - clear VLINE status bit before registering IRQ (Jocelyn) v5: - disable all interrupts before registering IRQ (Jocelyn) - don't read from ICLEAR (Jocelyn) v4: - recreate patch on latest upstream - use devm_request_irq() for managed cleanup - fail if vblanking cannot be initialized - rename register constants (Sam, Emil) - clear interrupt before registering handler (Ville) - move <linecomp> programming into separate commit - set <linecomp> to <vblkstr> - fix typo in commit message v3: - set <linecomp> to <vdisplay> + 1 to trigger at VBLANK - expand comment on linecomp v2: - only signal vblank on CRTC 0 - use constants for registers and fields - set VLINECLR before enabling interrupt - test against STATUS and IEN in irq handler - coding-style fixes Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240718104551.575912-7-tzimmermann@suse.de
* drm/mgag200: Add dedicted variable for <linecomp> fieldThomas Zimmermann2024-07-191-4/+7
| | | | | | | | | Replace the line-compare value of <vdispend> with a dedicated variable <linecomp>. Improves readability and prepares for vblank support. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240718104551.575912-6-tzimmermann@suse.de
* drm/mgag200: Add dedicated variables for blanking fieldsThomas Zimmermann2024-07-191-13/+16
| | | | | | | | | | Represent fields for horizontal and vertical blanking with <hblkstr>, <hblkend>, <vblkstr> and <vblkend>. Aligns the code with the Matrox programming manuals. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240718104551.575912-5-tzimmermann@suse.de
* drm/mgag200: Use adjusted mode values for CRTCsThomas Zimmermann2024-07-191-8/+8
| | | | | | | | | | Use the values with the crtc_ prefix from struct drm_display_mode to program hardware. The DRM core adjusted these values to the requirements of CRTC hardware. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240718104551.575912-4-tzimmermann@suse.de
* drm/mgag200: Align register field names with documentationThomas Zimmermann2024-07-191-27/+27
| | | | | | | | | | In mgag200_set_mode_regs(), align variable names with the field names given in the Matrox programming manuals. Makes the code and docs grep- able. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240718104551.575912-3-tzimmermann@suse.de
* drm/mgag200: Use hexadecimal register indecesThomas Zimmermann2024-07-191-25/+25
| | | | | | | | | | In mgag200_set_mode_regs(), use hexadecimal indices for accessing registers. Aligns the code with the register indices in the Matrox programming manuals. Also convert to lower-case hexadecimal values. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240718104551.575912-2-tzimmermann@suse.de
* drm/mgag200: Rename BMC vidrst namesThomas Zimmermann2024-07-156-20/+20
| | | | | | | | | The BMC's scanout synchronization is only indirectly related to the VIDRST functionality. Do some renaming. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240711072415.11831-4-tzimmermann@suse.de
* drm/mgag200: Remove vidrst callbacks from struct mgag200_device_funcsThomas Zimmermann2024-07-157-42/+10
| | | | | | | | | | | | | | | | | | The callbacks disable_vidrst and enable_vidrst are obsolete. Remove the fields from struct mgag200_device_funcs. Instead call their implementations directly of the field 'has_vidrst' has been set in struct mgag200_device_info. Also change the logic slightly. The BMC used to start and stop scanout during the CRTC's atomic_enable and atomic_disable. Plane updates were done while the BMC scanned out the display. Now only stop once in atomic_disable at the beginning of a modeset and then restart the scanout at the end of a modeset in atomic_enable. While the modeset takes place, the BMC does not scanout at all. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240711072415.11831-3-tzimmermann@suse.de
* drm/mgag200: Only set VIDRST bits in CRTC modesettingThomas Zimmermann2024-07-156-13/+15
| | | | | | | | | | | | | | | | | | | | | | The VRSTEN and HRSTEN bits control whether a CRTC synchronizes its display signal with an external source on the VIDRST pin. The G200WB and G200EW3 models synchronize with a BMC chip, but different external video encoders, such as the Matrox Maven, can also be attached to the pin. Only set VRSTEN and HRSTEN bits in the CRTC mode-setting code, so the bits are independent from the BMC. Add the field set_vidrst to the CRTC state for this purpose. Off by default, control the CRTC VIDRST setting from the CRTC's atomic_check helper. v3: - don't clear bits unnecessary (Jocelyn) v2: - keep logic entirely in CRTC (Jocelyn) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240711072415.11831-2-tzimmermann@suse.de
* drm/mgag200: Rename constant MGAREG_Status to MGAREG_STATUSThomas Zimmermann2024-07-032-4/+4
| | | | | | | | | | Register constants are upper case. Fix MGAREG_Status accordingly. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20191205160142.3588-3-tzimmermann@suse.de
* drm/mgag200: Set .detect_ctx() and enable connector pollingThomas Zimmermann2024-06-139-1/+13
| | | | | | | | | | | Set .detect_ctx() in struct drm_connector_helper_funcs to the common helper drm_connector_helper_detect_from_ddc() and enable polling for the connector. Mgag200 will now test for the monitor's presence by probing the DDC in regular intervals. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240610141141.29527-4-tzimmermann@suse.de
* drm/mgag200: Add BMC outputThomas Zimmermann2024-06-139-0/+145
| | | | | | | | | | | | | | | | | | The BMC output can be viewed via the BMC's web interface or a similar client. Represent it as virtual encoder and connector. It's attached to the same CRTC as the VGA connector. The connector's status depends on the physical connector's status. The BMC is only connected if the physical connector is not. This is necessary to support userspace clients that can only handle a single output per CRTC. The BMC is a server feature. Add a BMC output for all server chips, but not the desktop models. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240610141141.29527-3-tzimmermann@suse.de
* drm/mgag200: Consolidate VGA outputThomas Zimmermann2024-06-1311-368/+95
| | | | | | | | | | The various models have common code for the VGA output's encoder and connector. Move everything into a single shared source file. Remove some obsolete initializer macros. No functional changes. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240610141141.29527-2-tzimmermann@suse.de
* drm/mgag200: Add an option to disable Write-CombineJocelyn Falempe2024-05-212-0/+16
| | | | | | | | | | | Unfortunately, the G200 ioburst workaround doesn't work on some servers like Dell poweredge XR11, XR5610, or HPE XL260. In this case completely disabling WC is the only option to achieve low-latency. So this adds a new Kconfig option to disable WC mapping of the G200. Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20240517151050.624797-3-jfalempe@redhat.com
* Revert "drm/mgag200: Add a workaround for low-latency"Jocelyn Falempe2024-05-213-37/+0
| | | | | | | | | | | | | This reverts commit bfa4437fd3938ae2e186e7664b2db65bb8775670. This workaround doesn't work reliably on all servers. I'll replace it with an option to disable Write-Combine, which has more impact on performance, but fix the latency issue on all hardware. Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20240517151050.624797-2-jfalempe@redhat.com
* drm/mgag200: Use drm_connector_helper_get_modes()Thomas Zimmermann2024-05-172-20/+1
| | | | | | | | | Mgag200's .get_modes() function is identical to the common helper. Use the latter. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240513125620.6337-11-tzimmermann@suse.de
* drm/mgag200: Acquire I/O-register lock in DDC codeThomas Zimmermann2024-05-172-9/+24
| | | | | | | | | | | | | | | The modeset lock protects the DDC code from concurrent modeset operations, which use the same registers. Move that code from the connector helpers into the DDC helpers .pre_xfer() and .post_xfer(). Both, .pre_xfer() and .post_xfer(), enclose the transfer of data blocks over the I2C channel in the internal I2C function bit_xfer(). Both calls are executed unconditionally if present. Invoking DDC transfers from any where within the driver now takes the lock. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240513125620.6337-10-tzimmermann@suse.de
* drm/mgag200: Rename struct i2c_algo_bit_data callbacksThomas Zimmermann2024-05-171-8/+8
| | | | | | | | | | Align the names of the algo-bit helpers with mgag200's convention of using an mgag200 prefix plus the struct's name plus the callback's name for such function symbols. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240513125620.6337-9-tzimmermann@suse.de
* drm/mgag200: Rename mgag200_i2c.c to mgag200_ddc.cThomas Zimmermann2024-05-172-1/+1
| | | | | | | | | Rename the source file according to its content. No functional changes. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240513125620.6337-8-tzimmermann@suse.de
* drm/mgag200: Replace struct mga_i2c_chan with struct mgag200_ddcThomas Zimmermann2024-05-172-33/+33
| | | | | | | | | | | | | | Rename struct mga_i2c_chan to struct mgag200_ddc, define it in the source file mgag200_i2c.c, and reorder its fields. Rename all related variables from i2c to ddc. Also rename the i2c adapter accordingly. Using the term 'ddc' documents the purpose of the code clearly. The old term 'i2c' could refer to any functionality on an i2c bus. No functional changes. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240513125620.6337-7-tzimmermann@suse.de
* drm/mgag200: Inline mgag200_i2c_init()Thomas Zimmermann2024-05-171-33/+29
| | | | | | | | | | | The function mgag200_i2c_init() is an internal helper that sets up the i2c data structure. Inline its code into the only caller. Rearrange the individual steps to separate among i2c algorithm, adapter and fields in struct mga_i2c_chan. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240513125620.6337-6-tzimmermann@suse.de
* drm/mgag200: Allocate instance of struct mga_i2c_chan dynamicallyThomas Zimmermann2024-05-1712-45/+79
| | | | | | | | | | Allocate instances of struct mga_i2c_chan in mgag200_ddc_create() and return a pointer to the contained i2c adapter. The callers of the function are now independent from struct mga_i2c_chan. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240513125620.6337-5-tzimmermann@suse.de
* drm/mgag200: Store pointer to struct mga_device in struct mga_i2c_chanThomas Zimmermann2024-05-172-10/+10
| | | | | | | | | Avoid upcasting to struct mga_device in i2c code by storing the pointer directly. No functional changes. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240513125620.6337-4-tzimmermann@suse.de
* drm/mgag200: Bind I2C lifetime to DRM deviceThomas Zimmermann2024-05-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | Managed cleanup with devm_add_action_or_reset() will release the I2C adapter when the underlying Linux device goes away. But the connector still refers to it, so this cleanup leaves behind a stale pointer in struct drm_connector.ddc. Bind the lifetime of the I2C adapter to the connector's lifetime by using DRM's managed release. When the DRM device goes away (after the Linux device) DRM will first clean up the connector and then clean up the I2C adapter. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Fixes: b279df242972 ("drm/mgag200: Switch I2C code to managed cleanup") Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Jocelyn Falempe <jfalempe@redhat.com> Cc: Dave Airlie <airlied@redhat.com> Cc: dri-devel@lists.freedesktop.org Cc: <stable@vger.kernel.org> # v6.0+ Link: https://patchwork.freedesktop.org/patch/msgid/20240513125620.6337-3-tzimmermann@suse.de
* drm/mgag200: Set DDC timeout in millisecondsThomas Zimmermann2024-05-171-1/+1
| | | | | | | | | | | | | | | | | | | Compute the i2c timeout in jiffies from a value in milliseconds. The original values of 2 jiffies equals 2 milliseconds if HZ has been configured to a value of 1000. This corresponds to 2.2 milliseconds used by most other DRM drivers. Update mgag200 accordingly. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Fixes: 414c45310625 ("mgag200: initial g200se driver (v2)") Cc: Dave Airlie <airlied@redhat.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Jocelyn Falempe <jfalempe@redhat.com> Cc: dri-devel@lists.freedesktop.org Cc: <stable@vger.kernel.org> # v3.5+ Link: https://patchwork.freedesktop.org/patch/msgid/20240513125620.6337-2-tzimmermann@suse.de
* drm/mgag200: Use fbdev-shmemThomas Zimmermann2024-05-021-2/+2
| | | | | | | | | | | | Implement fbdev emulation with fbdev-shmem. Avoids the overhead of fbdev-generic's additional shadow buffering. No functional changes. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Dave Airlie <airlied@redhat.com> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240419083331.7761-13-tzimmermann@suse.de
* drm/mgag200: Add drm_panic supportJocelyn Falempe2024-04-152-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the drm_panic module, which displays a message to the screen when a kernel panic occurs. v5: * Also check that the plane is visible and primary. (Thomas Zimmermann) v7: * use drm_for_each_primary_visible_plane() v8: * Replace get_scanout_buffer() logic with drm_panic_set_buffer() (Thomas Zimmermann) v9: * Revert to using get_scanout_buffer() (Sima) * move get_scanout_buffer() to plane helper functions (Thomas Zimmermann) v12: * Use array for map and pitch in struct drm_scanout_buffer to support multi-planar format later. (Thomas Zimmermann) Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20240409163432.352518-8-jfalempe@redhat.com Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* drm/mgag200: Add a workaround for low-latencyJocelyn Falempe2024-02-263-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We found a regression in v5.10 on real-time server, using the rt-kernel and the mgag200 driver. It's some really specialized workload, with <10us latency expectation on isolated core. After the v5.10, the real time tasks missed their <10us latency when something prints on the screen (fbcon or printk) The regression has been bisected to 2 commits: commit 0b34d58b6c32 ("drm/mgag200: Enable caching for SHMEM pages") commit 4862ffaec523 ("drm/mgag200: Move vmap out of commit tail") The first one changed the system memory framebuffer from Write-Combine to the default caching. Before the second commit, the mgag200 driver used to unmap the framebuffer after each frame, which implicitly does a cache flush. Both regressions are fixed by this commit, which restore WC mapping for the framebuffer in system memory, and add a cache flush. This is only needed on x86_64, for low-latency workload, so the new kconfig DRM_MGAG200_IOBURST_WORKAROUND depends on PREEMPT_RT and X86. For more context, the whole thread can be found here [1] Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/dri-devel/20231019135655.313759-1-jfalempe@redhat.com/ # 1 Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20240208095125.377908-1-jfalempe@redhat.com
* Merge drm/drm-next into drm-misc-nextMaxime Ripard2024-01-296-6/+25
|\ | | | | | | | | | | Kickstart 6.9 development cycle. Signed-off-by: Maxime Ripard <mripard@kernel.org>
| * Merge tag 'i2c-for-6.8-rc1-rebased' of ↵Linus Torvalds2024-01-191-1/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: "This removes the currently unused CLASS_DDC support (controllers set the flag, but there is no client to use it). Also, CLASS_SPD support gets simplified to prepare removal in the future. Class based instantiation is not recommended these days anyhow. Furthermore, I2C core now creates a debugfs directory per I2C adapter. Current bus driver users were converted to use it. Finally, quite some driver updates. Standing out are patches for the wmt-driver which is refactored to support more variants. This is the rebased pull request where a large series for the designware driver was dropped" * tag 'i2c-for-6.8-rc1-rebased' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (38 commits) MAINTAINERS: use proper email for my I2C work i2c: stm32f7: add support for stm32mp25 soc i2c: stm32f7: perform I2C_ISR read once at beginning of event isr dt-bindings: i2c: document st,stm32mp25-i2c compatible i2c: stm32f7: simplify status messages in case of errors i2c: stm32f7: perform most of irq job in threaded handler i2c: stm32f7: use dev_err_probe upon calls of devm_request_irq i2c: i801: Add lis3lv02d for Dell XPS 15 7590 i2c: i801: Add lis3lv02d for Dell Precision 3540 i2c: wmt: Reduce redundant: REG_CR setting i2c: wmt: Reduce redundant: function parameter i2c: wmt: Reduce redundant: clock mode setting i2c: wmt: Reduce redundant: wait event complete i2c: wmt: Reduce redundant: bus busy check i2c: mux: reg: Remove class-based device auto-detection support i2c: make i2c_bus_type const dt-bindings: at24: add ROHM BR24G04 eeprom: at24: use of_match_ptr() i2c: cpm: Remove linux,i2c-index conversion from be32 i2c: imx: Make SDA actually optional for bus recovering ...
| | * drm: remove I2C_CLASS_DDC supportHeiner Kallweit2024-01-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After removal of the legacy EEPROM driver and I2C_CLASS_DDC support in olpc_dcon there's no i2c client driver left supporting I2C_CLASS_DDC. Class-based device auto-detection is a legacy mechanism and shouldn't be used in new code. So we can remove this class completely now. Acked-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Acked-by: Harry Wentland <harry.wentland@amd.com> Acked-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
| * | drm/mgag200: Fix gamma lut not initialized for G200ER, G200EV, G200SEJocelyn Falempe2023-12-205-5/+25
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When mgag200 switched from simple KMS to regular atomic helpers, the initialization of the gamma settings was lost. This leads to a black screen, if the bios/uefi doesn't use the same pixel color depth. This has been fixed with commit ad81e23426a6 ("drm/mgag200: Fix gamma lut not initialized.") for most G200, but G200ER, G200EV, G200SE use their own version of crtc_helper_atomic_enable() and need to be fixed too. Fixes: 1baf9127c482 ("drm/mgag200: Replace simple-KMS with regular atomic helpers") Cc: <stable@vger.kernel.org> #v6.1+ Reported-by: Roger Sewell <roger.sewell@cantab.net> Suggested-by: Roger Sewell <roger.sewell@cantab.net> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20231214163849.359691-1-jfalempe@redhat.com
* | drm/mgag200: convert get modes to struct drm_edidJani Nikula2024-01-081-4/+10
| | | | | | | | | | | | | | | | | | | | Convert mgag200_vga_connector_helper_get_modes() to use struct drm_edid based functions directly. Suggested-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/19a453c725fc27bd890f8fc73104f43a376dfce0.1704473654.git.jani.nikula@intel.com
* | drm/mgag200: Fix caching setup for remapped video memoryThomas Zimmermann2024-01-081-5/+4
|/ | | | | | | | | | | | | | | | | | | I/O video memory for the framebuffer supports write-combine caching mode. Simplify the driver's code that sets up the caching mode. * Map video memory with ioremap_wc(), which automatically sets up the PAT entry with write-combine caching. * Remove the now obsolete call to devm_arch_io_reserve_memtype_wc(). It is only required to mmap the video memory to user space, which the driver doesn't do. * According to the PAT documentation, arch_phys_wc_add() is best called after remapping I/O memory, so move it after ioremap. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240105082714.21881-1-tzimmermann@suse.de
* drm: Call drm_atomic_helper_shutdown() at shutdown/remove time for misc driversDouglas Anderson2023-09-211-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on grepping through the source code these drivers appear to be missing a call to drm_atomic_helper_shutdown() at system shutdown time and at driver remove (or unbind) time. Among other things, this means that if a panel is in use that it won't be cleanly powered off at system shutdown time. The fact that we should call drm_atomic_helper_shutdown() in the case of OS shutdown/restart and at driver remove (or unbind) time comes straight out of the kernel doc "driver instance overview" in drm_drv.c. A few notes about these fixes: - I confirmed that these drivers were all DRIVER_MODESET type drivers, which I believe makes this relevant. - I confirmed that these drivers were all DRIVER_ATOMIC. - When adding drm_atomic_helper_shutdown() to the remove/unbind path, I added it after drm_kms_helper_poll_fini() when the driver had it. This seemed to be what other drivers did. If drm_kms_helper_poll_fini() wasn't there I added it straight after drm_dev_unregister(). - This patch deals with drivers using the component model in similar ways as the patch ("drm: Call drm_atomic_helper_shutdown() at shutdown time for misc drivers") - These fixes rely on the patch ("drm/atomic-helper: drm_atomic_helper_shutdown(NULL) should be a noop") to simplify shutdown. Suggested-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> # tilcdc Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20230901163944.RFT.5.I771eb4bd03d8772b19e7dcfaef3e2c167bce5846@changeid
* drm/mgag200: set variable mgag200_modeset storage-class-specifier to staticTom Rix2023-06-231-1/+1
| | | | | | | | | | | | | | smatch reports drivers/gpu/drm/mgag200/mgag200_drv.c:23:5: warning: symbol 'mgag200_modeset' was not declared. Should it be static? This variable is only used in its defining file, so it should be static Signed-off-by: Tom Rix <trix@redhat.com> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230517134140.874179-1-trix@redhat.com
* Merge drm/drm-fixes into drm-misc-fixesMaxime Ripard2023-05-122-10/+15
|\ | | | | | | | | | | Let's bring 6.4-rc1 in drm-misc-fixes to start the new fix cycle. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
| * drm/mgag200: Implement struct drm_plane_helper_funcs.atomic_enableThomas Zimmermann2023-02-202-7/+15
| | | | | | | | | | | | | | | | | | | | Enable the primary plane for mgag200 hardware via atomic_enable. Atomic helpers invoke this callback only when the plane becomes active. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230209154107.30680-5-tzimmermann@suse.de
| * drm/mgag200: Remove disable handling from atomic_updateThomas Zimmermann2023-02-201-3/+0
| | | | | | | | | | | | | | | | | | | | The primary plane has the atomic_disable helper set, so atomic_update won't be called if the plane gets disabled. Remove the respective branch from the helper. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230209154107.30680-4-tzimmermann@suse.de
* | drm/mgag200: Fix gamma lut not initialized.Jocelyn Falempe2023-05-111-0/+5
|/ | | | | | | | | | | | | | | | | When mgag200 switched from simple KMS to regular atomic helpers, the initialization of the gamma settings was lost. This leads to a black screen, if the bios/uefi doesn't use the same pixel color depth. v2: rebase on top of drm-misc-fixes, and add Cc stable tag. Link: https://bugzilla.redhat.com/show_bug.cgi?id=2171155 Fixes: 1baf9127c482 ("drm/mgag200: Replace simple-KMS with regular atomic helpers") Cc: <stable@vger.kernel.org> Tested-by: Phil Oester <kernel@linuxace.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230510131034.284078-1-jfalempe@redhat.com
* drm: Only select I2C_ALGOBIT for drivers that actually need itUwe Kleine-König2023-01-101-0/+2
| | | | | | | | | | | | | While working on a drm driver that doesn't need the i2c algobit stuff I noticed that DRM selects this code even though only 8 drivers actually use it. While also only some drivers use i2c, keep the select for I2C for the next cleanup patch. Still prepare this already by also selecting I2C for the individual drivers. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221219083627.1401627-1-u.kleine-koenig@pengutronix.de
* drm/fb-helper: Remove unnecessary include statementsThomas Zimmermann2022-11-051-1/+0
| | | | | | | | | | | | | | Remove include statements for <drm/drm_fb_helper.h> where it is not required (i.e., most of them). In a few places include other header files that are required by the source code. v3: * fix amdgpu include statements * fix rockchip include statements Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221103151446.2638-23-tzimmermann@suse.de