summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* drm: bridge: dw-hdmi: Pass drm_display_info to dw_hdmi_support_scdc()Laurent Pinchart2020-06-234-14/+23
| | | | | | | | | | | | To prepare for making connector creation optional in the driver, pass the drm_display_info explicitly to dw_hdmi_support_scdc(). The pointer is passed to the callers where required, particularly to the dw_hdmi_phy_ops .init() function. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-19-laurent.pinchart+renesas@ideasonboard.com
* drm: bridge: dw-hdmi: Constify mode argument to internal functionsLaurent Pinchart2020-06-231-3/+5
| | | | | | | | | | | Several internal functions take a drm_display_mode argument to configure the HDMI encoder or the HDMI PHY. They must not modify the mode, make the pointer const to enforce that. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-18-laurent.pinchart+renesas@ideasonboard.com
* drm: bridge: dw-hdmi: Constify mode argument to dw_hdmi_phy_ops .init()Laurent Pinchart2020-06-234-5/+5
| | | | | | | | | | The PHY .init() must not modify the mode it receives. Make the pointer const to enfore that. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-17-laurent.pinchart+renesas@ideasonboard.com
* drm: bridge: dw-hdmi: Pass drm_display_info to .mode_valid()Laurent Pinchart2020-06-237-20/+19
| | | | | | | | | | | | | Replace the drm_connector pointer passed to the .mode_valid() function with a const drm_display_info pointer, as that's all the function should need. Use the display info passed to the bridge .mode_valid() operation instead of retrieving it from the connector, to prepare for make connector creation optional. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-16-laurent.pinchart+renesas@ideasonboard.com
* drm: meson: dw-hdmi: Use dw_hdmi context to replace hackLaurent Pinchart2020-06-231-2/+4
| | | | | | | | | | | | The meson-dw-hdmi driver needs to access its own context from the .mode_valid() operation. It currently gets it from the dev_private field of the drm_device retrieved from the connector, which is a hack. Use the private data passed to the .mode_valid() operation instead. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-15-laurent.pinchart+renesas@ideasonboard.com
* drm: bridge: dw-hdmi: Remove unused field from dw_hdmi_plat_dataLaurent Pinchart2020-06-231-4/+1
| | | | | | | | | | The input_bus_format field of struct dw_hdmi_plat_data is unused. Remove it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-14-laurent.pinchart+renesas@ideasonboard.com
* drm: bridge: dw-hdmi: Pass private data pointer to .configure_phy()Laurent Pinchart2020-06-232-3/+2
| | | | | | | | | | | | | The .configure_phy() operation takes a dw_hdmi_plat_data pointer as a context argument. This differs from .mode_valid() that takes a custom private context pointer, causing possible confusion. Make the dw_hdmi_plat_data operations more consistent by passing the private context pointer to .configure_phy() as well. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-13-laurent.pinchart+renesas@ideasonboard.com
* drm: bridge: dw-hdmi: Pass private data pointer to .mode_valid()Laurent Pinchart2020-06-237-10/+20
| | | | | | | | | | | | | | | Platform glue drivers for dw_hdmi may need to access device-specific data from their .mode_valid() implementation. They currently have no clean way to do so, and one driver hacks around it by accessing the dev_private data of the drm_device retrieved from the connector. Add a priv_data void pointer to the dw_hdmi_plat_data structure, and pass it to the .mode_valid() function. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-12-laurent.pinchart+renesas@ideasonboard.com
* drm: bridge: Pass drm_display_info to drm_bridge_funcs .mode_valid()Laurent Pinchart2020-06-2320-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When validating a mode, bridges may need to do so in the context of a display, as specified by drm_display_info. An example is the meson dw-hdmi bridge that needs to consider the YUV 4:2:0 output format to perform clock calculations. Bridges that need the display info currently retrieve it from the drm_connector created by the bridge. This gets in the way of moving connector creation out of bridge drivers. To make this possible, pass the drm_display_info to drm_bridge_funcs .mode_valid(). Changes to the bridge drivers have been performed with the following coccinelle semantic patch and have been compile-tested. @ rule1 @ identifier funcs; identifier fn; @@ struct drm_bridge_funcs funcs = { ..., .mode_valid = fn }; @ depends on rule1 @ identifier rule1.fn; identifier bridge; identifier mode; @@ enum drm_mode_status fn( struct drm_bridge *bridge, + const struct drm_display_info *info, const struct drm_display_mode *mode ) { ... } Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Guido Günther <agx@sigxcpu.org> # for the nwl-dsi part: Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-11-laurent.pinchart+renesas@ideasonboard.com
* drm: edid: Constify connector argument to infoframe functionsLaurent Pinchart2020-06-231-6/+6
| | | | | | | | | | | | The drm_hdmi_avi_infoframe_from_display_mode(), drm_hdmi_vendor_infoframe_from_display_mode() and drm_hdmi_avi_infoframe_quant_range() functions take a drm_connector that they don't modify. Mark it as const. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-10-laurent.pinchart+renesas@ideasonboard.com
* drm: bridge: simple-bridge: Make connector creation optionalLaurent Pinchart2020-06-231-7/+4
| | | | | | | | | | Make the connector creation optional to enable usage of the simple-bridge with the DRM bridge connector helper. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-8-laurent.pinchart+renesas@ideasonboard.com
* drm: bridge: simple-bridge: Delegate operations to next bridgeLaurent Pinchart2020-06-231-65/+39
| | | | | | | | | | | | Instead of poking into the DT node of the next bridge for its DDC bus and implementing the .get_modes() and .detect() connector operations manually, retrieve the next bridge in the chain and delegate these operations to it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-7-laurent.pinchart+renesas@ideasonboard.com
* drm: bridge: Return NULL on error from drm_bridge_get_edid()Laurent Pinchart2020-06-232-6/+10
| | | | | | | | | | | | | The drm_bridge_get_edid() function is documented to return an error pointer on error. The underlying .get_edid() operation, however, returns NULL on error, and so do the drm_get_edid() and drm_do_get_edid() functions upon which .get_edid() is usually implemented. Make drm_bridge_get_edid() return NULL on error to be consistent. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-6-laurent.pinchart+renesas@ideasonboard.com
* drm: bridge: adv7511: Make connector creation optionalLaurent Pinchart2020-06-231-8/+5
| | | | | | | | | | | Now that the driver supports all the connector-related bridge operations, make the connector creation optional. This enables usage of the adv7511 with the DRM bridge connector helper. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-5-laurent.pinchart+renesas@ideasonboard.com
* drm: bridge: adv7511: Implement bridge connector operationsLaurent Pinchart2020-06-231-4/+39
| | | | | | | | | | | | | | | | | | | | | | | Implement the bridge connector-related .get_edid(), .detect() and .hpd_notify() operations, and report the related bridge capabilities. Output status detection is implemented using the same backend as for the DRM connector, but requires making mode retrieval at detection time optional as no pointer to the connector is available to the bridge .detect() operation. The reason for the need to retrieve modes at detection time is unclear to me, and this may benefit from further refactoring of hot plug handling code. Hot plug detection is notified through the bridge HPD notification framework when the bridge is used without creating a connector, and falls back to the existing implementation otherwise. CEC handling of disconnection is handled in the new .hpd_notify() operation in the new code path. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-4-laurent.pinchart+renesas@ideasonboard.com
* drm: bridge: adv7511: Split connector creation to a separate functionLaurent Pinchart2020-06-231-22/+40
| | | | | | | | | | To prepare for making the connector creation optional, move the related code out of adv7511_bridge_attach() to a separate function. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-3-laurent.pinchart+renesas@ideasonboard.com
* drm: bridge: adv7511: Split EDID read to a separate functionLaurent Pinchart2020-06-231-7/+16
| | | | | | | | | | | To prepare for the implementation of the DRM bridge connector operations, move EDID read out of adv7511_get_modes() to a separate function. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-2-laurent.pinchart+renesas@ideasonboard.com
* drm/mm/selftests: fix wrong return type castingNirmoy Das2020-06-231-14/+7
| | | | | | | | | | | | | | | Function prepare_igt_frag() and get_insert_time() were casting signed value to unsigned value before returning error. So error check in igt_frag() would not work with unsigned return value from get_insert_time() compared against negative value. Addresses-Coverity: ("Unsigned compared against 0, no effect") Signed-off-by: Nirmoy Das <nirmoy.das@amd.com> Reported-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/370636/
* drm/mm: cleanup and improve next_hole_*_addr()Christian König2020-06-231-72/+34
| | | | | | | | | | | | | | | Skipping just one branch of the tree is not the most effective approach. Instead use a macro to define the traversal functions and sort out both branch sides. This improves the performance of the unit tests by a factor of more than 4. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Nirmoy Das <nirmoy.das@amd.com> Link: https://patchwork.freedesktop.org/patch/370298/
* drm/mm: optimize find_hole() as wellChristian König2020-06-232-15/+7
| | | | | | | | Abort early if there isn't enough space to allocate from a subtree. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Nirmoy Das <nirmoy.das@amd.com> Link: https://patchwork.freedesktop.org/patch/370297/
* drm/mm: remove unused rb_hole_size()Christian König2020-06-231-5/+0
| | | | | | | | Just some code cleanup. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Nirmoy Das <nirmoy.das@amd.com> Link: https://patchwork.freedesktop.org/patch/370296/
* drm/ast: Use per-device logging macrosThomas Zimmermann2020-06-224-30/+34
| | | | | | | | | | | | | Converts the ast driver to drm_info(), drm_err() and drm_WARN_*(). No functional changes are made. v2: * also convert WARN_*() macros Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200617080340.29584-5-tzimmermann@suse.de
* drm/ast: Upcast from DRM device to ast structure via to_ast_private()Thomas Zimmermann2020-06-225-46/+50
| | | | | | | | | | | | | | | | All upcasting from struct drm_device to struct ast_private is now performed via to_ast_private(). Using struct drm_device.dev_private is deprecated. The ast variable in ast_crtc_helper_atomic_check() is unused, so removed it. v2: * fix typo in commit message Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200617080340.29584-4-tzimmermann@suse.de
* drm/ast: Remove test for device from ast_pm_freeze()Thomas Zimmermann2020-06-221-3/+0
| | | | | | | | | | | | The driver cannot suspend before it has loaded completely. So the test for device pointers is not required. Remove it. v3: * s/them/it/ in commit message Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200617080340.29584-3-tzimmermann@suse.de
* drm/ast: Remove unused code paths for AST 1180Thomas Zimmermann2020-06-225-69/+43
| | | | | | | | | | | The ast driver contains code paths for AST 1180 chips. The chip is not supported and the rsp code has never been tested. Simplify the driver by removing the AST 1180 code. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200617080340.29584-2-tzimmermann@suse.de
* drm/panel: simple: add Tianma TM070JVHG33Max Merchel2020-06-211-0/+15
| | | | | | | | | | Add support for the Tianma Micro-electronics TM070JVHG33 7.0" WXGA display to panel-simple. Signed-off-by: Max Merchel <Max.Merchel@tq-group.com> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200612072219.13669-5-matthias.schiffer@ew.tq-group.com
* drm/panel: simple: add CDTech S070PWS19HP-FC21 and S070SWV29HG-DC44Michael Krummsdorf2020-06-211-0/+60
| | | | | | | | | | Add support for the CDTech Electronics displays S070PWS19HP-FC21 (7.0" WSVGA) and S070SWV29HG-DC44 (7.0" WVGA) to panel-simple. Signed-off-by: Michael Krummsdorf <michael.krummsdorf@tq-group.com> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200612072219.13669-4-matthias.schiffer@ew.tq-group.com
* drm/bridge: tfp410: Fix setup and hold time calculationRicardo Cañuelo2020-06-201-2/+2
| | | | | | | | | | This fixes a bug in the calculation of the setup and hold times based on the deskew configuration. Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200617094633.19663-5-ricardo.canuelo@collabora.com
* drm/bridge: tfp410: fix de-skew value retrieval from DTRicardo Cañuelo2020-06-201-5/+5
| | | | | | | | | | | | | | | | The tfp410 has a data de-skew feature that allows the user to compensate the skew between IDCK and the pixel data and control signals. In the driver, the setup and hold times are calculated from the de-skew value. This retrieves the deskew value from the DT using the proper datatype and range check as described by the binding (u32 from 0 to 7). This fix results from a change in the ti,tfp410 DT binding. Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200617094633.19663-4-ricardo.canuelo@collabora.com
* drm/panel-simple: Add missing connector type for some panelsDmitry Osipenko2020-06-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DRM panel bridge core requires connector type to be set up properly, otherwise it rejects the panel. The missing connector type problem popped up while I was trying to wrap CLAA070WP03XG panel into a DRM bridge in order to test whether panel's rotation property work properly using panel-simple driver on NVIDIA Tegra30 Nexus 7 tablet device, which uses CLAA070WP03XG display panel. The NVIDIA Tegra DRM driver recently gained DRM bridges support for the RGB output and now driver wraps directly-connected panels into DRM bridge. Hence all panels should have connector type set properly now, otherwise the panel's wrapping fails. This patch adds missing connector types for the LVDS panels that are found on NVIDIA Tegra devices: 1. AUO B101AW03 2. Chunghwa CLAA070WP03XG 3. Chunghwa CLAA101WA01A 4. Chunghwa CLAA101WB01 5. EDT ET057090DHU 6. Innolux N156BGE L21 7. Samsung LTN101NT05 Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200617222703.17080-8-digetx@gmail.com
* drm/panel: otm8009a: Drop unnessary backlight_device_unregister()Wei Yongjun2020-06-201-1/+0
| | | | | | | | | | | It's not necessary to unregister backlight device which registered with devm_backlight_device_register(). Fixes: 12a6cbd4f3f1 ("drm/panel: otm8009a: Use new backlight API") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200618134650.44311-1-weiyongjun1@huawei.com
* drm/arm: fix unintentional integer overflow on left shiftColin Ian King2020-06-191-1/+1
| | | | | | | | | | | | | | Shifting the integer value 1 is evaluated using 32-bit arithmetic and then used in an expression that expects a long value leads to a potential integer overflow. Fix this by using the BIT macro to perform the shift to avoid the overflow. Addresses-Coverity: ("Unintentional integer overflow") Fixes: ad49f8602fe8 ("drm/arm: Add support for Mali Display Processors") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200618100400.11464-1-colin.king@canonical.com
* drm: drm_fourcc: add NV15, Q410, Q401 YUV formatsBen Davis2020-06-191-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DRM_FORMAT_NV15 is a 2 plane format suitable for linear and 16x16 block-linear memory layouts (DRM_FORMAT_MOD_SAMSUNG_16_16_TILE). The format is similar to P010 with 4:2:0 sub-sampling but has no padding between components. Instead, luminance and chrominance samples are grouped into 4s so that each group is packed into an integer number of bytes: YYYY = UVUV = 4 * 10 bits = 40 bits = 5 bytes The '15' suffix refers to the optimum effective bits per pixel which is achieved when the total number of luminance samples is a multiple of 8. Q410 and Q401 are both 3 plane non-subsampled formats with 16 bits per component, but only 10 bits are used and 6 are padded. 'Q' is chosen as the first letter to denote 3 plane YUV444, (and is the next letter along from P which is usually 2 plane). V2: Updated block_w of NV15 to {4, 2, 0} V3: Updated commit message to include specific modifier name NV15: Tested-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Brian Starkey <brian.starkey@arm.com> Signed-off-by: Ben Davis <ben.davis@arm.com> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200601162817.18230-1-ben.davis@arm.com
* drm/panfrost: Use kvfree() to free bo->sgtsDenis Efremov2020-06-192-2/+2
| | | | | | | | | | | | Use kvfree() to free bo->sgts, because the memory is allocated with kvmalloc_array() in panfrost_mmu_map_fault_addr(). Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations") Cc: stable@vger.kernel.org Signed-off-by: Denis Efremov <efremov@linux.com> Reviewed-by: Steven Price <steven.price@arm.com> Signed-off-by: Steven Price <steven.price@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200608151728.234026-1-efremov@linux.com
* drm/panfrost: Fix runtime PM imbalance on errorDinghao Liu2020-06-191-1/+0
| | | | | | | | | | | | The caller expects panfrost_job_hw_submit() to increase runtime PM usage counter. The refcount decrement on the error branch of WARN_ON() will break the counter balance and needs to be removed. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Reviewed-by: Steven Price <steven.price@arm.com> Signed-off-by: Steven Price <steven.price@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200522134109.27204-1-dinghao.liu@zju.edu.cn
* drm/panfrost: Fix inbalance of devfreq record_busy/idle()Steven Price2020-06-191-2/+3
| | | | | | | | | | | | | | | | | | | | | | | The calls to panfrost_devfreq_record_busy() and panfrost_devfreq_record_idle() must be balanced to ensure that the devfreq utilisation is correctly reported. But there are two cases where this doesn't work correctly. In panfrost_job_hw_submit() if pm_runtime_get_sync() fails or the WARN_ON() fires then no call to panfrost_devfreq_record_busy() is made, but when the job times out the corresponding _record_idle() call is still made in panfrost_job_timedout(). Move the call up to ensure that it always happens. Secondly panfrost_job_timedout() only makes a single call to panfrost_devfreq_record_idle() even if it is cleaning up multiple jobs. Move the call inside the loop to ensure that the number of _record_idle() calls matches the number of _record_busy() calls. Fixes: 9e62b885f715 ("drm/panfrost: Simplify devfreq utilisation tracking") Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Signed-off-by: Steven Price <steven.price@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200522153653.40754-1-steven.price@arm.com
* drm/bridge: ti-sn65dsi86: Check the regmap return value when setting a GPIODouglas Anderson2020-06-181-0/+3
| | | | | | | | | | | | | | | The ti_sn_bridge_gpio_set() got the return value of regmap_update_bits() but didn't check it. The function can't return an error value, but we should at least print a warning if it didn't work. This fixes a compiler warning about setting "ret" but not using it. Fixes: 27ed2b3f22ed ("drm/bridge: ti-sn65dsi86: Export bridge GPIOs to Linux") Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200612123003.v2.4.Ia4376fd88cdc6e8f8b43c65548458305f82f1d61@changeid
* drm/bridge: ti-sn65dsi86: Fix kernel-doc typo ln_polr => ln_polrsDouglas Anderson2020-06-181-1/+1
| | | | | | | | | | | This fixes a kernel doc warning due to a typo: warning: Function parameter or member 'ln_polrs' not described in 'ti_sn_bridge' Fixes: 5bebaeadb30e ("drm/bridge: ti-sn65dsi86: Implement lane reordering + polarity") Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200612123003.v2.3.Ib616e311c48cc64b2cef11bd54d4a9cedc874bb1@changeid
* drm/bridge: ti-sn65dsi86: Don't use kernel-doc comment for local arrayDouglas Anderson2020-06-181-1/+1
| | | | | | | | | | | | | | | When building we were getting an error: warning: cannot understand function prototype: 'const unsigned int ti_sn_bridge_dp_rate_lut[] = ' Arrays aren't supposed to be marked with "/**" kerneldoc comments. Fix. Fixes: a095f15c00e2 ("drm/bridge: add support for sn65dsi86 bridge driver") Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200612123003.v2.2.If3807e4ebf7f0440f64c3069edcfac9a70171940@changeid
* drm/bridge: ti-sn65dsi86: Don't compile GPIO bits if not CONFIG_OF_GPIODouglas Anderson2020-06-181-0/+13
| | | | | | | | | | | | | | | | | | The kernel test robot noted that if "OF" is defined (which is needed to select DRM_TI_SN65DSI86 at all) but not OF_GPIO that we'd get compile failures because some of the members that we access in "struct gpio_chip" are only defined "#if defined(CONFIG_OF_GPIO)". All the GPIO bits in the driver are all nicely separated out. We'll guard them with the same "#if defined" that the header has and add a little stub function if OF_GPIO is not defined. Fixes: 27ed2b3f22ed ("drm/bridge: ti-sn65dsi86: Export bridge GPIOs to Linux") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200612123003.v2.1.Ibe95d8f3daef01e5c57d4c8c398f04d6a839492c@changeid
* drm/panfrost: Reduce the amount of logs on deferred probeKrzysztof Kozlowski2020-06-181-4/+4
| | | | | | | | | | | | | There is no point to print deferred probe (and its failures to get resources) as an error. Also there is no need to print regulator errors twice. In case of multiple probe tries this would pollute the dmesg. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Steven Price <steven.price@arm.com> Signed-off-by: Steven Price <steven.price@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200527200544.7849-1-krzk@kernel.org
* drm/rockchip: Add per-pixel alpha support for the PX30 VOPPaul Kocialkowski2020-06-173-0/+16
| | | | | | | | | | | | | | Compared to its predecessors, the PX30 VOP has a different register layout for enabling per-pixel alpha. Instead of src_alpha_ctl and dst_alpha_ctl, there is a single alpha control register. This register takes some fields from src_alpha_ctl, but with a different layout. Add support for the required fields to the PX30 VOP window descriptions, which makes per-pixel-alpha formats behave correctly. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20200416140526.262533-1-paul.kocialkowski@bootlin.com
* drm/shmem-helper: Only dma-buf imports are private objDaniel Vetter2020-06-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I broke that in my refactoring: commit 7d2cd72a9aa3df3604cafd169a2d4a525afb68ca Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Fri May 29 16:05:42 2020 +0200 drm/shmem-helpers: Simplify dma-buf importing I'm not entirely sure of the history here, but I suspect that in one of the rebases or when applying the patch I moved the hunk from drm_gem_shmem_prime_import_sg_table(), where it should be, to drm_gem_shmem_create_with_handle(), which is totally wrong. Remedy this. Thanks for Thomas for the crucial hint in debugging this. Tested-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Reported-by: Thomas Zimmermann <tzimmermann@suse.de> Fixes: 7d2cd72a9aa3 ("drm/shmem-helpers: Simplify dma-buf importing") Cc: Boris Brezillon <boris.brezillon@collabora.com> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Rob Herring <robh@kernel.org> Cc: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200616114723.2363268-1-daniel.vetter@ffwll.ch
* drm/shmem-helper: Fix obj->filp derefenceDaniel Vetter2020-06-161-9/+11
| | | | | | | | | | | | | | | | | | | | | | I broke that in my refactoring: commit 7d2cd72a9aa3df3604cafd169a2d4a525afb68ca Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Fri May 29 16:05:42 2020 +0200 drm/shmem-helpers: Simplify dma-buf importing Tested-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Reported-by: Thomas Zimmermann <tzimmermann@suse.de> Fixes: 7d2cd72a9aa3 ("drm/shmem-helpers: Simplify dma-buf importing") Cc: Boris Brezillon <boris.brezillon@collabora.com> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Rob Herring <robh@kernel.org> Cc: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200615151026.2339113-1-daniel.vetter@ffwll.ch
* drm/kselftest: fix spellint typo in test-drm_mm.cMasanari Iida2020-06-161-1/+1
| | | | | | | | This patch fix a spelling typo in test-drm_mm.c Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20200615121151.1557985-1-standby24x7@gmail.com
* drm/ast: Use managed pci functionsDaniel Vetter2020-06-162-10/+3
| | | | | | | | | | | | | | | | | Allows us to remove a bit of cleanup code. Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Emil Velikov <emil.velikov@collabora.com> Cc: "Noralf Trønnes" <noralf@tronnes.org> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: "Christian König" <christian.koenig@amd.com> Cc: "Y.C. Chen" <yc_chen@aspeedtech.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-58-daniel.vetter@ffwll.ch
* drm/malidp: convert platform driver to use dev_groupsEmil Velikov2020-06-151-21/+6
| | | | | | | | | | | | | | | Platform drivers now have the option to have the platform core create and remove any needed sysfs attribute files. So take advantage of that and do not register "by hand" a sysfs file. Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: Brian Starkey <brian.starkey@arm.com> Cc: Mali DP Maintainers <malidp@foss.arm.com> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Liviu Dudau <liviu.dudau@arm.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200517193655.3895087-2-emil.l.velikov@gmail.com
* drm/arm: Kconfig annotate drivers as COMPILE_TESTEmil Velikov2020-06-151-2/+2
| | | | | | | | | | | | | | Add the COMPILE_TEST conditional, so that people can at least build test the drivers. Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: Brian Starkey <brian.starkey@arm.com> Cc: Mali DP Maintainers <malidp@foss.arm.com> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Liviu Dudau <liviu.dudau@arm.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200517193655.3895087-1-emil.l.velikov@gmail.com
* drm/auth: make drm_{set,drop}master_ioctl symmetricalEmil Velikov2020-06-151-5/+7
| | | | | | | | | | | | | | | | | Currently the ret handling is all over the place - with two redundant assignments and another one addressed earlier. Use the exact same flow in both functions. v2: straighten the code flow, instead of just removing the assignments Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Colin Ian King <colin.king@canonical.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200530124640.4176323-2-emil.l.velikov@gmail.com
* drm: vmwgfx: remove drm_driver::master_set() return typeEmil Velikov2020-06-152-30/+10
| | | | | | | | | | | | | | | | | | | | The function always returns zero (success). Ideally we'll remove it all together - although that's requires a little more work. For now, we can drop the return type and simplify the drm core code surrounding it. v2: remove redundant assignment (Sam) Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: VMware Graphics <linux-graphics-maintainer@vmware.com> Cc: Roland Scheidegger <sroland@vmware.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Cc: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200530124640.4176323-1-emil.l.velikov@gmail.com