aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-11-09drm/vc4: Prefer PPF over TPZ when dst >= 2/3 srcBoris Brezillon1-4/+4
The HVS spec recommends using PPF when the downscaling ratio is between 2/3 and 1. Let's modify vc4_get_scaling_mode() to follow this recommendation. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-09drm/vc4: ->x_scaling[1] should never be set to VC4_SCALING_NONEBoris Brezillon1-5/+7
For the YUV conversion to work properly, ->x_scaling[1] should never be set to VC4_SCALING_NONE, but vc4_get_scaling_mode() might return VC4_SCALING_NONE if the horizontal scaling ratio exactly matches the horizontal subsampling factor. Add a test to turn VC4_SCALING_NONE into VC4_SCALING_PPF when that happens. The old ->x_scaling[0] adjustment is dropped as I couldn't find any mention to this constraint in the spec and it's proven to be unnecessary (I tested various multi-planar YUV formats with scaling disabled, and all of them worked fine without this adjustment). Fixes: fc04023fafec ("drm/vc4: Add support for YUV planes.") Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-09drm/sun4i: tcon: Support an active-low DE signal with RGB interfacePaul Kocialkowski2-1/+7
Some panels need an active-low data enable (DE) signal for the RGB interface. This requires flipping a bit in the TCON0 polarity register when setting up the mode for the RGB interface. Match the associated bus flag and use it to set the polarity inversion bit for the DE signal when required. Signed-off-by: Paul Kocialkowski <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-09drm/sun4i: tcon: Get the connector from the encoder in RGB setupPaul Kocialkowski1-12/+7
Features such as dithering and pixel data edge configuration currently rely on the panel registered with the TCON driver. However, bridges are also supported in addition to panels for RGB setup. Instead of retrieving the connector from the panel, get it from the encoder with the dedicated helper. Even in the case of bridges, the connector is registered with the encoder from our driver and is accessible when iterating connectors. Signed-off-by: Paul Kocialkowski <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-09drm/sun4i: tcon: Pass encoder to RGB setup functionPaul Kocialkowski1-1/+2
Passing the encoder to the TCON RGB setup functions allows accessing the connector from the encoder directly instead of relying on the panel. Signed-off-by: Paul Kocialkowski <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-08drm/syncobj: disable the timeline UAPI for now v2Christian König3-1/+7
Until we have sorted out all problems. v2: return -EINVAL during create if flag is set. Signed-off-by: Christian König <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/260937/
2018-11-07drm/atomic: Use explicit old/new state in drm_atomic_plane_check()Ville Syrjälä1-39/+46
Convert drm_atomic_plane_check() over to using explicit old vs. new plane states. Avoids the confusion of "what does plane->state mean again?". v2: Stick to the multi-stage logic in plane_switching_crtc() (Daniel) Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-07drm/atomic: Use explicit old/new state in drm_atomic_crtc_check()Ville Syrjälä1-11/+15
Convert drm_atomic_crtc_check() over to using explicit old vs. new crtc states. Avoids the confusion of "what does crtc->state mean again?". Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Daniel Vetter <[email protected]>
2018-11-07drm/atomic: Use explicit old crtc state in drm_atomic_add_affected_planes()Ville Syrjälä1-1/+3
Replace 'crtc->state' with the explicit old crtc state. Actually it shouldn't matter whether we use the old or the new crtc state here since any plane that has been removed from the crtc since the crtc state was duplicated will have been added to the atomic state already. That is, you can't call drm_atomic_set_crtc_for_plane() without having the new plane state already in hand. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Daniel Vetter <[email protected]> Acked-by: Harry Wentland <[email protected]>
2018-11-06drm: Add drm_any_plane_has_format()Ville Syrjälä3-0/+31
Add a function to check whether there is at least one plane that supports a specific format and modifier combination. Drivers can use this to reject unsupported formats/modifiers in .fb_create(). v2: Accept anyformat if the driver doesn't do planes (Eric) s/planes_have_format/any_plane_has_format/ (Eric) Check the modifier as well since we already have a function that does both v3: Don't do the check in the core since we may not know the modifier yet, instead export the function and let drivers call it themselves Cc: Eric Anholt <[email protected]> Cc: Dhinakaran Pandiyan <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Dhinakaran Pandiyan <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-06drm/lease: look at ->universal_planes only onceDaniel Vetter1-6/+8
It's lockless, and userspace might chance it underneath us. That's not really a problem, all userspace gets is a slightly dysfunctional lease with the current code. But this might change, and gcc might decide to reload a few too many times, and then boom. So better safe than sorry. v2: Remove the now unused lessor_priv argument from validate_lease() (Keith). v3: Actually add everything ... silly me. Cc: Keith Packard <[email protected]> Cc: Dave Airlie <[email protected]> Acked-by: Keith Packard <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-06drm/file: Uncompact the feature flagsDaniel Vetter1-7/+7
This essentially undoes commit 39868bd7668bd47308b1dfd97c212757caee764f Author: Chris Wilson <[email protected]> Date: Tue Oct 29 08:55:58 2013 +0000 drm: Compact booleans within struct drm_file We do lockless access to these flags everywhere, and it's kinda not a great idea to mix lockless and bitfields. Aside from that gcc isn't generating great code for these. If this ever becomes an issue size-wise, I think we need atomic_t here and atomic bitflag ops. Cc: Chris Wilson <[email protected]> Cc: David Herrmann <[email protected]> Cc: Dave Airlie <[email protected]> Acked-by: Chris Wilson <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-06drm/lease: debug output for lease creationDaniel Vetter1-4/+14
I spent a bit of time scratching heads and figuring out why the igts don't work. Probably useful to keep this work. Cc: Keith Packard <[email protected]> Cc: Dave Airlie <[email protected]> Acked-by: Keith Packard <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-06drm/syncobj: Fix oops on drm_syncobj_find_fence(file_priv, 0, ...).Eric Anholt1-1/+2
This broke rendering on V3D, where we almost always have a 0 in-syncobj. Signed-off-by: Eric Anholt <[email protected]> Fixes: 48197bc564c7 ("drm: add syncobj timeline support v9") Cc: Chunming Zhou <[email protected]> Cc: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Acked-by: Christian König <[email protected]> Link: https://patchwork.kernel.org/patch/10669317/ Signed-off-by: Christian König <[email protected]>
2018-11-05drm/vgem: Fix typo in driver feature flagsImre Deak1-1/+1
Fix typo in struct field initializer. Fixes: 3a6eb795641c ("drm/vgem: create a render node for vgem") Cc: Emil Velikov <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: [email protected] Signed-off-by: Imre Deak <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm/vgem: create a render node for vgemEmil Velikov1-1/+2
VGEM doesn't do anything modeset specific, so in a way exposing a primary node is 'wrong'. At the same time, we extensively use if for creating dumb buffers, fences, prime fd <> handle imports/exports. To the point that we explicitly annotate the vgem fence ioctls as DRM_RENDER_ALLOW and have an IGT test which opens the render node. close(drm_open_driver_render(DRIVER_VGEM)) Better late than never, let's flip the switch. Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm: sun4i: add support for H6 TCON TOPIcenowy Zheng1-0/+8
The TCON TOP on Allwinner H6 SoC is a cut down version of the R40 TCON TOP, which dropped TCON_TV1 and DSI (which do not exist on H6). Add support for it. Signed-off-by: Icenowy Zheng <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05dt-bindings: display: sun4i-drm: document H6 TCON TOPIcenowy Zheng1-6/+8
Allwinner H6 SoC has a cut down version of TCON TOP. Add binding documentation for it. Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Icenowy Zheng <[email protected]> [expanded description] Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm: sun4i: add quirks for TCON TOPIcenowy Zheng1-9/+28
Some SoCs, such as H6, doesn't have a full-featured TCON TOP. Add quirks support for TCON TOP. Currently the presence of TCON_TV1 and DSI is controlled via the quirks structure. Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Icenowy Zheng <[email protected]> [Fixed code style and removed unnecessary initialization] Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm/sun4i: Initialize registers in tcon-top driverJernej Skrabec1-0/+7
It turns out that TCON TOP registers in H6 SoC have non-zero reset value. This may cause issues if bits are not changed during configuration. To prevent that, initialize registers to 0. Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm/sun4i: Add support for H6 HDMI PHYJernej Skrabec1-0/+137
H6 has Synopsys DWC HDMI 2.0 TX PHY. There is no freely available documentation for it, only code found in BSP kernel. However, judging by the code, PHY is very similar to older Synopsys HDMI PHY described in i.MX6 documentation. Most registers seem to be the same. According to i.MX6 documentation, mpll settings are based on pixel clock and are not specific to each SoC. Because of that, mpll table in this commit is based on that documentation and not on BSP code. Other PHY settings were derived from BSP PHY driver code. Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm/sun4i: Add support for Synopsys HDMI PHYJernej Skrabec3-6/+24
Currently sun8i-hdmi-phy driver supports only custom PHYs connected to DW HDMI controller. Since newest Allwinner SoCs have unmodified Synopsys PHY, driver has to be reorganized to support them. Variant structure is expanded to allow differentiation between custom and Sysnopsys PHYs and to hold Synopsys PHY settings. Since DW HDMI bridge platform data has different fields for custom and Sysnopsys PHY, function sun8i_hdmi_phy_get_ops() is replaced with sun8i_hdmi_phy_set_ops(). Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm/sun4i: dw-hdmi-phy: Reorder quirks by familyJernej Skrabec1-11/+11
Currently, quirks and compatibles are sorted alphabetically. However, they should be sorted by family release date and then alphabetically. Fix that by moving A64 quirks and compatible to bottom. No functional change is made. Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm/sun4i: Add support for H6 DW HDMI controllerJernej Skrabec1-0/+19
H6 has DW HDMI 2.0b controller v2.12a. It supports 4K at 60 Hz and HDCP 2.2. Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05dt-bindings: display: sunxi: add DT binding for Allwinner H6 DW HDMIIcenowy Zheng1-2/+9
The Allwinner H6 SoC uses a v2.12a DesignWare HDMI controller, with dedicated CEC and HDCP clocks added; the PHY connected is a standard DesignWare HDMI PHY. Add binding for it. Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Icenowy Zheng <[email protected]> [added HDCP clock and reset] Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm/sun4i: dw-hdmi: Add quirk for setting TMDS clockJernej Skrabec2-1/+4
It turns out that H6 HDMI BSP kernel driver doesn't change TMDS rate at all. At this point it is not clear whether it is just not necessary or it would cause some kind of issues. Add a quirk for it. Acked-by: Maxime Ripard <[email protected]> Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm/sun4i: dw-hdmi: Make mode_valid function configurableJernej Skrabec2-4/+20
Since it is not possible to access sun8i-dw-hdmi driver private data inside mode_valid function, make it configurable. That way different versions of HDMI controllers can set different function, depending on it's limitations. Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm/sun4i: Not all DW HDMI controllers has scrambled addressesJernej Skrabec1-8/+15
Currently supported Allwinner SoCs with DW HDMI controller have scrambled addresses and read lock. However, that is not true in general. For example, A80 and H6 have normal addresses and normal read access. Move code for unscrambling addresses and unlocking read access to it's own function and call it from init function. Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm/bridge/synopsys: dw-hdmi: Enable workaround for v2.12aJernej Skrabec1-0/+1
It turns out that even new DW HDMI controllers exhibits same magenta line issues as older versions. Enable workaround for v2.12a. Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm/sun4i: Add support for H6 DE3 mixer 0Jernej Skrabec1-0/+13
Mixer 0 has 1 VI and 3 UI planes, scaler on all planes and can output 4K image @60Hz. It also support 10 bit colors, which are not yet implemented. Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm/sun4i: Add basic support for DE3Jernej Skrabec9-17/+202
Display Engine 3 is an upgrade of DE2 with new features like support for 10 bit color formats and support for AFBC. Most of DE2 code works with DE3, except some small details. Implement basic support for DE3. Support for 10 bit colort formats and AFBC, among others missing features, will be added later. Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/260238/
2018-11-05drm/sun4i: Disable unused DE2 sub-enginesJernej Skrabec2-2/+11
Some sub-engines are unused. Disable them explicitly. Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm/sun4i: Fix DE2 mixer sizeJernej Skrabec2-1/+3
DE2 mixer is always 0x6000 bytes in size on all known SoCs. While at it, introduce a macro for that. Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05drm/sun4i: Rework DE2 register definesJernej Skrabec10-159/+219
Most, if not all, registers found in DE2 still exists in DE3. However, units are on different base addresses. To prepare for addition of DE3 support, registers macros are reworked so they take base address as parameter. Signed-off-by: Jernej Skrabec <[email protected]> [rebased] Signed-off-by: Icenowy Zheng <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05dt-bindings: display: sun4i-drm: Add H6 display engine compatiblesJernej Skrabec1-1/+4
This commit adds compatibles used in H6 display pipeline, namely for display engine, mixer and TV TCON. H6 display engine is somewhat similar to R40, just less TCONs and mixer support more features. Reviewed-by: Rob Herring <[email protected]> Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-05dt-bindings: bus: add H6 DE3 bus bindingIcenowy Zheng1-3/+6
The Allwinner H6 DE3 bus is similar to the A64 DE2 one. Add its compatible string with the A64 string as fallback to the binding. Some description of the binding is modified to make it more generic. Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Icenowy Zheng <[email protected]> [Fixed compatible name] Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-02drm/lease: drop EXPORT_SYMBOLDaniel Vetter1-4/+0
Leases are entirely implemented within drm.ko, no need to even tempt drivers into doing nasty things. And if there's really a need, we can always re-export these again. Cc: Keith Packard <[email protected]> Cc: Dave Airlie <[email protected]> Acked-by: Keith Packard <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-02drm/selftests: Fix build warning -Wframe-larger-thanAlexandru-Cosmin Gheorghe1-14/+16
It seems for some random configuration drm_device is bigger than 2048 bytes. The fix is to make the mock objects static variables. Bug reported by 0-DAY Kernel test infrastructure here: https://lists.01.org/pipermail/kbuild-all/2018-November/054431.html Fixes: 6ff3d9ffdcbb ("drm/selftests: Add tests for drm_internal_framebuffer_create") Signed-off-by: Alexandru-Cosmin Gheorghe <[email protected]> Signed-off-by: Maarten Lankhorst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-02drm/selftests: Add tests for drm_internal_framebuffer_createAlexandru Gheorghe4-1/+347
Add tests that verify that drm_internal_framebuffer_create creates buffers correctly by creating a dummy drm_device with a mock function for the fb_create callback. To decide if a buffer has been created or not it just checks if fb_create callback has been called for the particular drm_mode_fb_cmd2 that's being tested. Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Alexandru Gheorghe <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-02drm: Add macro to export functions only when CONFIG_DRM_DEBUG_SELFTEST is ↵Alexandru Gheorghe2-0/+7
enabled If we want to be able to write drmselftests for non-static core functions that are not intended to be used by drivers we need this functions to be exported. This adds a macro that is tied of CONFIG_DRM_DEBUG_SELFTEST, and uses that to export drm_internal_framebuffer_create, in order for subsequent patches to be able to test it. Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Alexandru Gheorghe <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-02drm/selftests: Add tests for drm_format_info* helpersAlexandru Gheorghe4-1/+288
Add selftests for the following newly added functions: - drm_format_info_block_width - drm_format_info_block_height - drm_format_info_min_pitch Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Alexandru Gheorghe <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-02drm: Extend framebuffer_check to handle formats with cpp/char_per_block 0Alexandru Gheorghe1-1/+7
For formats that are supported only with non-linear modifiers it doesn't make to much sense to define cpp or char_per_block, so that will be set to 0. This patch adds a restriction to force having a modifier attached when cpp/char_per_block is 0, and to bypass checking the pitch restriction. This had been discussed here. [1] https://people.freedesktop.org/~cbrill/dri-log/?channel=dri-devel&highlight_names=&date=2018-09-13&show_html=true Reviewed-by: Brian Starkey <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Alexandru Gheorghe <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-02drm: mali-dp: Enable Mali-DP tiled buffer formatsAlexandru Gheorghe2-6/+36
Enable the following formats - DRM_FORMAT_X0L0: DP650 - DRM_FORMAT_X0L2: DP550, DP650 Reviewed-by: Brian Starkey <[email protected]> Signed-off-by: Alexandru Gheorghe <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-02drm/fourcc: Add fourcc for Mali linear tiled formatsAlexandru Gheorghe2-0/+26
Mali-DP implements a number of tiled yuv formats which are not currently described in drm_fourcc.h. This adds those definitions and describes their memory layout by using the newly added char_per_block, block_w, block_h. Reviewed-by: Brian Starkey <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Alexandru Gheorghe <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-02drm/fourcc: Add char_per_block, block_w and block_h in drm_format_infoAlexandru Gheorghe6-9/+148
For some pixel formats .cpp structure in drm_format info it's not enough to describe the peculiarities of the pixel layout, for example tiled formats or packed formats at bit level. What's implemented here is to add three new members to drm_format_info that could describe such formats: - char_per_block[3] - block_w[3] - block_h[3] char_per_block will be put in a union alongside cpp, for transparent compatibility with the existing format descriptions. Regarding, block_w and block_h they are intended to be used through their equivalent getters drm_format_info_block_width / drm_format_info_block_height, the reason of the getters is to abstract the fact that for normal formats block_w and block_h will be unset/0, but the methods will be returning 1. Additionally, convenience function drm_format_info_min_pitch had been added that computes the minimum required pitch for a given pixel format and buffer width. Using that the following drm core functions had been updated to generically handle both block and non-block formats: - drm_fb_cma_get_gem_addr: for block formats it will just return the beginning of the block. - framebuffer_check: Use the newly added drm_format_info_min_pitch. - drm_gem_fb_create_with_funcs: Use the newly added drm_format_info_min_pitch. - In places where is not expecting to handle block formats, like fbdev helpers I just added some warnings in case the block width/height are greater than 1. Changes since v3: - Add helper function for computing the minimum required pitch. - Improve/cleanup documentation Changes since v8: - Fixed build on 32bits arm architectures, with: - return DIV_ROUND_UP((u64)buffer_width * info->char_per_block[plane], + return DIV_ROUND_UP_ULL((u64)buffer_width * info->char_per_block[plane], Reviewed-by: Brian Starkey <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Alexandru Gheorghe <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-02drm/panel: Add simple panel mode for the ARM RTSMLinus Walleij1-0/+30
Having failed any attempts at a more generic solution, I fall back to the very specific solution: define a simple panel for the ARM RTSM emulated platforms. I am doing this so we can convert all old users from the previous fbdev driver to the PL111 DRM driver. This works fine as far as I can test, provided the device tree for RTSM AEMv8 is augmented accordingly. Cc: Sudeep Holla <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Cc: Mali DP Maintainers <[email protected]> Cc: Robin Murphy <[email protected]> Reviewed-by: Liviu Dudau <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-01drm: Remove 80-column line in drm_mode_object.cShayenne da Luz Moura1-1/+2
Break line after NULL to decrease the line size. Signed-off-by: Shayenne da Luz Moura <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-01drm/tilcdc: Use drm_fbdev_generic_setup()Noralf Trønnes1-9/+2
The CMA helper is already using the drm_fb_helper_generic_probe part of the generic fbdev emulation. This patch makes full use of the generic fbdev emulation by using its drm_client callbacks. This means that drm_mode_config_funcs->output_poll_changed and drm_driver->lastclose are now handled by the emulation code. Additionally fbdev unregister happens automatically on drm_dev_unregister(). The drm_fbdev_generic_setup() call is put after drm_dev_register() in the driver. This is done to highlight the fact that fbdev emulation is an internal client that makes use of the driver, it is not part of the driver as such. If fbdev setup fails, an error is printed, but the driver succeeds probing. Cc: Jyri Sarha <[email protected]> Cc: Tomi Valkeinen <[email protected]> Signed-off-by: Noralf Trønnes <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Jyri Sarha <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-01drm/sun4i: Use drm_fbdev_generic_setup()Noralf Trønnes3-22/+5
The CMA helper is already using the drm_fb_helper_generic_probe part of the generic fbdev emulation. This patch makes full use of the generic fbdev emulation by using its drm_client callbacks. This means that drm_mode_config_funcs->output_poll_changed and drm_driver->lastclose are now handled by the emulation code. Additionally fbdev unregister happens automatically on drm_dev_unregister(). The drm_fbdev_generic_setup() call is put after drm_dev_register() in the driver. This is done to highlight the fact that fbdev emulation is an internal client that makes use of the driver, it is not part of the driver as such. If fbdev setup fails, an error is printed, but the driver succeeds probing. Cc: Maxime Ripard <[email protected]> Signed-off-by: Noralf Trønnes <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-01drm/atmel-hlcdc: Use drm_fbdev_generic_setup()Noralf Trønnes1-5/+2
The CMA helper is already using the drm_fb_helper_generic_probe part of the generic fbdev emulation. This patch makes full use of the generic fbdev emulation by using its drm_client callbacks. This means that drm_mode_config_funcs->output_poll_changed and drm_driver->lastclose are now handled by the emulation code. Additionally fbdev unregister happens automatically on drm_dev_unregister(). The drm_fbdev_generic_setup() call is put after drm_dev_register() in the driver. This is done to highlight the fact that fbdev emulation is an internal client that makes use of the driver, it is not part of the driver as such. If fbdev setup fails, an error is printed, but the driver succeeds probing. Cc: Boris Brezillon <[email protected]> Signed-off-by: Noralf Trønnes <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Acked-by: Boris Brezillon <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]