aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/mgag200
AgeCommit message (Collapse)AuthorFilesLines
2020-07-14drm/mgag200: Inline mga_crtc_{prepare, commit}() into enable functionThomas Zimmermann1-32/+7
There's only trivial code left in mga_crtc_{prepare,commit}(). Merge the functions into the simple pipe's enable function. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-14drm/mgag200: Rename G200WB prepare/commit functionThomas Zimmermann1-6/+4
The prepare and commit helpers for G200WB devices control the BMC. Rename them accordingly. While at it, also change the passed value's type to struct mga_device and remove some type upcasting. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-14drm/mgag200: Set/clear <syncrst> field in display enable/disable helpersThomas Zimmermann2-6/+14
Modifying the <syncrst> field in mgag200_{enable,disable}_display() makes the code more readable. Also clear the <asyncrst> field to enable the display. The other bits in SEQ0 are unused, so no functional changes are made. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-14drm/mgag200: Split DPMS function into helpersThomas Zimmermann2-31/+45
Of the DPMS code, only ON and OFF states are used. Simplify mode setting by moving both into separate functions and removing the rest. The original code busy waited in the middle of updating the screen state in SEQ1. To simplify the procedure, the new code busy waits first and then updates SEQ1 in one chunk. The DPMS code also set the LUT before enabling the screen. The patch moves this code into the simple-display pipe's enable function. v2: * comment on SEQ1 updates in commit message Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-14drm/mgag200: Don't set or clear <scroff> field during modesetThomas Zimmermann1-39/+3
The simple pipe's disable function disables the screen by calling mgag200_disable_screen(). The simple pipe's enable function enables the screen by calling mgag200_enable_display(). During modeset operations the screen is off and remains off. It's only enabled after the modeset has been completed. Therefore remove all code that sets or clears the <scroff> field while in modeset. The related code also modifies the <syncrst> field in SEQ0. For now, keep this code in place. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-14drm/mgag200: Move PLL setup out of mode-setting functionThomas Zimmermann1-3/+2
Makes the code slightly more flexible. No functional changes. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-14drm/mgag200: Don't write-protect CRTC 0-7 while in mga_crtc_prepare()Thomas Zimmermann3-9/+18
The prepare function write-protects several registers that it doesn't even touch. Removed the related code. The code for unprotecting registers also clears VINT interrupts. Both is now done once during initialization. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-11drm/mgag200: Use managed device initializationThomas Zimmermann1-22/+8
The mgag200 driver now uses managed functions for DRM devices. The individual helpers for modesetting and memory managed are already covered, so only device allocation and initialization is left for conversion. Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-11drm/mgag200: Embed instance of struct drm_device in struct mga_deviceThomas Zimmermann4-38/+27
Following current best practice, the instance of struct drm_device is now embedded in struct mga_device. The respective field has been renamed from 'dev' to 'base' to reflect the relationship. Conversion from DRM device is done via upcast. Using dev_private is no longer possible. The patch also open-codes drm_dev_alloc() and DRM device initialization is now performed by a call to drm_device_init(). Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-11drm/mgag200: Allocate device structures in mgag200_driver_load()Thomas Zimmermann1-17/+21
Instances of struct drm_device and struct mga_device are now allocated next to each other in mgag200_driver_load(). Yet another preparation before embedding the DRM device instance in struct mga_device. Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-11drm/mgag200: Separate device initialization into allocationThomas Zimmermann1-10/+22
Embedding the DRM device instance in struct mga_device will require changes to device allocation. Moving the device initialization into its own functions gets it out of the way. Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-11drm/mgag200: Move device init and cleanup to mgag200_drv.cThomas Zimmermann4-83/+69
Moving the initializer and cleanup functions for device instances to mgag200_drv.c prepares for the conversion to managed code. No functional changes are made. Remove mgag200_main.c, which is now empty. Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-11drm/mgag200: Prefix symbol names in mgag200_drv.c with mgag200_Thomas Zimmermann1-10/+10
The naming of symbols in mgag200_drv.c is inconsistent. Fix that by prefixing all names with mgag200_. v2: * clarify commit message Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-11drm/mgag200: Separate DRM and PCI functionality from each otherThomas Zimmermann1-21/+21
Moving the DRM driver structures from the middle of the PCI code to the top of the file makes it more readable. Also remove an obsolete comment. Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-11drm/mgag200: Switch to managed MMThomas Zimmermann3-18/+16
The memory-management code now cleans up automatically as part of device destruction. Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-11drm/mgag200: Merge VRAM setup into MM initializationThomas Zimmermann2-75/+52
The VRAM setup in mgag200_drv.c is part of memory management and should be done in the same place. Merge the code into the memory management's init function. Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-11drm/mgag200: Lookup VRAM PCI BAR start and length only onceThomas Zimmermann1-8/+9
The MM setup code on mgag200 reads PCI BAR 0's start and length several times. Reusing these values makes the code more readable. Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-11drm/mgag200: Rename mgag200_ttm.c to mgag200_mm.cThomas Zimmermann3-2/+3
The mgag200 driver does not use TTM any longer. Rename the related file to mgag200_mm.c (as in 'memory management'). Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-11drm/mgag200: Use pcim_enable_device()Thomas Zimmermann1-7/+3
Using the managed function simplifies the error handling. After unloading the driver, the PCI device should now get disabled as well. Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-11drm/mgag200: Remove mgag200_cursor.cThomas Zimmermann1-319/+0
Support for HW cursors got remove by commit 5a77e2bfdd4f ("drm/mgag200: Remove HW cursor") Apparently the source file was not deleted. Removed it now. Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Fixes: 5a77e2bfdd4f ("drm/mgag200: Remove HW cursor") Cc: Sam Ravnborg <[email protected]> Cc: Emil Velikov <[email protected]> Cc: Dave Airlie <[email protected]> Cc: "Noralf Trønnes" <[email protected]> Cc: Gerd Hoffmann <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Kate Stewart <[email protected]> Cc: Allison Randal <[email protected]> Cc: Andrzej Pietrasiewicz <[email protected]> Cc: "José Roberto de Souza" <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-11drm/mgag200: Remove declaration of mgag200_mmap() from header fileThomas Zimmermann1-1/+0
Commit 94668ac796a5 ("drm/mgag200: Convert mgag200 driver to VRAM MM") removed the implementation of mgag200_mmap(). Also remove the declaration. Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Fixes: 94668ac796a5 ("drm/mgag200: Convert mgag200 driver to VRAM MM") Cc: Gerd Hoffmann <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Krzysztof Kozlowski <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: "Noralf Trønnes" <[email protected]> Cc: Armijn Hemel <[email protected]> Cc: Alex Deucher <[email protected]> Cc: Emil Velikov <[email protected]> Cc: <[email protected]> # v5.3+ Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: remove _unlocked suffix in drm_gem_object_put_unlockedEmil Velikov1-4/+4
Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Dave Airlie <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: Replace VRAM helpers with SHMEM helpersThomas Zimmermann5-88/+56
The VRAM helpers managed the framebuffer memory for mgag200. This came with several problems, as some MGA device require the scanout address to be located at VRAM offset 0. It's incompatible with the page-flip semantics of DRM's atomic modesettting. With atomic modesetting, old and new framebuffers have to be located in VRAM at the same time. So at least one of them has to reside at a non-0 offset. This patch replaces VRAM helpers with SHMEM helpers. GEM SHMEM buffers reside in system memory, and are shadow-copied into VRAM during page flips. The shadow copy always starts at VRAM offset 0. v2: * revert dev->pdev changes Signed-off-by: Thomas Zimmermann <[email protected]> Tested-by: John Donnelly <[email protected]> Acked-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: Convert to simple KMS helperThomas Zimmermann2-152/+164
The mgag200 supports a single pipeline with only a primary plane. It can be converted to simple KMS helpers. This also adds support for atomic modesetting. Wayland compositors, which use pageflip ioctls, can now be used with mgag200. v2: * prepare encoder and CRTC in a separate patch * remove suspend/resume code in a separate patch * don't call set_format_regs() in pipe_update() Signed-off-by: Thomas Zimmermann <[email protected]> Tested-by: John Donnelly <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: Use simple-display data structuresThomas Zimmermann2-35/+8
The MGA CRTC data structure struct mga_crtc contains unused additional fields; so it can removed. The standard DRM CRTC and encoder structures are embedded now in struct drm_simple_display_pipe. Done in preparation of converting mgag200 to simple KMS helpers. v3: * remove now-unused define MGAG200FB_CONN_LIMIT * remove unused define MATROX_DPMS_CLEARED Signed-off-by: Thomas Zimmermann <[email protected]> Tested-by: John Donnelly <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: Remove out-commented suspend/resume helpersThomas Zimmermann2-72/+0
The suspend/resume helpers are unused. Also remove associated state from struct mga_device. Signed-off-by: Thomas Zimmermann <[email protected]> Tested-by: John Donnelly <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: Move register initialization into separate functionThomas Zimmermann1-114/+147
Registers are initialized with constants. This is now done in mgag200_init_regs(), mgag200_set_dac_regs() and mgag200_set_pci_regs(). Later patches should move these calls from mode setting to device initialization. v2: * replace uint8_t with u8 Signed-off-by: Thomas Zimmermann <[email protected]> Tested-by: John Donnelly <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: Move hiprilvl setting into separate functionsThomas Zimmermann1-44/+54
The hiprivlvl settings are now updated in mgag200_g200se_set_hiprilvl() and mgag200_g200ev_set_hiprilvl(). v2: * replace uint8_t with u8 Signed-off-by: Thomas Zimmermann <[email protected]> Tested-by: John Donnelly <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: Move TAGFIFO reset into separate functionThomas Zimmermann3-16/+38
The TAGFIFO state is now reset in mgag200_g200er_reset_tagfifo(). v2: * define MGAREG_SEQ1_SCROFF Signed-off-by: Thomas Zimmermann <[email protected]> Tested-by: John Donnelly <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: Set primary plane's format in separate helper functionThomas Zimmermann1-40/+69
The primary plane's format registers are now updated in a mgag200_set_format_regs(). v2: * get bpp shift from helper function * replace uint8_t with u8 Signed-off-by: Thomas Zimmermann <[email protected]> Tested-by: John Donnelly <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: Set pitch in a separate helper functionThomas Zimmermann2-14/+45
The framebuffer's pitch is now set in mgag200_set_offset(). v2: * move offset and bpp-shift calculation into helper functions * use u8 instead of uint8_t * add MGAREG_CRTCEXT0_OFFSET_MASK Signed-off-by: Thomas Zimmermann <[email protected]> Tested-by: John Donnelly <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: Update mode registers after plane registersThomas Zimmermann1-2/+2
Setting the plane registers first and the mode registers afterwards reproduces the sequence used by atomic helpers. Done in preparation of switching to simple KMS helpers. Signed-off-by: Thomas Zimmermann <[email protected]> Tested-by: John Donnelly <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: Split MISC register update into PLL selection, SYNC and I/OThomas Zimmermann2-13/+31
Set different fields in MISC in their rsp location in the code. This patch also fixes a bug in the original code where the mode's SYNC flags were never written into the MISC register. v2: * use u8 instead of uint8_t * define MGAREG_MISC_CLK_SEL_MASK Signed-off-by: Thomas Zimmermann <[email protected]> Tested-by: John Donnelly <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: Move mode-setting code into separate helper functionThomas Zimmermann1-62/+78
The mode-setting code is now located in mgag200_set_mode_regs(), sans a few flags that will be moved in a later patch for clarity. v2: * replace uint8_t with u8 Signed-off-by: Thomas Zimmermann <[email protected]> Tested-by: John Donnelly <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: Clean up mga_crtc_do_set_base()Thomas Zimmermann1-9/+9
The function now only takes the device structure, and the old and new framebuffers. Signed-off-by: Thomas Zimmermann <[email protected]> Tested-by: John Donnelly <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: Clean up mga_set_start_address()Thomas Zimmermann2-34/+53
All register names and fields are now named according to the MGA programming manuals. The function doesn't need the CRTC, so callers pass in the device structure directly. The logging now uses device-specific macros. The original implementation busy-waited for the VSYNC flag to go up, to synchronize the page flip with the display's vblank. This code has been moved to mga_crtc_mode_set_base(). It's still present in the non-atomic code paths, but won't be used in atomic commits. With atomic, we should use interrupts to synchronize with vblanks. v3: * clarify commit message wrt. vblank busy-waiting v2: * use to_mga_device() * use MiB instead of MB * replace empty while loop with do-while, fixes checkpatch warning * replace uint{8,32}_t with u{8,32} Signed-off-by: Thomas Zimmermann <[email protected]> Tested-by: John Donnelly <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-19drm/mgag200: Remove HW cursorThomas Zimmermann4-21/+1
The HW cursor of Matrox G200 cards only supports a 16-color palette format. Univeral planes require at least ARGB or a similar component- based format, so remove the HW cursor. Alternatively, the driver could dither a cursor image from ARGB to 16 colors. But this does not produce pleasent-looking results in general, so it's useless for modern compositors. Without HW support, compositors will use software rendering. Signed-off-by: Thomas Zimmermann <[email protected]> Tested-by: John Donnelly <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-11drm/mgag200: Embed connector instance in struct mga_deviceThomas Zimmermann2-24/+33
Storing the connector instance in struct mga_device avoids some dynamic memory allocation. On errors, the connector's initializer function now destroys the i2c structure. Done in preparation of converting mgag200 to simple-KMS helpers. v2: * improved commit message (Michael) * fixed error message for mgag200_vga_connector_init() (Sam) Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Michael J. Ruhl <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Tested-by: John Donnelly <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-11drm/mgag200: Remove unused fields from struct mga_deviceThomas Zimmermann3-17/+0
The fields mode_info, num_crtcs and mode in struct mga_device serve no purpose. Remove them. Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Tested-by: John Donnelly <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-11drm/mgag200: Use managed mode-config initializationThomas Zimmermann3-32/+31
Mode configuration is now cleanued up automatically. While at it, move all mode-config code into mgag200_mode.c. Done in preparation of switching mgag200 to simple-KMS helpers. v2: * improve commit message (Sam) * rebased during cherry pick * also move bpp_shift initialization Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Tested-by: John Donnelly <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-11drm/mgag200: Integrate init function into load functionThomas Zimmermann1-40/+19
Done to simplify initialization code before embedding the DRM device instance in struct mga_device. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-11drm/mgag200: Remove several references to struct mga_device.devThomas Zimmermann2-19/+21
Done in preparation of embedding the DRM device in struct mga_device. This patch makes the patch for embedding more readable. v2: * improved commit message (Daniel) Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-11drm/mgag200: Convert struct drm_device to struct mga_device with helperThomas Zimmermann6-19/+24
Mgag200 uses dev_private to look up struct mga_device for instances of struct drm_device. Use of dev_private is deprecated, so hide it in the helper function to_mga_device(). v2: * make to_mga_device() a function (Sam) Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-04-08drm/mgag200: Set up fbdev after registering device; remove error checksThomas Zimmermann2-4/+2
Generic fbdev support is a DRM client. Set it up after registering the new DRM device. Remove the error checks as the driver's probe function should not depend on a DRM client's state. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Noralf Trønnes <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Gerd Hoffmann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-03-02drm/mgag200: Use simple encoderThomas Zimmermann2-82/+13
The mgag200 driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder. v4: * print error message with drm_err() v3: * init pre-allocated encoder with drm_simple_encoder_init() v2: * rebase onto new simple-encoder interface Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-01-07drm/mgag200: Add module parameter to pin all buffers at offset 0Thomas Zimmermann1-0/+14
For hardware that does not interpret the startadd field correctly, add the module parameter 'hw_bug_no_startadd', which enables the workaround. v3: * style and typo fixes v2: * ask user for feedback if the option is active Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Cc: John Donnelly <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-01-07drm/vram-helper: Remove BO device from public interfaceThomas Zimmermann2-4/+2
TTM is an implementation detail of the VRAM helpers and therefore shouldn't be exposed to the callers. There's only one correct value for the BO device anyway, which is the one stored in the DRM device. So remove struct ttm_bo_device from the VRAM-helper interface and use the device's VRAM manager unconditionally. The GEM initializer function fails if the VRAM manager has not been initialized. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-01-07drm/vram-helper: Remove interruptible flag from public interfaceThomas Zimmermann2-2/+2
The flag 'interruptible', which is passed to various functions, is always set to be false. Remove it and hard-code the value. Signed-off-by: Thomas Zimmermann <[email protected]> Suggested-by: Daniel Vetter <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-01-06drm/vram: Support scanline alignment for dumb buffersThomas Zimmermann1-1/+1
Adding the pitch alignment as an argument to drm_gem_vram_fill_create_dumb() allows to align scanlines to certain offsets. A value of 0 disables scanline pitches. v3: * only do power-of-2 test if pitch_align given; fails otherwise * mgag200: call drm_gem_vram_fill_create_dumb() with pitch_align v2: * split of patch from related hibmc changes * test if scanline pitch is power of 2 Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-12-17Merge tag 'drm-misc-next-2019-12-16' of ↵Daniel Vetter7-17/+52
git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v5.6: UAPI Changes: - Add support for DMA-BUF HEAPS. Cross-subsystem Changes: - mipi dsi definition updates, pulled into drm-intel as well. - Add lockdep annotations for dma_resv vs mmap_sem and fs_reclaim. - Remove support for dma-buf kmap/kunmap. - Constify fb_ops in all fbdev drivers, including drm drivers and drm-core, and media as well. Core Changes: - Small cleanups to ttm. - Fix SCDC definition. - Assorted cleanups to core. - Add todo to remove load/unload hooks, and use generic fbdev emulation. - Assorted documentation updates. - Use blocking ww lock in ttm fault handler. - Remove drm_fb_helper_fbdev_setup/teardown. - Warning fixes with W=1 for atomic. - Use drm_debug_enabled() instead of drm_debug flag testing in various drivers. - Fallback to nontiled mode in fbdev emulation when not all tiles are present. (Later on reverted) - Various kconfig indentation fixes in core and drivers. - Fix freeing transactions in dp-mst correctly. - Sean Paul is steping down as core maintainer. :-( - Add lockdep annotations for atomic locks vs dma-resv. - Prevent use-after-free for a bad job in drm_scheduler. - Fill out all block sizes in the P01x and P210 definitions. - Avoid division by zero in drm/rect, and fix bounds. - Add drm/rect selftests. - Add aspect ratio and alternate clocks for HDMI 4k modes. - Add todo for drm_framebuffer_funcs and fb_create cleanup. - Drop DRM_AUTH for prime import/export ioctls. - Clear DP-MST payload id tables downstream when initializating. - Fix for DSC throughput definition. - Add extra FEC definitions. - Fix fake offset in drm_gem_object_funs.mmap. - Stop using encoder->bridge in core directly - Handle bridge chaining slightly better. - Add backlight support to drm/panel, and use it in many panel drivers. - Increase max number of y420 modes from 128 to 256, as preparation to add the new modes. Driver Changes: - Small fixes all over. - Fix documentation in vkms. - Fix mmap_sem vs dma_resv in nouveau. - Small cleanup in komeda. - Add page flip support in gma500 for psb/cdv. - Add ddc symlink in the connector sysfs directory for many drivers. - Add support for analogic an6345, and fix small bugs in it. - Add atomic modesetting support to ast. - Fix radeon fault handler VMA race. - Switch udl to use generic shmem helpers. - Unconditional vblank handling for mcde. - Miscellaneous fixes to mcde. - Tweak debug output from komeda using debugfs. - Add gamma and color transform support to komeda for DOU-IPS. - Add support for sony acx424AKP panel. - Various small cleanups to gma500. - Use generic fbdev emulation in udl, and replace udl_framebuffer with generic implementation. - Add support for Logic PD Type 28 panel. - Use drm_panel_* wrapper functions in exynos/tegra/msm. - Add devicetree bindings for generic DSI panels. - Don't include drm_pci.h directly in many drivers. - Add support for begin/end_cpu_access in udmabuf. - Stop using drm_get_pci_dev in gma500 and mga200. - Fixes to UDL damage handling, and use dma_buf_begin/end_cpu_access. - Add devfreq thermal support to panfrost. - Fix hotplug with daisy chained monitors by removing VCPI when disabling topology manager. - meson: Add support for OSD1 plane AFBC commit. - Stop displaying garbage when toggling ast primary plane on/off. - More cleanups and fixes to UDL. - Add D32 suport to komeda. - Remove globle copy of drm_dev in gma500. - Add support for Boe Himax8279d MIPI-DSI LCD panel. - Add support for ingenic JZ4770 panel. - Small null pointer deference fix in ingenic. - Remove support for the special tfp420 driver, as there is a generic way to do it. Signed-off-by: Daniel Vetter <[email protected]> From: Maarten Lankhorst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]