[Bug 104285] Euro Truck Simulator 2 and American Truck Simulator artifacts (Mesa 17.3, AMD R9 280X)
https://bugs.freedesktop.org/show_bug.cgi?id=104285 Alex Vorobyev changed: What|Removed |Added Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #11 from Alex Vorobyev --- Can confirm that with LLVM 6 and Mesa 18.0.2 artifacts are gone. Marking this as resolved. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v4 3/3] [DO NOT MERGE] arm: dts: sun8i: bpi-m2m: Add DSI display
Hi Maxime, I love your patch! Yet something to improve: [auto build test ERROR on ] url: https://github.com/0day-ci/linux/commits/Maxime-Ripard/drm-panel-Add-Ilitek-ILI9881c-controller-driver/20180505-104031 base: config: arm-at91_dt_defconfig (attached as .config) compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=arm All errors (new ones prefixed by >>): >> Error: arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts:136.1-6 Label or path >> dphy not found >> Error: arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts:140.1-5 Label or path >> dsi not found >> FATAL ERROR: Syntax error parsing input tree --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v4 2/3] drm/panel: Add Ilitek ILI9881c panel driver
Hi Maxime, I love your patch! Perhaps something to improve: [auto build test WARNING on ] url: https://github.com/0day-ci/linux/commits/Maxime-Ripard/drm-panel-Add-Ilitek-ILI9881c-controller-driver/20180505-104031 base: reproduce: # apt-get install sparse make ARCH=x86_64 allmodconfig make C=1 CF=-D__CHECK_ENDIAN__ sparse warnings: (new ones prefixed by >>) >> drivers/gpu/drm/panel/panel-ilitek-ili9881c.c:303:62: sparse: incorrect type >> in initializer (different modifiers) @@expected struct ili9881c_instr >> *instr @@got structstruct ili9881c_instr *instr @@ drivers/gpu/drm/panel/panel-ilitek-ili9881c.c:303:62:expected struct ili9881c_instr *instr drivers/gpu/drm/panel/panel-ilitek-ili9881c.c:303:62:got struct ili9881c_instr const * drivers/gpu/drm/panel/panel-ilitek-ili9881c.c: In function 'ili9881c_prepare': drivers/gpu/drm/panel/panel-ilitek-ili9881c.c:303:34: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] struct ili9881c_instr *instr = &ili9881c_init[i]; ^ vim +303 drivers/gpu/drm/panel/panel-ilitek-ili9881c.c 284 285 static int ili9881c_prepare(struct drm_panel *panel) 286 { 287 struct ili9881c *ctx = panel_to_ili9881c(panel); 288 unsigned int i; 289 int ret; 290 291 /* Power the panel */ 292 gpiod_set_value(ctx->power, 1); 293 msleep(5); 294 295 /* And reset it */ 296 gpiod_set_value(ctx->reset, 1); 297 msleep(20); 298 299 gpiod_set_value(ctx->reset, 0); 300 msleep(20); 301 302 for (i = 0; i < ARRAY_SIZE(ili9881c_init); i++) { > 303 struct ili9881c_instr *instr = &ili9881c_init[i]; 304 305 if (instr->op == ILI9881C_SWITCH_PAGE) 306 ret = ili9881c_switch_page(ctx, instr->arg.page); 307 else if (instr->op == ILI9881C_COMMAND) 308 ret = ili9881c_send_cmd_data(ctx, instr->arg.cmd.cmd, 309 instr->arg.cmd.data); 310 311 if (ret) 312 return ret; 313 } 314 315 ret = ili9881c_switch_page(ctx, 0); 316 if (ret) 317 return ret; 318 319 ret = mipi_dsi_dcs_set_tear_on(ctx->dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK); 320 if (ret) 321 return ret; 322 323 mipi_dsi_dcs_exit_sleep_mode(ctx->dsi); 324 if (ret) 325 return ret; 326 327 return 0; 328 } 329 --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 104001] GPU driver hung when start steam client while playback video on Youtube (it occurs on latest staging kernel)
https://bugs.freedesktop.org/show_bug.cgi?id=104001 --- Comment #33 from mikhail.v.gavri...@gmail.com --- (In reply to Marek Olšák from comment #32) > The patch is already backported in the 18.0 branch: > https://cgit.freedesktop.org/mesa/mesa/log/?h=18.0 How I can sure what patch already applied in my mesa? -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 104001] GPU driver hung when start steam client while playback video on Youtube (it occurs on latest staging kernel)
https://bugs.freedesktop.org/show_bug.cgi?id=104001 --- Comment #34 from mikhail.v.gavri...@gmail.com --- Created attachment 139363 --> https://bugs.freedesktop.org/attachment.cgi?id=139363&action=edit my si_pipe.c file -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 199025] Suspend hangs. Never fully suspends and impossible to return to running state.
https://bugzilla.kernel.org/show_bug.cgi?id=199025 Patrice Poly (p.pol...@free.fr) changed: What|Removed |Added CC||p.pol...@free.fr --- Comment #19 from Patrice Poly (p.pol...@free.fr) --- Hello, I am having the exact same issue on an intel Q6600 , under fedora 28 , kernel : 4.16.5-300.fc28.x86_64 In a fresh Fedora 28 install, ( which has runlevel 5 as default ) suspend blanks the screen and disables any input, forcing to a hard restart using the power button. Reproductible : always I am using nouveau : Name : xorg-x11-drv-nouveau Epoch: 1 Version : 1.0.15 Release : 4.fc28 Arch : x86_64 Size : 229 k Source : xorg-x11-drv-nouveau-1.0.15-4.fc28.src.rpm Repo : @System From repo: anaconda Summary : Xorg X11 nouveau video driver for NVIDIA graphics chipsets URL : http://www.x.org License : MIT Description : X.Org X11 nouveau video driver. Setting runlevel defaults to 3 and launching x with startx fixes the issue, which is perfectly acceptable for me as a workaround. Thank you very much @todd for the hint. I'd be glad to provide additional info if it can help. -- You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 104001] GPU driver hung when start steam client while playback video on Youtube (it occurs on latest staging kernel)
https://bugs.freedesktop.org/show_bug.cgi?id=104001 --- Comment #35 from mikhail.v.gavri...@gmail.com --- Looks like my si_pipe.c already patched. But my GPU still hangs when I try pass one and the same place in the game Rise of Tomb Rider. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 104001] GPU driver hung when start steam client while playback video on Youtube (it occurs on latest staging kernel)
https://bugs.freedesktop.org/show_bug.cgi?id=104001 --- Comment #36 from mikhail.v.gavri...@gmail.com --- Created attachment 139364 --> https://bugs.freedesktop.org/attachment.cgi?id=139364&action=edit Here GPU VEGA always hungs -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 199025] Suspend hangs. Never fully suspends and impossible to return to running state.
https://bugzilla.kernel.org/show_bug.cgi?id=199025 --- Comment #20 from Patrice (p.pol...@free.fr) --- the video card is a GeForce GTS 250 -- You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/syncobj: Use dma_fence_wait for the simple wait case
When waiting for a single fence beneath a syncobj, forgo our open coding for waiting over multiple fences and call the driver specific dma_fence_wait_timeout(). This gives the opportunity for the driver to handle it more efficiently then the lcd of signal callbacks, and avoids the temporary allocations and array iterations. Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_syncobj.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index d4f4ce484529..c0f787f7a298 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -695,6 +695,14 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs, signed long ret; uint32_t signaled_count, i; + /* KISS for the common case of waiting for a single submitted fence. */ + if (count == 1 && (fence = drm_syncobj_fence_get(syncobjs[0]))) { + ret = dma_fence_wait_timeout(fence, true, timeout); + dma_fence_put(fence); + *idx = 0; + return ret; + } + entries = kcalloc(count, sizeof(*entries), GFP_KERNEL); if (!entries) return -ENOMEM; -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [BUG] drm/vc4: vblank wait timed out
On Sat, 5 May 2018 13:47:25 +0200 (CEST) Stefan Wahren wrote: > Hi, > > after submit of the latest bcm2835 clock fixes, i thought this issue has been > fixed. But i've seen this issue with current mainline 4.17-rc3 > (bcm2835_defconfig) on Raspberry Pi 1 B (using U-Boot TFTP Boot). Strangly i > couldn't reproduce this issue with same kernel but using only the Foundation > bootloader (without U-Boot TFTP Boot). > > U-Boot version: 2018.03 > > I triggered the warning using my HDMI switch: > > [ 198.304572] [ cut here ] > [ 198.304693] WARNING: CPU: 0 PID: 10 at > drivers/gpu/drm/drm_atomic_helper.c:1351 > drm_atomic_helper_wait_for_vblanks+0x1d4/0x1f0 > [ 198.304703] [CRTC:68:crtc-2] vblank wait timed out > [ 198.304751] Modules linked in: bcm2835_rng rng_core vchiq(C) > [ 198.304790] CPU: 0 PID: 10 Comm: kworker/0:1 Tainted: G C > 4.17.0-rc3+ #1 > [ 198.304796] Hardware name: BCM2835 > [ 198.304817] Workqueue: events output_poll_execute > [ 198.304867] [] (unwind_backtrace) from [] > (show_stack+0x20/0x24) > [ 198.304934] [] (show_stack) from [] > (dump_stack+0x20/0x28) > [ 198.304971] [] (dump_stack) from [] (__warn+0xec/0x104) > [ 198.305012] [] (__warn) from [] > (warn_slowpath_fmt+0x48/0x50) > [ 198.305048] [] (warn_slowpath_fmt) from [] > (drm_atomic_helper_wait_for_vblanks+0x1d4/0x1f0) > [ 198.305098] [] (drm_atomic_helper_wait_for_vblanks) from > [] (vc4_atomic_complete_commit+0x80/0xb8) > [ 198.305144] [] (vc4_atomic_complete_commit) from [] > (vc4_atomic_commit+0x110/0x11c) > [ 198.305174] [] (vc4_atomic_commit) from [] > (drm_atomic_commit+0x50/0x60) > [ 198.305202] [] (drm_atomic_commit) from [] > (restore_fbdev_mode_atomic+0x80/0x1cc) > [ 198.305228] [] (restore_fbdev_mode_atomic) from [] > (restore_fbdev_mode+0x38/0x144) > [ 198.305270] [] (restore_fbdev_mode) from [] > (drm_fb_helper_restore_fbdev_mode_unlocked+0x58/0x8c) > [ 198.305296] [] (drm_fb_helper_restore_fbdev_mode_unlocked) from > [] (drm_fb_helper_set_par+0x54/0x60) > [ 198.305320] [] (drm_fb_helper_set_par) from [] > (drm_fb_helper_hotplug_event+0xc8/0xd4) > [ 198.305343] [] (drm_fb_helper_hotplug_event) from [] > (drm_fb_helper_output_poll_changed+0x1c/0x20) > [ 198.305382] [] (drm_fb_helper_output_poll_changed) from > [] (drm_kms_helper_hotplug_event+0x34/0x38) > [ 198.305409] [] (drm_kms_helper_hotplug_event) from [] > (output_poll_execute+0x16c/0x17c) > [ 198.305440] [] (output_poll_execute) from [] > (process_one_work+0x1e0/0x368) > [ 198.305466] [] (process_one_work) from [] > (worker_thread+0x2a0/0x418) > [ 198.305511] [] (worker_thread) from [] > (kthread+0x144/0x15c) > [ 198.305539] [] (kthread) from [] > (ret_from_fork+0x14/0x2c) > [ 198.305549] Exception stack(0xc9939fb0 to 0xc9939ff8) > [ 198.305562] 9fa0: > > [ 198.305578] 9fc0: > > [ 198.305591] 9fe0: 0013 > [ 198.305630] ---[ end trace 9c4071c657268b83 ]--- > > I also dumped clk_summary in both cases, but they were identical. > > Are their any helpful information, which i can provide? I doubt this will fix your problem, but can you try with this patch [1] applied? Also, is u-boot touching PLLH or anything related to HDMI? [1]https://patchwork.kernel.org/patch/10207159/ ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 0/8] R-Car DU: Support CRC calculation
Hi Daniel, (CC'ing Mauro) On Thursday, 3 May 2018 16:45:36 EEST Daniel Vetter wrote: > On Thu, May 3, 2018 at 2:06 PM, Laurent Pinchart wrote: > > Hi Dave, > > > > Ping ? > > Not aware of any crc core work going on in drm, so has my ack. Thank you. > Worst case we do a topic branch or something like that (since I guess you'll > do a pull request anyway on the v4l side). That would unfortunately not be possible, as Mauro cherry-picks patches instead of merging pull requests. In rare cases I can ask for a pull-request to be merged as-is, but it's too late in this case as the previous pull request that this series is based on has been cherry-picked, not merged. > Acked-by: me. > > > On Saturday, 28 April 2018 23:50:19 EEST Laurent Pinchart wrote: > >> Hello, > >> > >> (Dave, there's a request for you below) > >> > >> This patch series adds support for CRC calculation to the rcar-du-drm > >> driver. > >> > >> CRC calculation is supported starting at the Renesas R-Car Gen3 SoCs, as > >> earlier versions don't have the necessary hardware. On Gen3 SoCs, the CRC > >> is computed by the DISCOM module part of the VSP-D and VSP-DL. > >> > >> The DISCOM is interfaced to the VSP through the UIF glue and appears as a > >> VSP entity with a sink pad and a source pad. > >> > >> The series starts with a switch to SPDX license headers in patch 1/8, > >> prompted by a checkpatch.pl warning for a later patch that complained > >> about missing SPDX license headers. It then continues with cleanup and > >> refactoring. Patches 2/8 and 3/8 prepare for DISCOM and UIF support by > >> extending generic code to make it usable for the UIF. Patch 4/8 documents > >> a structure that will receive new fields. > >> > >> Patch 5/8 then extends the API exposed by the VSP driver to the DU driver > >> to support CRC computation configuration and reporting. The patch > >> unfortunately needs to touch both the VSP and DU drivers, so the whole > >> series will need to be merged through a single tree. > >> > >> Patch 5/8 adds support for the DISCOM and UIF in the VSP driver, patch > >> 7/8 integrates it in the DRM pipeline, and patch 8/8 finally implements > >> the CRC API in the DU driver to expose CRC computation to userspace. > >> > >> The hardware supports computing the CRC at any arbitrary point in the > >> pipeline on a configurable window of the frame. This patch series > >> supports CRC computation on input planes or pipeline output, but on the > >> full frame only. Support for CRC window configuration can be added later > >> if needed but will require extending the userspace API, as the DRM/KMS > >> CRC API doesn't support this feature. > >> > >> Compared to v1, the CRC source names for plane inputs are now constructed > >> from plane IDs instead of plane indices. This allows userspace to match > >> CRC sources with planes. > >> > >> Compared to v2, various small issues reported by reviewers have been > >> fixed. I believe the series to now be ready for upstream merge. > >> > >> Note that exposing the DISCOM and UIF though the V4L2 API isn't supported > >> as the module is only found in VSP-D and VSP-DL instances that are not > >> exposed through V4L2. It is possible to expose those instances through > >> V4L2 with a small modification to the driver for testing purpose. If the > >> need arises to test DISCOM and UIF with such an out-of-tree patch, > >> support for CRC reporting through a V4L2 control can be added later > >> without affecting how CRC is exposed through the DRM/KMS API. > >> > >> The patches are based on top of the "[PATCH v2 00/15] R-Car VSP1: > >> Dynamically assign blend units to display pipelines" patch series, itself > >> based on top of the Linux media master branch and scheduled for merge in > >> v4.18. The new base caused heavy conflicts, requiring this series to be > >> merged through the V4L2 tree. > >> > >> Dave, I have verified that this series merges cleanly with your drm-next > >> and drm-fixes branches, with the drm-misc-next and drm-misc-fixes > >> branches, and with the R-Car DU patches I would like to get merged in > >> v4.18 through your tree. Could I get your ack to merge this through the > >> V4L2 tree ? > >> > >> For convenience the patches are available at > >> > >> git://linuxtv.org/pinchartl/media.git vsp1-discom-v3-20180428 > >> > >> The code has been tested through the kms-test-crc.py script part of the > >> DU test suite available at > >> > >> git://git.ideasonboard.com/renesas/kms-tests.git discom > >> > >> Laurent Pinchart (8): > >> v4l: vsp1: Use SPDX license headers > >> v4l: vsp1: Share the CLU, LIF and LUT set_fmt pad operation code > >> v4l: vsp1: Reset the crop and compose rectangles in the set_fmt helper > >> v4l: vsp1: Document the vsp1_du_atomic_config structure > >> v4l: vsp1: Extend the DU API to support CRC computation > >> v4l: vsp1: Add support for the DISCOM entity > >> v4l: vsp1: Integrate DISCOM in display pipeline > >
Re: [PATCH v3] drm: rcar-du: track dma-buf fences
Hi Emre, Thank you for the patch. On Monday, 30 April 2018 15:02:04 EEST Emre Ucan wrote: > We have to check dma-buf reservation objects of our framebuffers before > we use them. Otherwise, another driver might be writing on the same > buffer which we are using. This would cause visible tearing effects > on display. > > We can use existing atomic helper functions to solve this problem. > > v2 changes: > - Remove drm_atomic_helper_wait_for_fences() call in rcar_du_kms.c. > The commit_tail() function in drm_atomic_helper.c, which calls our > atomic_commit_tail() implementation, already calls it. > - Remove proposed rcar_du_vsp_set_fence_for_plane() function. > Call drm_gem_fb_prepare_fb(), which calls > drm_atomic_set_fence_for_plane(). > > v3 changes: > - Sort the added header file alphabetically. > - Check return value of drm_gem_fb_prepare_fb() and clean up in the case > of error. > > Signed-off-by: Emre Ucan Reviewed-by: Laurent Pinchart and taken in my tree for v4.18. > --- > drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c > b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c index 2c260c3..73c7948 100644 > --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c > +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c > @@ -17,6 +17,7 @@ > #include > #include > #include > +#include > #include > > #include > @@ -237,6 +238,10 @@ static int rcar_du_vsp_plane_prepare_fb(struct > drm_plane *plane, } > } > > + ret = drm_gem_fb_prepare_fb(plane, state); > + if (ret) > + goto fail; > + > return 0; > > fail: -- Regards, Laurent Pinchart ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[GIT PULL FOR v4.18] R-Car DU changes
Hi Dave, The following changes since commit 6d08b06e67cd117f6992c46611dfb4ce267cd71e: Linux 4.17-rc2 (2018-04-22 19:20:09 -0700) are available in the Git repository at: git://linuxtv.org/pinchartl/media.git drm/du/next for you to fetch changes up to b06078de418d6f77c81aa74516f787663f51a262: drm: rcar-du: Track dma-buf fences (2018-05-05 17:12:46 +0300) I have verified that this does not conflict with any series touching the R-Car DU driver and scheduled to be merged through the linux-media tree. Emre Ucan (1): drm: rcar-du: Track dma-buf fences Kieran Bingham (9): drm: rcar-du: of: Include header to define prototypes drm: rcar-du: Use NULL for table initialisation dt-bindings: display: renesas: du: Increase indent in output table dt-bindings: display: renesas: du: Document the r8a77965 bindings drm: rcar-du: Use the correct naming for ODPM fields in DEFR6 dt-bindings: display: renesas: Add R-Car M3-N HDMI TX DT bindings drm: rcar-du: Split CRTC handling to support hardware indexing drm: rcar-du: Allow DU groups to work with hardware indexing drm: rcar-du: Add R8A77965 support Laurent Pinchart (1): drm: rcar-du: Zero-out sg_tables when duplicating plane state .../bindings/display/bridge/renesas,dw-hdmi.txt | 1 + .../devicetree/bindings/display/renesas,du.txt | 28 +++--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 26 +++-- drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 3 +- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 51 +--- drivers/gpu/drm/rcar-du/rcar_du_drv.h | 4 +- drivers/gpu/drm/rcar-du/rcar_du_group.c | 16 +--- drivers/gpu/drm/rcar-du/rcar_du_group.h | 2 + drivers/gpu/drm/rcar-du/rcar_du_kms.c | 25 drivers/gpu/drm/rcar-du/rcar_du_of.c| 1 + drivers/gpu/drm/rcar-du/rcar_du_regs.h | 16 drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 10 +++-- 12 files changed, 120 insertions(+), 63 deletions(-) -- Regards, Laurent Pinchart ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 105425] 3D & games produce periodic GPU crashes (Radeon R7 370)
https://bugs.freedesktop.org/show_bug.cgi?id=105425 --- Comment #69 from i...@yahoo.com --- I'm really out of ideas... Could you try using only the radeon kernel driver, just blacklist amdgpu one. See if the blender trace hangs and netconsole still doesn't give any warnings. See if you can completely disable iommu, when using radeon.ko. I've asked you at least 3 times to test "export mesa_glthread=false", but you never included it in your list of things you've tried. Same for `export RADEON_THREAD=false`. I haven't asked you, but add `MESA_DEBUG=flush` to the things to test. Now, if you have run out of things to test. You can try a prolonged experiment, that might not even bring usable result. If we had a case that hanged reliably, one thing to do is to locate the exact operation that causes the hang. So, you start `qapitrace` with the blender trace. You then do a binary search for the frame that causes hang. It's done by "Lookup State" at a frame number, it would replay the trace to that frame. You start with the full range, let's say [0 - 1], so you pick the frame from the middle of that range, in this case frame#5000. If it hangs during replay, you use [0 - 5000] as interval, if it doesn't hang, then you use the other half [5000-1] (because the cause of hang mush be there). Then you pick the middle of the new interval and repeat the experiment. (e.g. [0 - 2500]; [1250 - 2500]; [1250 - 1875]. Once you locate the exact frame that could cause the first hang, you can do the binary search, but this time on the draw operations inside that frame. It can help if you set: "qapitrace->Trace->Options->Only_show_the_following_events->Draw_events". Now, since crashing to you is kind of random, you might try to disable all threaded options (all options from above) and run same lookup a dozen of times. If it crashes even once, then it crashes. Also, be sure to write down the current range, as to not loose it at reboot. I also strongly encourage you to at least try some other distribution, something you can start from life-cd or something. Or build your own vanilla kernel. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 0/8] R-Car DU: Support CRC calculation
Em Sat, 05 May 2018 17:06:50 +0300 Laurent Pinchart escreveu: > Hi Daniel, > > (CC'ing Mauro) > > On Thursday, 3 May 2018 16:45:36 EEST Daniel Vetter wrote: > > On Thu, May 3, 2018 at 2:06 PM, Laurent Pinchart wrote: > > > Hi Dave, > > > > > > Ping ? > > > > Not aware of any crc core work going on in drm, so has my ack. > > Thank you. > > > Worst case we do a topic branch or something like that (since I guess you'll > > do a pull request anyway on the v4l side). > > That would unfortunately not be possible, as Mauro cherry-picks patches > instead of merging pull requests. In rare cases I can ask for a pull-request > to be merged as-is, but it's too late in this case as the previous pull > request that this series is based on has been cherry-picked, not merged. I probably missed something, but I fail to see what's the problem. If DRM needs a patch that was already merged on our tree, I can gladly create a stable branch/tag for it - well, media master branch is stable, but I can add a tag there just after the patch DRM needs, in order to avoid them to merge from us at some random point. If otherwise we need a patch applied at DRM, they can do the same: create a branch/tag, and I can pull from it. Thanks, Mauro ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [BUG] drm/vc4: vblank wait timed out
On Sat, May 5, 2018 at 1:47 PM, Stefan Wahren wrote: > Hi, > > after submit of the latest bcm2835 clock fixes, i thought this issue has been > fixed. But i've seen this issue with current mainline 4.17-rc3 > (bcm2835_defconfig) on Raspberry Pi 1 B (using U-Boot TFTP Boot). Strangly i > couldn't reproduce this issue with same kernel but using only the Foundation > bootloader (without U-Boot TFTP Boot). > > U-Boot version: 2018.03 > > I triggered the warning using my HDMI switch: > > [ 198.304572] [ cut here ] > [ 198.304693] WARNING: CPU: 0 PID: 10 at > drivers/gpu/drm/drm_atomic_helper.c:1351 > drm_atomic_helper_wait_for_vblanks+0x1d4/0x1f0 > [ 198.304703] [CRTC:68:crtc-2] vblank wait timed out > [ 198.304751] Modules linked in: bcm2835_rng rng_core vchiq(C) > [ 198.304790] CPU: 0 PID: 10 Comm: kworker/0:1 Tainted: G C > 4.17.0-rc3+ #1 > [ 198.304796] Hardware name: BCM2835 > [ 198.304817] Workqueue: events output_poll_execute > [ 198.304867] [] (unwind_backtrace) from [] > (show_stack+0x20/0x24) > [ 198.304934] [] (show_stack) from [] > (dump_stack+0x20/0x28) > [ 198.304971] [] (dump_stack) from [] (__warn+0xec/0x104) > [ 198.305012] [] (__warn) from [] > (warn_slowpath_fmt+0x48/0x50) > [ 198.305048] [] (warn_slowpath_fmt) from [] > (drm_atomic_helper_wait_for_vblanks+0x1d4/0x1f0) > [ 198.305098] [] (drm_atomic_helper_wait_for_vblanks) from > [] (vc4_atomic_complete_commit+0x80/0xb8) > [ 198.305144] [] (vc4_atomic_complete_commit) from [] > (vc4_atomic_commit+0x110/0x11c) > [ 198.305174] [] (vc4_atomic_commit) from [] > (drm_atomic_commit+0x50/0x60) > [ 198.305202] [] (drm_atomic_commit) from [] > (restore_fbdev_mode_atomic+0x80/0x1cc) > [ 198.305228] [] (restore_fbdev_mode_atomic) from [] > (restore_fbdev_mode+0x38/0x144) > [ 198.305270] [] (restore_fbdev_mode) from [] > (drm_fb_helper_restore_fbdev_mode_unlocked+0x58/0x8c) > [ 198.305296] [] (drm_fb_helper_restore_fbdev_mode_unlocked) from > [] (drm_fb_helper_set_par+0x54/0x60) > [ 198.305320] [] (drm_fb_helper_set_par) from [] > (drm_fb_helper_hotplug_event+0xc8/0xd4) > [ 198.305343] [] (drm_fb_helper_hotplug_event) from [] > (drm_fb_helper_output_poll_changed+0x1c/0x20) > [ 198.305382] [] (drm_fb_helper_output_poll_changed) from > [] (drm_kms_helper_hotplug_event+0x34/0x38) > [ 198.305409] [] (drm_kms_helper_hotplug_event) from [] > (output_poll_execute+0x16c/0x17c) > [ 198.305440] [] (output_poll_execute) from [] > (process_one_work+0x1e0/0x368) > [ 198.305466] [] (process_one_work) from [] > (worker_thread+0x2a0/0x418) > [ 198.305511] [] (worker_thread) from [] > (kthread+0x144/0x15c) > [ 198.305539] [] (kthread) from [] > (ret_from_fork+0x14/0x2c) > [ 198.305549] Exception stack(0xc9939fb0 to 0xc9939ff8) > [ 198.305562] 9fa0: > > [ 198.305578] 9fc0: > > [ 198.305591] 9fe0: 0013 > [ 198.305630] ---[ end trace 9c4071c657268b83 ]--- > > I also dumped clk_summary in both cases, but they were identical. > > Are their any helpful information, which i can provide? > > Best regards > Stefan I have seen this happen with one of those cheap Waveshare HDMI displays. More often when connecting its power to the RPi versus on a separate supply. Goes away when using a real, proper HDMI display. They come with bad EDID data so I pretty much just blamed the display at the time. Does this happen during a switch and whats on the other end? Thanks, Stefan ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [BUG] drm/vc4: vblank wait timed out
On Sat, 5 May 2018 19:44:57 +0200 (CEST) Stefan Wahren wrote: > Hi Stefan, > > > Stefan Schake hat am 5. Mai 2018 um 19:29 > > geschrieben: > > > > > > On Sat, May 5, 2018 at 1:47 PM, Stefan Wahren > > wrote: > > > Hi, > > > > > > after submit of the latest bcm2835 clock fixes, i thought this > > > issue has been fixed. But i've seen this issue with current > > > mainline 4.17-rc3 (bcm2835_defconfig) on Raspberry Pi 1 B (using > > > U-Boot TFTP Boot). Strangly i couldn't reproduce this issue with > > > same kernel but using only the Foundation bootloader (without > > > U-Boot TFTP Boot). > > > > > > U-Boot version: 2018.03 > > > > > > I triggered the warning using my HDMI switch: > > > > > > [ 198.304572] [ cut here ] > > > [ 198.304693] WARNING: CPU: 0 PID: 10 at > > > drivers/gpu/drm/drm_atomic_helper.c:1351 > > > drm_atomic_helper_wait_for_vblanks+0x1d4/0x1f0 [ 198.304703] > > > [CRTC:68:crtc-2] vblank wait timed out [ 198.304751] Modules > > > linked in: bcm2835_rng rng_core vchiq(C) [ 198.304790] CPU: 0 > > > PID: 10 Comm: kworker/0:1 Tainted: G C4.17.0-rc3+ > > > #1 [ 198.304796] Hardware name: BCM2835 [ 198.304817] > > > Workqueue: events output_poll_execute [ 198.304867] [] > > > (unwind_backtrace) from [] (show_stack+0x20/0x24) > > > [ 198.304934] [] (show_stack) from [] > > > (dump_stack+0x20/0x28) [ 198.304971] [] (dump_stack) > > > from [] (__warn+0xec/0x104) [ 198.305012] [] > > > (__warn) from [] (warn_slowpath_fmt+0x48/0x50) > > > [ 198.305048] [] (warn_slowpath_fmt) from [] > > > (drm_atomic_helper_wait_for_vblanks+0x1d4/0x1f0) [ 198.305098] > > > [] (drm_atomic_helper_wait_for_vblanks) from > > > [] (vc4_atomic_complete_commit+0x80/0xb8) > > > [ 198.305144] [] (vc4_atomic_complete_commit) from > > > [] (vc4_atomic_commit+0x110/0x11c) [ 198.305174] > > > [] (vc4_atomic_commit) from [] > > > (drm_atomic_commit+0x50/0x60) [ 198.305202] [] > > > (drm_atomic_commit) from [] > > > (restore_fbdev_mode_atomic+0x80/0x1cc) [ 198.305228] > > > [] (restore_fbdev_mode_atomic) from [] > > > (restore_fbdev_mode+0x38/0x144) [ 198.305270] [] > > > (restore_fbdev_mode) from [] > > > (drm_fb_helper_restore_fbdev_mode_unlocked+0x58/0x8c) > > > [ 198.305296] [] > > > (drm_fb_helper_restore_fbdev_mode_unlocked) from [] > > > (drm_fb_helper_set_par+0x54/0x60) [ 198.305320] [] > > > (drm_fb_helper_set_par) from [] > > > (drm_fb_helper_hotplug_event+0xc8/0xd4) [ 198.305343] > > > [] (drm_fb_helper_hotplug_event) from [] > > > (drm_fb_helper_output_poll_changed+0x1c/0x20) [ 198.305382] > > > [] (drm_fb_helper_output_poll_changed) from > > > [] (drm_kms_helper_hotplug_event+0x34/0x38) > > > [ 198.305409] [] (drm_kms_helper_hotplug_event) from > > > [] (output_poll_execute+0x16c/0x17c) [ 198.305440] > > > [] (output_poll_execute) from [] > > > (process_one_work+0x1e0/0x368) [ 198.305466] [] > > > (process_one_work) from [] (worker_thread+0x2a0/0x418) > > > [ 198.305511] [] (worker_thread) from [] > > > (kthread+0x144/0x15c) [ 198.305539] [] (kthread) from > > > [] (ret_from_fork+0x14/0x2c) [ 198.305549] Exception > > > stack(0xc9939fb0 to 0xc9939ff8) [ 198.305562] > > > 9fa0: > > > [ 198.305578] 9fc0: > > > [ 198.305591] 9fe0: > > > 0013 > > > [ 198.305630] ---[ end trace 9c4071c657268b83 ]--- > > > > > > I also dumped clk_summary in both cases, but they were identical. > > > > > > Are their any helpful information, which i can provide? > > > > > > Best regards > > > Stefan > > > > I have seen this happen with one of those cheap Waveshare HDMI > > displays. More often when connecting its power to the RPi versus on > > a separate supply. Goes away when using a real, proper HDMI > > display. They come with bad EDID data so I pretty much just blamed > > the display at the time. > > > > Does this happen during a switch and whats on the other end? > > The issue happens only in combination with U-Boot. If i switch the > source between my PC and the RPi then sometimes the warning is > triggered. Is it working despite the WARN backtrace, or do you then get a black screen? You say sometimes, that means sometimes it works, right? Also, do you remember the mode (resolution+refresh-rate) you're using? ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/4] drm/tegra: gr3d: Properly clean up resources
On 04.05.2018 16:37, Thierry Reding wrote: > From: Thierry Reding > > Failure to register the Tegra DRM client would leak the resources. Move > cleanup code to error unwinding gotos to fix that and share the cleanup > code with the other error paths. > > Signed-off-by: Thierry Reding > --- > drivers/gpu/drm/tegra/gr3d.c | 27 +-- > 1 file changed, 21 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/tegra/gr3d.c b/drivers/gpu/drm/tegra/gr3d.c > index ce5120683091..e129f1afff33 100644 > --- a/drivers/gpu/drm/tegra/gr3d.c > +++ b/drivers/gpu/drm/tegra/gr3d.c > @@ -52,8 +52,8 @@ static int gr3d_init(struct host1x_client *client) > > client->syncpts[0] = host1x_syncpt_request(client, flags); > if (!client->syncpts[0]) { > - host1x_channel_put(gr3d->channel); > - return -ENOMEM; > + err = -ENOMEM; > + goto put; > } > > if (tegra->domain) { > @@ -65,15 +65,30 @@ static int gr3d_init(struct host1x_client *client) > dev_err(client->dev, > "failed to attach to domain: %d\n", > err); > - host1x_syncpt_free(client->syncpts[0]); > - host1x_channel_put(gr3d->channel); > iommu_group_put(gr3d->group); > - return err; > + goto free; > } > } > } > > - return tegra_drm_register_client(dev->dev_private, drm); > + err = tegra_drm_register_client(dev->dev_private, drm); > + if (err < 0) { > + dev_err(client->dev, "failed to register client: %d\n", err); > + goto detach; > + } > + > + return 0; > + > +detach: > + if (gr3d->group) { > + iommu_detach_group(tegra->domain, gr3d->group); > + iommu_group_put(gr3d->group); > + } > +free: > + host1x_syncpt_free(client->syncpts[0]); > +put: > + host1x_channel_put(gr3d->channel); > + return err; > } > > static int gr3d_exit(struct host1x_client *client) > Reviewed-by: Dmitry Osipenko ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v1 1/3] drm/tegra: dc: Enable plane scaling filters
On 04.05.2018 14:10, Thierry Reding wrote: > On Fri, May 04, 2018 at 03:08:42AM +0300, Dmitry Osipenko wrote: >> Currently resized plane produces a "pixelated" image which doesn't look >> nice, especially in a case of a video overlay. Enable scaling filters that >> significantly improve image quality of a scaled overlay. >> >> Signed-off-by: Dmitry Osipenko >> --- >> drivers/gpu/drm/tegra/dc.c | 51 ++ >> drivers/gpu/drm/tegra/dc.h | 7 ++ >> 2 files changed, 58 insertions(+) >> >> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c >> index 9f83a65b5ea9..2e81142281c3 100644 >> --- a/drivers/gpu/drm/tegra/dc.c >> +++ b/drivers/gpu/drm/tegra/dc.c >> @@ -361,6 +361,47 @@ static void tegra_dc_setup_window(struct tegra_plane >> *plane, >> if (window->bottom_up) >> value |= V_DIRECTION; >> >> +if (!(dc->soc->has_win_a_without_filter && plane->index == 0) && >> +!(window->src.w == window->dst.w)) { > > I don't know about you, but I get dizzy trying to parse the above. How > about we move this into helpers: +1 > static bool tegra_plane_has_horizontal_filter(struct tegra_plane *plane) > { > struct tegra_dc *dc = plane->dc; > > /* this function should never be called on inactive planes */ > if (WARN_ON(!dc)) > return false; > > if (plane->index == 0 && dc->soc->has_win_a_without_filter) > return false; > > return true; > } > > Then the above becomes: > > bool scale_x = window->dst.w != window->src.w; > > if (scale_x && tegra_plane_has_horizontal_filter(plane)) { > >> +/* >> + * Enable horizontal 6-tap filter and set filtering >> + * coefficients to the default values defined in TRM. >> + */ >> +tegra_plane_writel(plane, 0x8000, DC_WIN_H_FILTER_P(0)); >> +tegra_plane_writel(plane, 0x3e087ce1, DC_WIN_H_FILTER_P(1)); >> +tegra_plane_writel(plane, 0x3b117ac1, DC_WIN_H_FILTER_P(2)); >> +tegra_plane_writel(plane, 0x591b73aa, DC_WIN_H_FILTER_P(3)); >> +tegra_plane_writel(plane, 0x57256d9a, DC_WIN_H_FILTER_P(4)); >> +tegra_plane_writel(plane, 0x552f668b, DC_WIN_H_FILTER_P(5)); >> +tegra_plane_writel(plane, 0x73385e8b, DC_WIN_H_FILTER_P(6)); >> +tegra_plane_writel(plane, 0x72435583, DC_WIN_H_FILTER_P(7)); >> +tegra_plane_writel(plane, 0x714c4c8b, DC_WIN_H_FILTER_P(8)); >> +tegra_plane_writel(plane, 0x70554393, DC_WIN_H_FILTER_P(9)); >> +tegra_plane_writel(plane, 0x715e389b, DC_WIN_H_FILTER_P(10)); >> +tegra_plane_writel(plane, 0x71662faa, DC_WIN_H_FILTER_P(11)); >> +tegra_plane_writel(plane, 0x536d25ba, DC_WIN_H_FILTER_P(12)); >> +tegra_plane_writel(plane, 0x55731bca, DC_WIN_H_FILTER_P(13)); >> +tegra_plane_writel(plane, 0x387a11d9, DC_WIN_H_FILTER_P(14)); >> +tegra_plane_writel(plane, 0x3c7c08f1, DC_WIN_H_FILTER_P(15)); >> + >> +value |= H_FILTER; >> +} >> + >> +if (!(dc->soc->has_win_a_without_filter && plane->index == 0) && >> +!(dc->soc->has_win_c_without_vert_filter && plane->index == 2) && >> +!(window->src.h == window->dst.h)) { > > static bool tegra_plane_has_vertical_filter(struct tegra_plane *plane) > { > struct tegra_dc *dc = plane->dc; > > /* this function should never be called on inactive planes */ > if (WARN_ON(!dc)) > return false; > > if (plane->index == 0 && dc->soc->has_win_a_without_filter) > return false; > > if (plane->index == 2 && dc->soc->has_win_c_without_vert_filter) > return false; > > return true; > } > > And the above becomes: > > bool scale_y = window->dst.h != window->src.h; > > if (scale_y && tegra_plane_has_vertical_filter(plane)) { I'll adjust this patch, thanks. Maybe it also worth to factor filtering out into a custom DRM property? For example in a case of libvdpau-tegra we perform the exact same filtering on blitting YUV to RGB surface (shown as overlay) by GR2D for displaying video players interface on top of video, this results in a double filtering that has no visual effect and probably wastes memory bandwidth a tad. Though I'm not very keen anymore on trying to add custom plane properties after being previously NAK'ed. We can wrap filtering into a property later if will be desired, should be good to just have it enabled by default for now. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH V2 2/5] backlight: qcom-wled: Add support for WLED4 peripheral
WLED4 peripheral is present on some PMICs like pmi8998 and pm660l. It has a different register map and also configurations are different. Add support for it. Signed-off-by: Kiran Gunda --- .../bindings/leds/backlight/qcom-wled.txt | 172 - drivers/video/backlight/qcom-wled.c| 749 +++-- 2 files changed, 696 insertions(+), 225 deletions(-) diff --git a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt index fb39e32..0ceffa1 100644 --- a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt +++ b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt @@ -1,30 +1,129 @@ Binding for Qualcomm Technologies, Inc. WLED driver -Required properties: -- compatible: should be "qcom,pm8941-wled" -- reg: slave address - -Optional properties: -- default-brightness: brightness value on boot, value from: 0-4095 - default: 2048 -- label: The name of the backlight device -- qcom,cs-out: bool; enable current sink output -- qcom,cabc: bool; enable content adaptive backlight control -- qcom,ext-gen: bool; use externally generated modulator signal to dim -- qcom,current-limit: mA; per-string current limit; value from 0 to 25 - default: 20mA -- qcom,current-boost-limit: mA; boost current limit; one of: - 105, 385, 525, 805, 980, 1260, 1400, 1680 - default: 805mA -- qcom,switching-freq: kHz; switching frequency; one of: - 600, 640, 685, 738, 800, 872, 960, 1066, 1200, 1371, - 1600, 1920, 2400, 3200, 4800, 9600, - default: 1600kHz -- qcom,ovp: V; Over-voltage protection limit; one of: - 27, 29, 32, 35 - default: 29V -- qcom,num-strings: #; number of led strings attached; value from 1 to 3 - default: 2 +WLED (White Light Emitting Diode) driver is used for controlling display +backlight that is part of PMIC on Qualcomm Technologies, Inc. reference +platforms. The PMIC is connected to the host processor via SPMI bus. + +- compatible + Usage:required + Value type: + Definition: should be "qcom,pm8941-wled" or "qcom,pmi8998-wled". + or "qcom,pm660l-wled". + +- reg + Usage:required + Value type: + Definition: Base address of the WLED modules. + +- interrupts + Usage:optional + Value type: + Definition: Interrupts associated with WLED. Interrupts can be + specified as per the encoding listed under + Documentation/devicetree/bindings/spmi/ + qcom,spmi-pmic-arb.txt. + +- interrupt-names + Usage:optional + Value type: + Definition: Interrupt names associated with the interrupts. + Must be "short" and "ovp". The short circuit detection + is not supported for PM8941. + +- label + Usage:required + Value type: + Definition: The name of the backlight device + +- default-brightness + Usage:optional + Value type: + Definition: brightness value on boot, value from: 0-4095 + Default: 2048 + +- qcom,current-limit + Usage:optional + Value type: + Definition: uA; per-string current limit + value: + For pm8941: from 0 to 25000 with 5000 ua step + Default 2 uA + For pmi8998: from 0 to 3 with 5000 ua step + Default 25000 uA. + +- qcom,current-boost-limit + Usage:optional + Value type: + Definition: mA; boost current limit. + For pm8941: one of: 105, 385, 525, 805, 980, 1260, 1400, +1680. Default: 805 mA + For pmi8998: one of: 105, 280, 450, 620, 970, 1150, 1300, + 1500. Default: 970 mA + +- qcom,switching-freq + Usage:optional + Value type: + Definition: kHz; switching frequency; one of: 600, 640, 685, 738, + 800, 872, 960, 1066, 1200, 1371, 1600, 1920, 2400, 3200, + 4800, 9600. + Default: for pm8941: 1600 kHz + for pmi8998: 800 kHz + +- qcom,ovp + Usage:optional + Value type: + Definition: mV; Over-voltage protection limit; + For pm8941: one of 27000, 29000, 32000, 35000 + Default: 29000 mV + For pmi8998: one of 18100, 19600, 29600, 31100 + Default: 29600 mV + +- qcom,num-strings + Usage:optional + Value type: + Definition: #; number of led strings attached; + for pm8941: value 3. + for pmi8998: value 4. + +- qcom,enab
Re: [drm_hwc] PSA: drm_hwc submissions via gitlab
Il 04 mag 2018 19:51, "Alistair Strachan" ha scritto: On Fri, May 4, 2018 at 10:35 AM Sean Paul wrote: > On Fri, May 04, 2018 at 05:19:50PM +, Mauro Rossi wrote: [snip] > > Another question is for Intel and Chromeos developers: are you planning > to > > update your minigbm projects to the new common gralloc_handle.h handle > > structure in latest libdrm? > > > > I assume yes, but I'm not hooked in to what's happening with minigbm. > +1. We can take this to another thread. The main issue is that minigbm assumes a 1:1 planes to handles paradigm, the new generic handle does not. Thanks for the info This allows testing an hwcomposer.minigbm (by just changing some makefile rules and build as separate project) separately from hwcomposer.drm In order to select hwcomposer.drm+gralloc.gbm vs hwcomposer.minigbm+gralloc.minigbm I use init.sh and a boot cmdline parameter. When testing drm_hwcomposer+ (chromeos minigbm or intel minigbm) two week ago I was getting SIGABRT no suitable EGL config. I will repeat tests with cros/gralloc_drm_handle.h handle now supported via platformminigbm on amdgpu (requires patch on minigbm), i965 and nouveau. Mauro Mauro > I'm asking because freedesktop drm_hwcomposer (hwctwo) moved to new libdrm > > gralloc_handle.h handle > > and it would make sense for minigbm to evolve accordingly, > > > > and I'd like to try them in oreo-x86 as a like-for-like replacement > option > > for gbm_gralloc > > Did you see the latest patches from Alistair Strachan to add minigbm as a > supported platform? That might do what you want. > Thanks, they will suffice for now, however minigbm was now put in diverging track from common libdrm gralloc handle. If we move to the common handle, my changes can be dropped. That's the goal, it's just not possible right now. Were those the only specificity introduced in hwc? Is there documentation on the differences in composition of planes among driver platforms? Why is amdgpu the only platform (among the ones supporting atomic) for which drm mode setting is not working with hwc, is there some difference in amdgpu drm implementation? [Just a hint, I'll open bug on gitlab] I'll keep an eye on AOSP minigbm, cros minigbm and intel minigbm to see if/when they'll be updated to use new gralloc handle. Mauro ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] Add SPDX idenitifier and clarify license
On Thu, May 03, 2018 at 08:46:20AM -0400, Sean Paul wrote: > > Thank you for the awesome summary, it is very helpful! So since the > boilerplate > has to stay, is there a benefit to adding the SPDX header? Is it just to make > scripting/scraping easier? Actually, the header now adds the correct information. Without the header it is not clear that these files are supposed to be dual licensed under MIT or GPL-2. And yes, it of course simplifies tooling as well, which is why there is a push to get these headers broadly added to many open source projects. /D ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 03/13] drm/kms/mode/exynos-dsi: using helper func drm_display_mode_to_videomode for calculating timing parameters
To avoid duplicate logic for the same Signed-off-by: Satendra Singh Thakur Cc: Madhur Verma Cc: Hemanshu Srivastava --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 7904ffa..9397e5c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1493,14 +1493,7 @@ static void exynos_dsi_mode_set(struct drm_encoder *encoder, struct videomode *vm = &dsi->vm; struct drm_display_mode *m = adjusted_mode; - vm->hactive = m->hdisplay; - vm->vactive = m->vdisplay; - vm->vfront_porch = m->vsync_start - m->vdisplay; - vm->vback_porch = m->vtotal - m->vsync_end; - vm->vsync_len = m->vsync_end - m->vsync_start; - vm->hfront_porch = m->hsync_start - m->hdisplay; - vm->hback_porch = m->htotal - m->hsync_end; - vm->hsync_len = m->hsync_end - m->hsync_start; + drm_display_mode_to_videomode(m, vm); } static const struct drm_encoder_helper_funcs exynos_dsi_encoder_helper_funcs = { -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v1 1/5] drm/tegra: dc: Balance IOMMU group refcounting
Remove unneeded iommu_group_get() and add missing iommu_group_put(), correcting IOMMU group refcount. This is a minor correction / cleanup that doesn't really fix anything because Tegra's IOMMU driver are built-in and hence groups refcounting can't hold IOMMU driver from unloading. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/dc.c | 35 +-- drivers/gpu/drm/tegra/dc.h | 2 +- drivers/gpu/drm/tegra/drm.h | 2 +- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index d7a0f62c6e2e..9fc34c6a7218 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -1927,7 +1927,6 @@ static irqreturn_t tegra_dc_irq(int irq, void *data) static int tegra_dc_init(struct host1x_client *client) { struct drm_device *drm = dev_get_drvdata(client->parent); - struct iommu_group *group = iommu_group_get(client->dev); unsigned long flags = HOST1X_SYNCPT_CLIENT_MANAGED; struct tegra_dc *dc = host1x_client_to_dc(client); struct tegra_drm *tegra = drm->dev_private; @@ -1939,20 +1938,21 @@ static int tegra_dc_init(struct host1x_client *client) if (!dc->syncpt) dev_warn(dc->dev, "failed to allocate syncpoint\n"); - if (group && tegra->domain) { - if (group != tegra->group) { - err = iommu_attach_group(tegra->domain, group); + if (tegra->domain) { + dc->group = iommu_group_get(client->dev); + + if (dc->group && dc->group != tegra->dc_group) { + err = iommu_attach_group(tegra->domain, dc->group); if (err < 0) { dev_err(dc->dev, "failed to attach to domain: %d\n", err); + iommu_group_put(dc->group); return err; } - tegra->group = group; + tegra->dc_group = dc->group; } - - dc->domain = tegra->domain; } if (dc->soc->wgrps) @@ -2017,13 +2017,13 @@ static int tegra_dc_init(struct host1x_client *client) if (!IS_ERR(primary)) drm_plane_cleanup(primary); - if (group && dc->domain) { - if (group == tegra->group) { - iommu_detach_group(dc->domain, group); - tegra->group = NULL; + if (dc->group) { + if (dc->group && dc->group == tegra->dc_group) { + iommu_detach_group(tegra->domain, dc->group); + tegra->dc_group = NULL; } - dc->domain = NULL; + iommu_group_put(dc->group); } return err; @@ -2032,7 +2032,6 @@ static int tegra_dc_init(struct host1x_client *client) static int tegra_dc_exit(struct host1x_client *client) { struct drm_device *drm = dev_get_drvdata(client->parent); - struct iommu_group *group = iommu_group_get(client->dev); struct tegra_dc *dc = host1x_client_to_dc(client); struct tegra_drm *tegra = drm->dev_private; int err; @@ -2045,13 +2044,13 @@ static int tegra_dc_exit(struct host1x_client *client) return err; } - if (group && dc->domain) { - if (group == tegra->group) { - iommu_detach_group(dc->domain, group); - tegra->group = NULL; + if (dc->group) { + if (dc->group && dc->group == tegra->dc_group) { + iommu_detach_group(tegra->domain, dc->group); + tegra->dc_group = NULL; } - dc->domain = NULL; + iommu_group_put(dc->group); } host1x_syncpt_free(dc->syncpt); diff --git a/drivers/gpu/drm/tegra/dc.h b/drivers/gpu/drm/tegra/dc.h index ca5cac6bf8ea..5ca4e07333bb 100644 --- a/drivers/gpu/drm/tegra/dc.h +++ b/drivers/gpu/drm/tegra/dc.h @@ -94,7 +94,7 @@ struct tegra_dc { const struct tegra_dc_soc_info *soc; - struct iommu_domain *domain; + struct iommu_group *group; }; static inline struct tegra_dc * diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h index 4f41aaec8530..640a6911 100644 --- a/drivers/gpu/drm/tegra/drm.h +++ b/drivers/gpu/drm/tegra/drm.h @@ -46,7 +46,7 @@ struct tegra_drm { struct drm_device *drm; struct iommu_domain *domain; - struct iommu_group *group; + struct iommu_group *dc_group; struct mutex mm_lock; struct drm_mm mm; -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 13/13] drm/kms/mode/bridge-adv7533: using helper func drm_display_mode_to_videomode for calculating timing parameters
To avoid duplicate logic for the same: There is a function in drm-core to calculate display timing parameters: horizontal front porch, back porch, sync length, vertical front porch, back porch, sync length and clock in Hz. However, some drivers are still calculating these parameters themselves. Therefore, there is a duplication of the code. This patch series replaces this redundant code with the function drm_display_mode_to_videomode. This removes nearly 100 redundant lines from the related drivers. Signed-off-by: Satendra Singh Thakur Cc: Madhur Verma Cc: Hemanshu Srivastava --- drivers/gpu/drm/bridge/adv7511/adv7533.c | 35 ++-- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7533.c b/drivers/gpu/drm/bridge/adv7511/adv7533.c index 185b6d8..881a703 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7533.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7533.c @@ -14,6 +14,7 @@ #include #include "adv7511.h" +#include static const struct reg_sequence adv7533_fixed_registers[] = { { 0x16, 0x20 }, @@ -36,15 +37,9 @@ static void adv7511_dsi_config_timing_gen(struct adv7511 *adv) { struct mipi_dsi_device *dsi = adv->dsi; struct drm_display_mode *mode = &adv->curr_mode; - unsigned int hsw, hfp, hbp, vsw, vfp, vbp; + struct videomode vm; u8 clock_div_by_lanes[] = { 6, 4, 3 }; /* 2, 3, 4 lanes */ - - hsw = mode->hsync_end - mode->hsync_start; - hfp = mode->hsync_start - mode->hdisplay; - hbp = mode->htotal - mode->hsync_end; - vsw = mode->vsync_end - mode->vsync_start; - vfp = mode->vsync_start - mode->vdisplay; - vbp = mode->vtotal - mode->vsync_end; + drm_display_mode_to_videomode(mode, &vm); /* set pixel clock divider mode */ regmap_write(adv->regmap_cec, 0x16, @@ -53,22 +48,22 @@ static void adv7511_dsi_config_timing_gen(struct adv7511 *adv) /* horizontal porch params */ regmap_write(adv->regmap_cec, 0x28, mode->htotal >> 4); regmap_write(adv->regmap_cec, 0x29, (mode->htotal << 4) & 0xff); - regmap_write(adv->regmap_cec, 0x2a, hsw >> 4); - regmap_write(adv->regmap_cec, 0x2b, (hsw << 4) & 0xff); - regmap_write(adv->regmap_cec, 0x2c, hfp >> 4); - regmap_write(adv->regmap_cec, 0x2d, (hfp << 4) & 0xff); - regmap_write(adv->regmap_cec, 0x2e, hbp >> 4); - regmap_write(adv->regmap_cec, 0x2f, (hbp << 4) & 0xff); + regmap_write(adv->regmap_cec, 0x2a, vm.hsync_len >> 4); + regmap_write(adv->regmap_cec, 0x2b, (vm.hsync_len << 4) & 0xff); + regmap_write(adv->regmap_cec, 0x2c, vm.hfront_porch >> 4); + regmap_write(adv->regmap_cec, 0x2d, (vm.hfront_porch << 4) & 0xff); + regmap_write(adv->regmap_cec, 0x2e, vm.hback_porch >> 4); + regmap_write(adv->regmap_cec, 0x2f, (vm.hback_porch << 4) & 0xff); /* vertical porch params */ regmap_write(adv->regmap_cec, 0x30, mode->vtotal >> 4); regmap_write(adv->regmap_cec, 0x31, (mode->vtotal << 4) & 0xff); - regmap_write(adv->regmap_cec, 0x32, vsw >> 4); - regmap_write(adv->regmap_cec, 0x33, (vsw << 4) & 0xff); - regmap_write(adv->regmap_cec, 0x34, vfp >> 4); - regmap_write(adv->regmap_cec, 0x35, (vfp << 4) & 0xff); - regmap_write(adv->regmap_cec, 0x36, vbp >> 4); - regmap_write(adv->regmap_cec, 0x37, (vbp << 4) & 0xff); + regmap_write(adv->regmap_cec, 0x32, vm.vsync_len >> 4); + regmap_write(adv->regmap_cec, 0x33, (vm.vsync_len << 4) & 0xff); + regmap_write(adv->regmap_cec, 0x34, vm.vfront_porch >> 4); + regmap_write(adv->regmap_cec, 0x35, (vm.vfront_porch << 4) & 0xff); + regmap_write(adv->regmap_cec, 0x36, vm.vback_porch >> 4); + regmap_write(adv->regmap_cec, 0x37, (vm.vback_porch << 4) & 0xff); } void adv7533_dsi_power_on(struct adv7511 *adv) -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 5/8] drm/radeon: Add SPDX identifier and clarify license
This is dual licensed under GPL-2.0 or MIT. Signed-off-by: Dirk Hohndel (VMware) --- drivers/gpu/drm/radeon/radeon_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/radeon/radeon_test.c b/drivers/gpu/drm/radeon/radeon_test.c index f5e9abfadb56..573e123c3a16 100644 --- a/drivers/gpu/drm/radeon/radeon_test.c +++ b/drivers/gpu/drm/radeon/radeon_test.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /* * Copyright 2009 VMware, Inc. * -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/8] drm/amd: Add SPDX identifier and clarify license
This is dual licensed under GPL-2.0 or MIT. Signed-off-by: Dirk Hohndel (VMware) --- drivers/gpu/drm/amd/amdgpu/amdgpu_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c index 2dbe87591f81..9ae10acd44c5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /* * Copyright 2009 VMware, Inc. * -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/3] drm_hwcomposer: Stop using libsync to provide sw_sync wrappers
On Thu, May 3, 2018 at 8:47 AM, Sean Paul wrote: > On Wed, May 02, 2018 at 04:56:29PM -0700, Alistair Strachan wrote: >> Use of the sw_sync API is not allowed any more. Until drm_hwcomposer is >> weaned off of sw_sync, build our own copy. > > I don't think it is used any longer. AFAICT, with 2 seconds of grep, it's > referenced in drmcompositorworker.cpp, virtualcompositorworker.cpp, and > hwcomposer.cpp > > I think these are all HWC1 legacy files, so they can probably just get cleaned > up. Are you sure? Doesn't the GL compositor have to wait on the fences of the input buffers and create new fences for the GL compositing output buffer(s) to pass into the kernel? It looked to me like sw_sync fences are used in the latter case and that needs to be converted to use eglCreateSyncKHR. Rob ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH V1 5/5] backlight: qcom-wled: Add auto string detection logic
The auto string detection algorithm checks if the current WLED sink configuration is valid. It tries enabling every sink and checks if the OVP fault is observed. Based on this information it detects and enables the valid sink configuration. Auto calibration will be triggered when the OVP fault interrupts are seen frequently thereby it tries to fix the sink configuration. Signed-off-by: Kiran Gunda --- drivers/video/backlight/qcom-wled.c | 302 1 file changed, 302 insertions(+) diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c index 80ae084..bacdf3f 100644 --- a/drivers/video/backlight/qcom-wled.c +++ b/drivers/video/backlight/qcom-wled.c @@ -33,11 +33,14 @@ #define WLED4_CTRL_REG_SC_FAULT_BIT BIT(2) #define WLED3_CTRL_REG_INT_RT_STS 0x10 +#define WLED3_CTRL_REG_OVP_FAULT_STATUS BIT(1) #define WLED3_CTRL_REG_MOD_EN 0x46 #define WLED3_CTRL_REG_MOD_EN_MASKBIT(7) #define WLED3_CTRL_REG_MOD_EN_BIT BIT(7) +#define WLED3_CTRL_REG_FEEDBACK_CONTROL0x48 + #define WLED3_CTRL_REG_FREQ0x4c #define WLED3_CTRL_REG_FREQ_MASK GENMASK(3, 0) @@ -152,6 +155,7 @@ struct wled_config { bool ext_gen; bool cabc; bool external_pfet; + bool auto_detection_enabled; }; struct wled { @@ -160,8 +164,10 @@ struct wled { struct regmap *regmap; struct mutex lock; /* Lock to avoid race from ISR */ ktime_t last_short_event; + ktime_t start_ovp_fault_time; u16 ctrl_addr; u16 sink_addr; + u16 auto_detection_ovp_count; u32 brightness; u32 max_brightness; u32 short_count; @@ -170,6 +176,7 @@ struct wled { int ovp_irq; bool force_mod_disable; bool ovp_irq_disabled; + bool auto_detection_done; struct wled_config cfg; struct delayed_work ovp_work; @@ -386,6 +393,292 @@ static irqreturn_t wled_short_irq_handler(int irq, void *_wled) return IRQ_HANDLED; } +#define AUTO_DETECT_BRIGHTNESS 200 +static int wled_auto_string_detection(struct wled *wled) +{ + int rc = 0, i; + u32 sink_config = 0, int_sts; + u8 sink_test = 0, sink_valid = 0, val; + + if (wled->auto_detection_done) + return 0; + + /* read configured sink configuration */ + rc = regmap_read(wled->regmap, wled->sink_addr + +WLED4_SINK_REG_CURR_SINK, &sink_config); + if (rc < 0) { + pr_err("Failed to read SINK configuration rc=%d\n", rc); + goto failed_detect; + } + + /* disable the module before starting detection */ + rc = regmap_update_bits(wled->regmap, + wled->ctrl_addr + WLED3_CTRL_REG_MOD_EN, + WLED3_CTRL_REG_MOD_EN_MASK, 0); + if (rc < 0) { + pr_err("Failed to disable WLED module rc=%d\n", rc); + goto failed_detect; + } + + /* set low brightness across all sinks */ + rc = wled4_set_brightness(wled, AUTO_DETECT_BRIGHTNESS); + if (rc < 0) { + pr_err("Failed to set brightness for auto detection rc=%d\n", + rc); + goto failed_detect; + } + + if (wled->cfg.cabc) { + for (i = 0; i < wled->cfg.num_strings; i++) { + rc = regmap_update_bits(wled->regmap, wled->sink_addr + + WLED4_SINK_REG_STR_CABC(i), + WLED4_SINK_REG_STR_CABC_MASK, + 0); + if (rc < 0) + goto failed_detect; + } + } + + /* disable all sinks */ + rc = regmap_write(wled->regmap, + wled->sink_addr + WLED4_SINK_REG_CURR_SINK, 0); + if (rc < 0) { + pr_err("Failed to disable all sinks rc=%d\n", rc); + goto failed_detect; + } + + /* iterate through the strings one by one */ + for (i = 0; i < wled->cfg.num_strings; i++) { + sink_test = BIT((WLED4_SINK_REG_CURR_SINK_SHFT + i)); + + /* Enable feedback control */ + rc = regmap_write(wled->regmap, wled->ctrl_addr + + WLED3_CTRL_REG_FEEDBACK_CONTROL, i + 1); + if (rc < 0) { + pr_err("Failed to enable feedback for SINK %d rc = %d\n", + i + 1, rc); + goto failed_detect; + } + + /* enable the sink */ + rc = regmap_write(wled->regmap, wled->sink_addr + + WLED4_SINK_REG_CURR_S
[PATCH 3/4] Documentation: bindings: add phy_config for Rockchip USB Type-C PHY
If want to do training outside DP Firmware, need phy voltage swing and pre_emphasis value. Signed-off-by: Lin Huang --- Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt index 960da7f..eda26dd 100644 --- a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt @@ -17,7 +17,9 @@ Required properties: Optional properties: - extcon : extcon specifier for the Power Delivery - + - rockchip,phy_config : That's phy voltage swing and pre_emphasis +setting, if want to do dp training outside +dp firmware, need to add these value. Required nodes : a sub-node is required for each port the phy provides. The sub-node name is used to identify dp or usb3 port, and shall be the following entries: -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 00/13] drm/kms/mode: using helper func drm_display_mode_to/from_videomode for calculating timing parameters
1.There is a function in drm-core to calculate display timing parameters: horizontal front porch, back porch, sync length, vertical front porch, back porch, sync length and clock in Hz. However, some drivers are still calculating these parameters themselves. Therefore, there is a duplication of the code. This patch series replaces this redundant code with the function drm_display_mode_to_videomode. This removes nearly 100 redundant lines from the related drivers. 2.For some drivers (sun4i) the reverse helper drm_display_mode_from_videomode is used. 3.For some drivers it replaces arithmatic operators (*, /) with shifting operators (>>, <<). 4.For some drivers DRM_MODE_FLAG_* are replaced with DISPLAY_FLAGS_* flags. 5.These changes apply to following crtc and encoder drivers: atmel-hlcdc bridge-tc358767 exynos-dsi fsl-dcu gma500-mdfld_dsi_dpi hisilicon-kirin_dsi, ade meson-encoder pl111-display sun4i-tv ti lcdc tegra dc mediatek dpi dsi bridge-adv7533 Satendra Singh Thakur (13): drm/kms/mode/atmel-hlcdc: using helper func drm_display_mode_to_videomode for calculating timing parameters drm/kms/mode/bridge-tc358767: using helper func drm_display_mode_to_videomode for calculating timing parameters drm/kms/mode/exynos-dsi: using helper func drm_display_mode_to_videomode for calculating timing parameters drm/kms/mode/fsl-dcu: using helper func drm_display_mode_to_videomode for calculating timing parameters drm/kms/mode/gma500-mdfld_dsi_dpi: using helper function drm_display_mode_to_videomode for calculating timing parameters drm/kms/mode/hisilicon-kirin-dsi-ade: using helper function drm_display_mode_to_videomode for calculating timing parameters drm/kms/mode/meson-encoder: using helper function drm_display_mode_to_videomode for calculating timing parameters drm/kms/mode/pl111-display: using helper function drm_display_mode_to_videomode for calculating timing parameters drm/kms/mode/sun4i-tv: using helper func drm_display_mode_from_videomode for calculating timing parameters drm/kms/mode/ti-lcdc: using helper func drm_display_mode_to_videomode for calculating timing parameters drm/kms/mode/tegra: using helper func drm_display_mode_to_videomode for calculating timing parameters drm/kms/mode/mtk_dpi_dsi: using helper func drm_display_mode_to_videomode for calculating timing parameters drm/kms/mode/bridge-adv7533: using helper func drm_display_mode_to_videomode for calculating timing parameters drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c| 28 +++-- drivers/gpu/drm/bridge/adv7511/adv7533.c| 35 +++--- drivers/gpu/drm/bridge/tc358767.c | 42 +++ drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 29 ++--- drivers/gpu/drm/gma500/mdfld_dsi_dpi.c | 28 ++--- drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c| 42 --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 52 +++-- drivers/gpu/drm/mediatek/mtk_dpi.c | 60 +- drivers/gpu/drm/mediatek/mtk_dsi.c | 14 +-- drivers/gpu/drm/meson/meson_venc.c | 149 +++- drivers/gpu/drm/pl111/pl111_display.c | 40 +++ drivers/gpu/drm/sun4i/sun4i_tv.c| 67 --- drivers/gpu/drm/tegra/dc.c | 15 ++- drivers/gpu/drm/tilcdc/tilcdc_crtc.c| 60 +- 15 files changed, 280 insertions(+), 390 deletions(-) -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 06/13] drm/kms/mode/hisilicon-kirin-dsi-ade: using helper function drm_display_mode_to_videomode for calculating timing parameters
-Avoidded duplicate logic for the timing calculations -Removed func ade_set_pix_clk and combined it with func ade_ldi_set_mode Signed-off-by: Satendra Singh Thakur Cc: Madhur Verma Cc: Hemanshu Srivastava --- drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c| 42 ++-- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 52 + 2 files changed, 39 insertions(+), 55 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c index b4c7af3..902f63f 100644 --- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c +++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "dw_dsi_reg.h" @@ -447,7 +448,7 @@ static void dsi_set_mode_timing(void __iomem *base, struct drm_display_mode *mode, enum mipi_dsi_pixel_format format) { - u32 hfp, hbp, hsw, vfp, vbp, vsw; + struct videomode vm; u32 hline_time; u32 hsa_time; u32 hbp_time; @@ -467,25 +468,22 @@ static void dsi_set_mode_timing(void __iomem *base, * The DSI IP accepts vertical timing using lines as normal, * but horizontal timing is a mixture of pixel-clocks for the * active region and byte-lane clocks for the blanking-related -* timings. hfp is specified as the total hline_time in byte- -* lane clocks minus hsa, hbp and active. +* timings. vm.hfront_porch is specified as the total hline_time +* in byte-lane clocks minus hsa, vm.hback_porch and active. */ pixel_clk_kHz = mode->clock; htot = mode->htotal; vtot = mode->vtotal; - hfp = mode->hsync_start - mode->hdisplay; - hbp = mode->htotal - mode->hsync_end; - hsw = mode->hsync_end - mode->hsync_start; - vfp = mode->vsync_start - mode->vdisplay; - vbp = mode->vtotal - mode->vsync_end; - vsw = mode->vsync_end - mode->vsync_start; - if (vsw > 15) { - DRM_DEBUG_DRIVER("vsw exceeded 15\n"); - vsw = 15; + + drm_display_mode_to_videomode(mode, &vm); + + if (vm.vsync_len > 15) { + DRM_DEBUG_DRIVER("vm.vsync_len exceeded 15\n"); + vm.vsync_len = 15; } - hsa_time = (hsw * lane_byte_clk_kHz) / pixel_clk_kHz; - hbp_time = (hbp * lane_byte_clk_kHz) / pixel_clk_kHz; + hsa_time = (vm.hsync_len * lane_byte_clk_kHz) / pixel_clk_kHz; + hbp_time = (vm.hback_porch * lane_byte_clk_kHz) / pixel_clk_kHz; tmp = (u64)htot * (u64)lane_byte_clk_kHz; hline_time = DIV_ROUND_UP(tmp, pixel_clk_kHz); @@ -494,17 +492,17 @@ static void dsi_set_mode_timing(void __iomem *base, writel(hbp_time, base + VID_HBP_TIME); writel(hline_time, base + VID_HLINE_TIME); - writel(vsw, base + VID_VSA_LINES); - writel(vbp, base + VID_VBP_LINES); - writel(vfp, base + VID_VFP_LINES); + writel(vm.vsync_len, base + VID_VSA_LINES); + writel(vm.vback_porch, base + VID_VBP_LINES); + writel(vm.vfront_porch, base + VID_VFP_LINES); writel(mode->vdisplay, base + VID_VACTIVE_LINES); writel(mode->hdisplay, base + VID_PKT_SIZE); - DRM_DEBUG_DRIVER("htot=%d, hfp=%d, hbp=%d, hsw=%d\n", -htot, hfp, hbp, hsw); - DRM_DEBUG_DRIVER("vtol=%d, vfp=%d, vbp=%d, vsw=%d\n", -vtot, vfp, vbp, vsw); - DRM_DEBUG_DRIVER("hsa_time=%d, hbp_time=%d, hline_time=%d\n", + DRM_DEBUG_DRIVER("htot=%d, vm.hfront_porch=%d, vm.hback_porch=%d, vm.hsync_len=%d\n", +htot, vm.hfront_porch, vm.hback_porch, vm.hsync_len); + DRM_DEBUG_DRIVER("vtol=%d, vm.vfront_porch=%d, vm.vback_porch=%d, vm.vsync_len=%d\n", +vtot, vm.vfront_porch, vm.vback_porch, vm.vsync_len); + DRM_DEBUG_DRIVER("hsa_time=%d, vm.hback_porch_time=%d, hline_time=%d\n", hsa_time, hbp_time, hline_time); } diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index 2269be9..c3eea17 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "kirin_drm_drv.h" #include "kirin_ade_reg.h" @@ -190,24 +191,6 @@ static bool ade_crtc_mode_fixup(struct drm_crtc *crtc, return true; } - -static void ade_set_pix_clk(struct ade_hw_ctx *ctx, - struct drm_display_mode *mode, - struct drm_display_mode *adj_mode) -{ - u32 clk_Hz = mode->clock * 1000; - int ret; - - /* -* Success should be guaranteed in mode_valid call back, -* so failure shouldn't happen here -*/ - ret = clk_set_rate(ctx->ade_pix_clk, clk_Hz); - if (ret) -
[PATCH 1/8] drm: add SPDX idenitifier and clarify license
This is dual licensed under GPL-2.0 or MIT. Signed-off-by: Dirk Hohndel (VMware) --- drivers/gpu/drm/drm_vma_manager.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/drm_vma_manager.c b/drivers/gpu/drm/drm_vma_manager.c index 23c749c05b5a..a6b2fe36b025 100644 --- a/drivers/gpu/drm/drm_vma_manager.c +++ b/drivers/gpu/drm/drm_vma_manager.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /* * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA * Copyright (c) 2012 David Airlie -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 4/8] drm/noveau: Add SPDX identifier and clarify license
This is dual licensed under GPL-2.0 or MIT. Signed-off-by: Dirk Hohndel (VMware) --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index dff51a0ee028..e7083cd75b0f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c @@ -1,8 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /* * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA, - * All Rights Reserved. * Copyright (c) 2009 VMware, Inc., Palo Alto, CA., USA, - * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 8/8] drm/vmwgfx: add SPDX idenitifier and clarify license
This is dual licensed under GPL-2.0 or MIT. Signed-off-by: Dirk Hohndel (VMware) --- drivers/gpu/drm/vmwgfx/device_include/svga3d_caps.h| 3 ++- drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h | 3 ++- drivers/gpu/drm/vmwgfx/device_include/svga3d_devcaps.h | 3 ++- drivers/gpu/drm/vmwgfx/device_include/svga3d_dx.h | 3 ++- drivers/gpu/drm/vmwgfx/device_include/svga3d_limits.h | 3 ++- drivers/gpu/drm/vmwgfx/device_include/svga3d_reg.h | 3 ++- drivers/gpu/drm/vmwgfx/device_include/svga3d_surfacedefs.h | 4 ++-- drivers/gpu/drm/vmwgfx/device_include/svga3d_types.h | 3 ++- drivers/gpu/drm/vmwgfx/device_include/svga_escape.h| 3 ++- drivers/gpu/drm/vmwgfx/device_include/svga_overlay.h | 3 ++- drivers/gpu/drm/vmwgfx/device_include/svga_reg.h | 3 ++- drivers/gpu/drm/vmwgfx/device_include/svga_types.h | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_binding.c| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_binding.h| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_blit.c | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_context.c| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_fence.h | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_irq.c| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_kms.h| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_marker.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_mob.c| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_msg.c| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_prime.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_reg.h| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_resource_priv.h | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_simple_resource.c| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_so.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_so.h | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c| 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_va.c | 4 ++-- 51 files changed, 102 insertions(+), 90 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga3d_caps.h b/drivers/gpu/drm/vmwgfx/device_include/svga3d_caps.h index 9ce2466a5d00..69c4253fbfbb 100644 --- a/drivers/gpu/drm/vmwgfx/device_include/svga3d_caps.h +++ b/drivers/gpu/drm/vmwgfx/device_include/svga3d_caps.h @@ -1,5 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ /** - * Copyright 2007-2015 VMware, Inc. All rights reserved. + * Copyright 2007-2015 VMware, Inc. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h b/drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h index 2dfd57c5f463..3bf75978e155 100644 --- a/drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h +++ b/drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h @@ -1,5 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ /** - * Copyright 1998-2015 VMware, Inc. All rights reserved. + * Copyright 1998-2015 VMware, Inc. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga3d_devcaps.h b/drivers/gpu/drm/vmwgf
[PATCH 07/13] drm/kms/mode/meson-encoder: using helper function drm_display_mode_to_videomode for calculating timing parameters
-Duplicate logic for the timing params is avoided -Arithmatic operator *,/ are replaced by logical >>, << operators -The flags DRM_MODE_FLAG_* are replaced with DISPLAY_FLAGS_* flags -Combined similar if statements Signed-off-by: Satendra Singh Thakur Cc: Madhur Verma Cc: Hemanshu Srivastava --- drivers/gpu/drm/meson/meson_venc.c | 149 - 1 file changed, 65 insertions(+), 84 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_venc.c b/drivers/gpu/drm/meson/meson_venc.c index 6e27013..dddf914 100644 --- a/drivers/gpu/drm/meson/meson_venc.c +++ b/drivers/gpu/drm/meson/meson_venc.c @@ -25,7 +25,7 @@ #include "meson_vpp.h" #include "meson_vclk.h" #include "meson_registers.h" - +#include /** * DOC: Video Encoder * @@ -1125,9 +1125,6 @@ void meson_venc_hdmi_mode_set(struct meson_drm *priv, int vic, bool hdmi_repeat = false; unsigned int venc_hdmi_latency = 2; unsigned long total_pixels_venc = 0; - unsigned long active_pixels_venc = 0; - unsigned long front_porch_venc = 0; - unsigned long hsync_pixels_venc = 0; unsigned long de_h_begin = 0; unsigned long de_h_end = 0; unsigned long de_v_begin_even = 0; @@ -1143,9 +1140,7 @@ void meson_venc_hdmi_mode_set(struct meson_drm *priv, int vic, unsigned long vs_eline_odd = 0; unsigned long vso_begin_evn = 0; unsigned long vso_begin_odd = 0; - unsigned int eof_lines; - unsigned int sof_lines; - unsigned int vsync_lines; + struct videomode vm = {}; if (meson_venc_hdmi_supported_vic(vic)) vmode = meson_venc_hdmi_get_vic_vmode(vic); @@ -1156,9 +1151,9 @@ void meson_venc_hdmi_mode_set(struct meson_drm *priv, int vic, DRM_MODE_FMT "\n", __func__, DRM_MODE_ARG(mode)); return; } - + drm_display_mode_to_videomode(mode, &vm); /* Use VENCI for 480i and 576i and double HDMI pixels */ - if (mode->flags & DRM_MODE_FLAG_DBLCLK) { + if (vm.flags & DISPLAY_FLAGS_DOUBLECLK) { hdmi_repeat = true; use_enci = true; venc_hdmi_latency = 1; @@ -1167,40 +1162,25 @@ void meson_venc_hdmi_mode_set(struct meson_drm *priv, int vic, /* Repeat VENC pixels for 480/576i/p, 720p50/60 and 1080p50/60 */ if (meson_venc_hdmi_venc_repeat(vic)) venc_repeat = true; - - eof_lines = mode->vsync_start - mode->vdisplay; - if (mode->flags & DRM_MODE_FLAG_INTERLACE) - eof_lines /= 2; - sof_lines = mode->vtotal - mode->vsync_end; - if (mode->flags & DRM_MODE_FLAG_INTERLACE) - sof_lines /= 2; - vsync_lines = mode->vsync_end - mode->vsync_start; - if (mode->flags & DRM_MODE_FLAG_INTERLACE) - vsync_lines /= 2; + if (vm.flags & DISPLAY_FLAGS_INTERLACED) { + vm.vfront_porch >>= 1; + vm.vback_porch >>= 1; + vm.vsync_len >>= 1; + } total_pixels_venc = mode->htotal; - if (hdmi_repeat) - total_pixels_venc /= 2; - if (venc_repeat) - total_pixels_venc *= 2; - - active_pixels_venc = mode->hdisplay; - if (hdmi_repeat) - active_pixels_venc /= 2; - if (venc_repeat) - active_pixels_venc *= 2; - - front_porch_venc = (mode->hsync_start - mode->hdisplay); - if (hdmi_repeat) - front_porch_venc /= 2; - if (venc_repeat) - front_porch_venc *= 2; - - hsync_pixels_venc = (mode->hsync_end - mode->hsync_start); - if (hdmi_repeat) - hsync_pixels_venc /= 2; - if (venc_repeat) - hsync_pixels_venc *= 2; + if (hdmi_repeat) { + total_pixels_venc >>= 1; + vm.hactive >>= 1; + vm.hfront_porch >>= 1; + vm.hsync_len >>= 1; + } + if (venc_repeat) { + total_pixels_venc <<= 1; + vm.hactive <<= 1; + vm.hfront_porch <<= 1; + vm.hsync_len <<= 1; + } /* Disable VDACs */ writel_bits_relaxed(0xff, 0xff, @@ -1302,7 +1282,7 @@ void meson_venc_hdmi_mode_set(struct meson_drm *priv, int vic, _REG(ENCI_VFIFO2VD_PIXEL_START)) + venc_hdmi_latency, total_pixels_venc); - de_h_end = modulo(de_h_begin + active_pixels_venc, + de_h_end = modulo(de_h_begin + vm.hactive, total_pixels_venc); writel_relaxed(de_h_begin, @@ -1312,10 +1292,10 @@ void meson_venc_hdmi_mode_set(struct meson_drm *priv, int vic, de_v_begin_even = readl_relaxed(priv->io_base + _REG(ENCI_VFIFO2VD_LINE_TOP_START)); - de_v_end_even =
[PATCH 1/2] gpu: ipu-v3: csi: pass back mbus_code_to_bus_cfg error codes
From: Enrico Scholz mbus_code_to_bus_cfg() can fail on unknown mbus codes; pass back the error to the caller. Signed-off-by: Enrico Scholz Signed-off-by: Jan Luebbe --- drivers/gpu/ipu-v3/ipu-csi.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/ipu-v3/ipu-csi.c b/drivers/gpu/ipu-v3/ipu-csi.c index caa05b0702e1..39c3aabb6d17 100644 --- a/drivers/gpu/ipu-v3/ipu-csi.c +++ b/drivers/gpu/ipu-v3/ipu-csi.c @@ -318,13 +318,17 @@ static int mbus_code_to_bus_cfg(struct ipu_csi_bus_config *cfg, u32 mbus_code) /* * Fill a CSI bus config struct from mbus_config and mbus_framefmt. */ -static void fill_csi_bus_cfg(struct ipu_csi_bus_config *csicfg, +static int fill_csi_bus_cfg(struct ipu_csi_bus_config *csicfg, struct v4l2_mbus_config *mbus_cfg, struct v4l2_mbus_framefmt *mbus_fmt) { + int rc; + memset(csicfg, 0, sizeof(*csicfg)); - mbus_code_to_bus_cfg(csicfg, mbus_fmt->code); + rc = mbus_code_to_bus_cfg(csicfg, mbus_fmt->code); + if (rc < 0) + return rc; switch (mbus_cfg->type) { case V4L2_MBUS_PARALLEL: @@ -355,6 +359,8 @@ static void fill_csi_bus_cfg(struct ipu_csi_bus_config *csicfg, /* will never get here, keep compiler quiet */ break; } + + return 0; } int ipu_csi_init_interface(struct ipu_csi *csi, @@ -364,8 +370,11 @@ int ipu_csi_init_interface(struct ipu_csi *csi, struct ipu_csi_bus_config cfg; unsigned long flags; u32 width, height, data = 0; + int rc; - fill_csi_bus_cfg(&cfg, mbus_cfg, mbus_fmt); + rc = fill_csi_bus_cfg(&cfg, mbus_cfg, mbus_fmt); + if (rc < 0) + return rc; /* set default sensor frame width and height */ width = mbus_fmt->width; @@ -586,11 +595,14 @@ int ipu_csi_set_mipi_datatype(struct ipu_csi *csi, u32 vc, struct ipu_csi_bus_config cfg; unsigned long flags; u32 temp; + int rc; if (vc > 3) return -EINVAL; - mbus_code_to_bus_cfg(&cfg, mbus_fmt->code); + rc = mbus_code_to_bus_cfg(&cfg, mbus_fmt->code); + if (rc < 0) + return rc; spin_lock_irqsave(&csi->lock, flags); -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v1 4/5] ARM: dts: tegra30: Add IOMMU nodes to Host1x and its clients
Enable IOMMU support for Host1x and its clients. Signed-off-by: Dmitry Osipenko --- arch/arm/boot/dts/tegra30.dtsi | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi index a110cf84d85f..09087b9c5e26 100644 --- a/arch/arm/boot/dts/tegra30.dtsi +++ b/arch/arm/boot/dts/tegra30.dtsi @@ -112,6 +112,7 @@ clocks = <&tegra_car TEGRA30_CLK_HOST1X>; resets = <&tegra_car 28>; reset-names = "host1x"; + iommus = <&mc TEGRA_SWGROUP_HC>; #address-cells = <1>; #size-cells = <1>; @@ -125,6 +126,8 @@ clocks = <&tegra_car TEGRA30_CLK_MPE>; resets = <&tegra_car 60>; reset-names = "mpe"; + + iommus = <&mc TEGRA_SWGROUP_MPE>; }; vi@5408 { @@ -134,6 +137,8 @@ clocks = <&tegra_car TEGRA30_CLK_VI>; resets = <&tegra_car 20>; reset-names = "vi"; + + iommus = <&mc TEGRA_SWGROUP_VI>; }; epp@540c { @@ -143,6 +148,8 @@ clocks = <&tegra_car TEGRA30_CLK_EPP>; resets = <&tegra_car 19>; reset-names = "epp"; + + iommus = <&mc TEGRA_SWGROUP_EPP>; }; isp@5410 { @@ -152,6 +159,8 @@ clocks = <&tegra_car TEGRA30_CLK_ISP>; resets = <&tegra_car 23>; reset-names = "isp"; + + iommus = <&mc TEGRA_SWGROUP_ISP>; }; gr2d@5414 { @@ -161,6 +170,8 @@ clocks = <&tegra_car TEGRA30_CLK_GR2D>; resets = <&tegra_car 21>; reset-names = "2d"; + + iommus = <&mc TEGRA_SWGROUP_G2>; }; gr3d@5418 { @@ -172,6 +183,9 @@ resets = <&tegra_car 24>, <&tegra_car 98>; reset-names = "3d", "3d2"; + + iommus = <&mc TEGRA_SWGROUP_NV>, +<&mc TEGRA_SWGROUP_NV2>; }; dc@5420 { -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 3/3] drm/tegra: dc: Rename supports_blending to has_legacy_blending
Older Tegra's support blending. Rename SoC info entry supports_blending to has_legacy_blending to eliminate confusion. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/dc.c | 20 ++-- drivers/gpu/drm/tegra/dc.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index be624ac700a8..c28a0a2d496b 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -508,10 +508,10 @@ static void tegra_dc_setup_window(struct tegra_plane *plane, tegra_plane_writel(plane, value, DC_WIN_WIN_OPTIONS); - if (dc->soc->supports_blending) - tegra_plane_setup_blending(plane, window); - else + if (dc->soc->has_legacy_blending) tegra_plane_setup_blending_legacy(plane); + else + tegra_plane_setup_blending(plane, window); } static const u32 tegra20_primary_formats[] = { @@ -617,7 +617,7 @@ static int tegra_plane_atomic_check(struct drm_plane *plane, * the corresponding opaque formats. However, the opaque formats can * be emulated by disabling alpha blending for the plane. */ - if (!dc->soc->supports_blending) { + if (dc->soc->has_legacy_blending) { err = tegra_plane_setup_legacy_state(tegra, plane_state); if (err < 0) return err; @@ -2099,7 +2099,7 @@ static const struct tegra_dc_soc_info tegra20_dc_soc_info = { .supports_interlacing = false, .supports_cursor = false, .supports_block_linear = false, - .supports_blending = false, + .has_legacy_blending = true, .pitch_align = 8, .has_powergate = false, .coupled_pm = true, @@ -2118,7 +2118,7 @@ static const struct tegra_dc_soc_info tegra30_dc_soc_info = { .supports_interlacing = false, .supports_cursor = false, .supports_block_linear = false, - .supports_blending = false, + .has_legacy_blending = true, .pitch_align = 8, .has_powergate = false, .coupled_pm = false, @@ -2137,7 +2137,7 @@ static const struct tegra_dc_soc_info tegra114_dc_soc_info = { .supports_interlacing = false, .supports_cursor = false, .supports_block_linear = false, - .supports_blending = false, + .has_legacy_blending = true, .pitch_align = 64, .has_powergate = true, .coupled_pm = false, @@ -2156,7 +2156,7 @@ static const struct tegra_dc_soc_info tegra124_dc_soc_info = { .supports_interlacing = true, .supports_cursor = true, .supports_block_linear = true, - .supports_blending = true, + .has_legacy_blending = false, .pitch_align = 64, .has_powergate = true, .coupled_pm = false, @@ -2175,7 +2175,7 @@ static const struct tegra_dc_soc_info tegra210_dc_soc_info = { .supports_interlacing = true, .supports_cursor = true, .supports_block_linear = true, - .supports_blending = true, + .has_legacy_blending = false, .pitch_align = 64, .has_powergate = true, .coupled_pm = false, @@ -2228,7 +2228,7 @@ static const struct tegra_dc_soc_info tegra186_dc_soc_info = { .supports_interlacing = true, .supports_cursor = true, .supports_block_linear = true, - .supports_blending = true, + .has_legacy_blending = false, .pitch_align = 64, .has_powergate = false, .coupled_pm = false, diff --git a/drivers/gpu/drm/tegra/dc.h b/drivers/gpu/drm/tegra/dc.h index 8673cd97afc3..0774356c845a 100644 --- a/drivers/gpu/drm/tegra/dc.h +++ b/drivers/gpu/drm/tegra/dc.h @@ -55,7 +55,7 @@ struct tegra_dc_soc_info { bool supports_interlacing; bool supports_cursor; bool supports_block_linear; - bool supports_blending; + bool has_legacy_blending; unsigned int pitch_align; bool has_powergate; bool coupled_pm; -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 16/26] drm/bridge: tc358767: provide an owner .odev device
The .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/bridge/tc358767.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 0fd9cf27542c..75f93e1d0bf5 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1331,8 +1331,8 @@ static int tc_probe(struct i2c_client *client, const struct i2c_device_id *id) tc_connector_set_polling(tc, &tc->connector); + tc->bridge.odev = dev; tc->bridge.funcs = &tc_bridge_funcs; - tc->bridge.of_node = dev->of_node; drm_bridge_add(&tc->bridge); i2c_set_clientdata(client, tc); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 09/26] drm/bridge: nxp-ptn3460: provide an owner .odev device
The .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/bridge/nxp-ptn3460.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/nxp-ptn3460.c b/drivers/gpu/drm/bridge/nxp-ptn3460.c index d64a3283822a..fa832f32b518 100644 --- a/drivers/gpu/drm/bridge/nxp-ptn3460.c +++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c @@ -329,8 +329,8 @@ static int ptn3460_probe(struct i2c_client *client, return ret; } + ptn_bridge->bridge.odev = dev; ptn_bridge->bridge.funcs = &ptn3460_bridge_funcs; - ptn_bridge->bridge.of_node = dev->of_node; drm_bridge_add(&ptn_bridge->bridge); i2c_set_clientdata(client, ptn_bridge); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/4] phy: rockchip-typec: support variable phy config value
the phy config values used to fix in dp firmware, but some boards need change these values to do training and get the better eye diagram result. So support that in phy driver. Signed-off-by: Chris Zhong Signed-off-by: Lin Huang --- drivers/phy/rockchip/phy-rockchip-typec.c | 286 +++--- include/soc/rockchip/rockchip_phy_typec.h | 72 2 files changed, 259 insertions(+), 99 deletions(-) create mode 100644 include/soc/rockchip/rockchip_phy_typec.h diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c index 76a4b58..831a93b 100644 --- a/drivers/phy/rockchip/phy-rockchip-typec.c +++ b/drivers/phy/rockchip/phy-rockchip-typec.c @@ -63,6 +63,7 @@ #include #include +#include #define CMN_SSM_BANDGAP(0x21 << 2) #define CMN_SSM_BIAS (0x22 << 2) @@ -323,23 +324,31 @@ * clock 0: PLL 0 div 1 * clock 1: PLL 1 div 2 */ -#define CLK_PLL_CONFIG 0X30 +#define CLK_PLL1_DIV1 0x20 +#define CLK_PLL1_DIV2 0x30 #define CLK_PLL_MASK 0x33 #define CMN_READY BIT(0) +#define DP_PLL_CLOCK_ENABLE_ACKBIT(3) #define DP_PLL_CLOCK_ENABLEBIT(2) +#define DP_PLL_ENABLE_ACK BIT(1) #define DP_PLL_ENABLE BIT(0) #define DP_PLL_DATA_RATE_RBR ((2 << 12) | (4 << 8)) #define DP_PLL_DATA_RATE_HBR ((2 << 12) | (4 << 8)) #define DP_PLL_DATA_RATE_HBR2 ((1 << 12) | (2 << 8)) +#define DP_PLL_DATA_RATE_MASK 0xff00 -#define DP_MODE_A0 BIT(4) -#define DP_MODE_A2 BIT(6) -#define DP_MODE_ENTER_A0 0xc101 -#define DP_MODE_ENTER_A2 0xc104 +#define DP_MODE_MASK 0xf +#define DP_MODE_ENTER_A0 BIT(0) +#define DP_MODE_ENTER_A2 BIT(2) +#define DP_MODE_ENTER_A3 BIT(3) +#define DP_MODE_A0_ACK BIT(4) +#define DP_MODE_A2_ACK BIT(6) +#define DP_MODE_A3_ACK BIT(7) +#define DP_LINK_RESET_DEASSERTED BIT(8) -#define PHY_MODE_SET_TIMEOUT 10 +#define PHY_MODE_SET_TIMEOUT 100 #define PIN_ASSIGN_C_E 0x51d9 #define PIN_ASSIGN_D_F 0x5100 @@ -349,51 +358,7 @@ #define MODE_DFP_USB BIT(1) #define MODE_DFP_DPBIT(2) -struct usb3phy_reg { - u32 offset; - u32 enable_bit; - u32 write_enable; -}; - -/** - * struct rockchip_usb3phy_port_cfg: usb3-phy port configuration. - * @reg: the base address for usb3-phy config. - * @typec_conn_dir: the register of type-c connector direction. - * @usb3tousb2_en: the register of type-c force usb2 to usb2 enable. - * @external_psm: the register of type-c phy external psm clock. - * @pipe_status: the register of type-c phy pipe status. - * @usb3_host_disable: the register of type-c usb3 host disable. - * @usb3_host_port: the register of type-c usb3 host port. - * @uphy_dp_sel: the register of type-c phy DP select control. - */ -struct rockchip_usb3phy_port_cfg { - unsigned int reg; - struct usb3phy_reg typec_conn_dir; - struct usb3phy_reg usb3tousb2_en; - struct usb3phy_reg external_psm; - struct usb3phy_reg pipe_status; - struct usb3phy_reg usb3_host_disable; - struct usb3phy_reg usb3_host_port; - struct usb3phy_reg uphy_dp_sel; -}; - -struct rockchip_typec_phy { - struct device *dev; - void __iomem *base; - struct extcon_dev *extcon; - struct regmap *grf_regs; - struct clk *clk_core; - struct clk *clk_ref; - struct reset_control *uphy_rst; - struct reset_control *pipe_rst; - struct reset_control *tcphy_rst; - const struct rockchip_usb3phy_port_cfg *port_cfgs; - /* mutex to protect access to individual PHYs */ - struct mutex lock; - - bool flip; - u8 mode; -}; +#define DEFAULT_RATE 162000 struct phy_reg { u16 value; @@ -417,15 +382,15 @@ struct phy_reg usb3_pll_cfg[] = { { 0x8, CMN_DIAG_PLL0_LF_PROG }, }; -struct phy_reg dp_pll_cfg[] = { +struct phy_reg dp_pll_rbr_cfg[] = { { 0xf0, CMN_PLL1_VCOCAL_INIT }, { 0x18, CMN_PLL1_VCOCAL_ITER }, { 0x30b9, CMN_PLL1_VCOCAL_START }, - { 0x21c,CMN_PLL1_INTDIV }, + { 0x87, CMN_PLL1_INTDIV }, { 0,CMN_PLL1_FRACDIV }, - { 0x5, CMN_PLL1_HIGH_THR }, - { 0x35, CMN_PLL1_SS_CTRL1 }, - { 0x7f1e, CMN_PLL1_SS_CTRL2 }, + { 0x22, CMN_PLL1_HIGH_THR }, + { 0x8000, CMN_PLL1_SS_CTRL1 }, + { 0,CMN_PLL1_SS_CTRL2 }, { 0x20, CMN_PLL1_DSM_DIAG }, { 0,CMN_PLLSM1_USER_DEF_CTRL }, { 0,CMN_DIAG_PLL1_OVRD
[PATCH v1 0/5] Support IOMMU for 2d/3d on Tegra30/114
Hi, This series enables IOMMU support for 2d/3d HW on Tegra30/114, as a result userspace that uses 2d/3d could work with the active IOMMU. Dmitry Osipenko (5): drm/tegra: dc: Balance IOMMU group refcounting drm/tegra: gr2d: Add IOMMU support drm/tegra: gr3d: Add IOMMU support ARM: dts: tegra30: Add IOMMU nodes to Host1x and its clients ARM: dts: tegra114: Add IOMMU nodes to Host1x and its clients arch/arm/boot/dts/tegra114.dtsi | 5 + arch/arm/boot/dts/tegra30.dtsi | 14 + drivers/gpu/drm/tegra/dc.c | 35 - drivers/gpu/drm/tegra/dc.h | 2 +- drivers/gpu/drm/tegra/drm.h | 2 +- drivers/gpu/drm/tegra/gr2d.c| 31 +++-- drivers/gpu/drm/tegra/gr3d.c| 27 + 7 files changed, 94 insertions(+), 22 deletions(-) -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v1 1/3] drm/tegra: dc: Enable plane scaling filters
Currently resized plane produces a "pixelated" image which doesn't look nice, especially in a case of a video overlay. Enable scaling filters that significantly improve image quality of a scaled overlay. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/dc.c | 51 ++ drivers/gpu/drm/tegra/dc.h | 7 ++ 2 files changed, 58 insertions(+) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 9f83a65b5ea9..2e81142281c3 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -361,6 +361,47 @@ static void tegra_dc_setup_window(struct tegra_plane *plane, if (window->bottom_up) value |= V_DIRECTION; + if (!(dc->soc->has_win_a_without_filter && plane->index == 0) && + !(window->src.w == window->dst.w)) { + /* +* Enable horizontal 6-tap filter and set filtering +* coefficients to the default values defined in TRM. +*/ + tegra_plane_writel(plane, 0x8000, DC_WIN_H_FILTER_P(0)); + tegra_plane_writel(plane, 0x3e087ce1, DC_WIN_H_FILTER_P(1)); + tegra_plane_writel(plane, 0x3b117ac1, DC_WIN_H_FILTER_P(2)); + tegra_plane_writel(plane, 0x591b73aa, DC_WIN_H_FILTER_P(3)); + tegra_plane_writel(plane, 0x57256d9a, DC_WIN_H_FILTER_P(4)); + tegra_plane_writel(plane, 0x552f668b, DC_WIN_H_FILTER_P(5)); + tegra_plane_writel(plane, 0x73385e8b, DC_WIN_H_FILTER_P(6)); + tegra_plane_writel(plane, 0x72435583, DC_WIN_H_FILTER_P(7)); + tegra_plane_writel(plane, 0x714c4c8b, DC_WIN_H_FILTER_P(8)); + tegra_plane_writel(plane, 0x70554393, DC_WIN_H_FILTER_P(9)); + tegra_plane_writel(plane, 0x715e389b, DC_WIN_H_FILTER_P(10)); + tegra_plane_writel(plane, 0x71662faa, DC_WIN_H_FILTER_P(11)); + tegra_plane_writel(plane, 0x536d25ba, DC_WIN_H_FILTER_P(12)); + tegra_plane_writel(plane, 0x55731bca, DC_WIN_H_FILTER_P(13)); + tegra_plane_writel(plane, 0x387a11d9, DC_WIN_H_FILTER_P(14)); + tegra_plane_writel(plane, 0x3c7c08f1, DC_WIN_H_FILTER_P(15)); + + value |= H_FILTER; + } + + if (!(dc->soc->has_win_a_without_filter && plane->index == 0) && + !(dc->soc->has_win_c_without_vert_filter && plane->index == 2) && + !(window->src.h == window->dst.h)) { + unsigned int i, k; + + /* +* Enable vertical 2-tap filter and set filtering +* coefficients to the default values defined in TRM. +*/ + for (i = 0, k = 128; i < 16; i++, k -= 8) + tegra_plane_writel(plane, k, DC_WIN_V_FILTER_P(i)); + + value |= V_FILTER; + } + tegra_plane_writel(plane, value, DC_WIN_WIN_OPTIONS); if (dc->soc->supports_blending) @@ -1978,6 +2019,8 @@ static const struct tegra_dc_soc_info tegra20_dc_soc_info = { .num_overlay_formats = ARRAY_SIZE(tegra20_overlay_formats), .overlay_formats = tegra20_overlay_formats, .modifiers = tegra20_modifiers, + .has_win_a_without_filter = true, + .has_win_c_without_vert_filter = true, }; static const struct tegra_dc_soc_info tegra30_dc_soc_info = { @@ -1995,6 +2038,8 @@ static const struct tegra_dc_soc_info tegra30_dc_soc_info = { .num_overlay_formats = ARRAY_SIZE(tegra20_overlay_formats), .overlay_formats = tegra20_overlay_formats, .modifiers = tegra20_modifiers, + .has_win_a_without_filter = false, + .has_win_c_without_vert_filter = false, }; static const struct tegra_dc_soc_info tegra114_dc_soc_info = { @@ -2012,6 +2057,8 @@ static const struct tegra_dc_soc_info tegra114_dc_soc_info = { .num_overlay_formats = ARRAY_SIZE(tegra114_overlay_formats), .overlay_formats = tegra114_overlay_formats, .modifiers = tegra20_modifiers, + .has_win_a_without_filter = false, + .has_win_c_without_vert_filter = false, }; static const struct tegra_dc_soc_info tegra124_dc_soc_info = { @@ -2029,6 +2076,8 @@ static const struct tegra_dc_soc_info tegra124_dc_soc_info = { .num_overlay_formats = ARRAY_SIZE(tegra124_overlay_formats), .overlay_formats = tegra124_overlay_formats, .modifiers = tegra124_modifiers, + .has_win_a_without_filter = false, + .has_win_c_without_vert_filter = false, }; static const struct tegra_dc_soc_info tegra210_dc_soc_info = { @@ -2046,6 +2095,8 @@ static const struct tegra_dc_soc_info tegra210_dc_soc_info = { .num_overlay_formats = ARRAY_SIZE(tegra114_overlay_formats), .overlay_formats = tegra114_overlay_formats, .modifiers = tegra124_modifiers, + .has_win_a_without_filter = false, + .has_win_c_without_vert_filter = false, }; static const struct t
[PATCH 08/13] drm/kms/mode/pl111-display: using helper function drm_display_mode_to_videomode for calculating timing parameters
To avoid duplicate logic for the same Signed-off-by: Satendra Singh Thakur Cc: Madhur Verma Cc: Hemanshu Srivastava --- drivers/gpu/drm/pl111/pl111_display.c | 40 +-- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c index 3106464..104f318 100644 --- a/drivers/gpu/drm/pl111/pl111_display.c +++ b/drivers/gpu/drm/pl111/pl111_display.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "pl111_drm.h" @@ -130,13 +131,14 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe, struct drm_framebuffer *fb = plane->state->fb; struct drm_connector *connector = priv->connector; struct drm_bridge *bridge = priv->bridge; + struct videomode vm; u32 cntl; - u32 ppl, hsw, hfp, hbp; - u32 lpp, vsw, vfp, vbp; - u32 cpl, tim2; + u32 tim2; int ret; - ret = clk_set_rate(priv->clk, mode->clock * 1000); + drm_display_mode_to_videomode(mode, &vm); + + ret = clk_set_rate(priv->clk, vm.pixelclock); if (ret) { dev_err(drm->dev, "Failed to set pixel clock rate to %d: %d\n", @@ -145,27 +147,15 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe, clk_prepare_enable(priv->clk); - ppl = (mode->hdisplay / 16) - 1; - hsw = mode->hsync_end - mode->hsync_start - 1; - hfp = mode->hsync_start - mode->hdisplay - 1; - hbp = mode->htotal - mode->hsync_end - 1; - - lpp = mode->vdisplay - 1; - vsw = mode->vsync_end - mode->vsync_start - 1; - vfp = mode->vsync_start - mode->vdisplay; - vbp = mode->vtotal - mode->vsync_end; - - cpl = mode->hdisplay - 1; - - writel((ppl << 2) | - (hsw << 8) | - (hfp << 16) | - (hbp << 24), + writelvm.hactive >> 4) - 1) << 2) | + ((vm.hsync_len - 1) << 8) | + ((vm.hfront_porch - 1) << 16) | + ((vm.hback_porch - 1) << 24), priv->regs + CLCD_TIM0); - writel(lpp | - (vsw << 10) | - (vfp << 16) | - (vbp << 24), + writel((vm.vactive - 1) | + ((vm.vsync_len - 1) << 10) | + ((vm.vfront_porch) << 16) | + ((vm.vback_porch) << 24), priv->regs + CLCD_TIM1); spin_lock(&priv->tim2_lock); @@ -214,7 +204,7 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe, tim2 ^= TIM2_IPC; } - tim2 |= cpl << 16; + tim2 |= (vm.hactive - 1) << 16; writel(tim2, priv->regs + CLCD_TIM2); spin_unlock(&priv->tim2_lock); -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v1] drm/kms/mode: added a new helper for calculating videomode from crtc's display mode
1. -Added a new helper drm_display_mode_crtc_to_videomode -This helper calculates mode parameters like --horizontal front_porch, back_porch, sync length --vertical front_porch, back_porch, sync length -using crtc fields of struct drm_display_mode -It uses following fields of crtc mode --horizontal sync start/end, active and total length --vertical sync start/end, active and total length 2. -Most of the driver use user-supplied mode for calculating videomode -However, few drivers use HW (crtc) mode for calculating videomode -This helper will be useful for such drivers 3. -Currently following drivers will be using this new helper -arm hdlcd -atmel hlcdc -exynos 5433 decon -exynos7 decon -exynos fimd 4. -This change reduces several redundant lines of code for many drivers Reviewed-by: Jani Nikula Acked-by: Liviu Dudau Signed-off-by: Satendra Singh Thakur Acked-by: Madhur Verma Cc: Hemanshu Srivastava --- v1: Fixed review comments by Mr Jani Initialized with 0 the struct videomode so that stack garbage won't come Added Reviewed-by and Acked-by fields drivers/gpu/drm/arm/hdlcd_crtc.c | 10 ++ drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 9 ++--- drivers/gpu/drm/drm_modes.c| 19 +++ drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 22 ++ drivers/gpu/drm/exynos/exynos7_drm_decon.c | 23 ++- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 22 +- include/drm/drm_modes.h| 2 ++ 7 files changed, 54 insertions(+), 53 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index cf5cbd6..5cec264 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -127,16 +127,10 @@ static void hdlcd_crtc_mode_set_nofb(struct drm_crtc *crtc) { struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); struct drm_display_mode *m = &crtc->state->adjusted_mode; - struct videomode vm; + struct videomode vm = {}; unsigned int polarities, err; - vm.vfront_porch = m->crtc_vsync_start - m->crtc_vdisplay; - vm.vback_porch = m->crtc_vtotal - m->crtc_vsync_end; - vm.vsync_len = m->crtc_vsync_end - m->crtc_vsync_start; - vm.hfront_porch = m->crtc_hsync_start - m->crtc_hdisplay; - vm.hback_porch = m->crtc_htotal - m->crtc_hsync_end; - vm.hsync_len = m->crtc_hsync_end - m->crtc_hsync_start; - + drm_display_mode_crtc_to_videomode(m, &vm); polarities = HDLCD_POLARITY_DATAEN | HDLCD_POLARITY_DATA; if (m->flags & DRM_MODE_FLAG_PHSYNC) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index d732810..fb298b8 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@ -76,17 +76,12 @@ static void atmel_hlcdc_crtc_mode_set_nofb(struct drm_crtc *c) struct drm_display_mode *adj = &c->state->adjusted_mode; struct atmel_hlcdc_crtc_state *state; unsigned long mode_rate; - struct videomode vm; + struct videomode vm = {}; unsigned long prate; unsigned int cfg; int div; - vm.vfront_porch = adj->crtc_vsync_start - adj->crtc_vdisplay; - vm.vback_porch = adj->crtc_vtotal - adj->crtc_vsync_end; - vm.vsync_len = adj->crtc_vsync_end - adj->crtc_vsync_start; - vm.hfront_porch = adj->crtc_hsync_start - adj->crtc_hdisplay; - vm.hback_porch = adj->crtc_htotal - adj->crtc_hsync_end; - vm.hsync_len = adj->crtc_hsync_end - adj->crtc_hsync_start; + drm_display_mode_crtc_to_videomode(adj, &vm); regmap_write(regmap, ATMEL_HLCDC_CFG(1), (vm.hsync_len - 1) | ((vm.vsync_len - 1) << 16)); diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index e82b61e..328f771 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -654,6 +654,25 @@ void drm_display_mode_to_videomode(const struct drm_display_mode *dmode, vm->flags |= DISPLAY_FLAGS_DOUBLECLK; } EXPORT_SYMBOL_GPL(drm_display_mode_to_videomode); +/** + * drm_display_mode_crtc_to_videomode - fill in @vm using crtc fields of @dmode + * @dmode: drm_display_mode structure to use as source + * @vm: videomode structure to use as destination + * + * Fills out @vm using the crtc display mode specified in @dmode. + */ +void drm_display_mode_crtc_to_videomode(const struct drm_display_mode *dmode, + struct videomode *vm) +{ + vm->hfront_porch = dmode->crtc_hsync_start - dmode->crtc_hdisplay; + vm->hsync_len = dmode->crtc_hsync_end - dmode->crtc_hsync_start; + vm->hback_porch = dmode->crtc_htotal - dmode->crtc_hsync_end; + vm->vfront_porch = dmode->crtc_vsync_start - dmode->crtc_vdisplay; + vm->vsync_len = dmode->crtc_vsync_end - d
Re: [PATCH 2/3] drm_hwcomposer: Stop using libsync to provide sw_sync wrappers
On Thu, May 3, 2018 at 9:45 AM, Sean Paul wrote: > On Thu, May 03, 2018 at 09:39:31AM -0500, Rob Herring wrote: >> On Thu, May 3, 2018 at 9:32 AM, Sean Paul wrote: >> > On Thu, May 03, 2018 at 09:14:41AM -0500, Rob Herring wrote: >> >> On Thu, May 3, 2018 at 8:47 AM, Sean Paul wrote: >> >> > On Wed, May 02, 2018 at 04:56:29PM -0700, Alistair Strachan wrote: >> >> >> Use of the sw_sync API is not allowed any more. Until drm_hwcomposer is >> >> >> weaned off of sw_sync, build our own copy. >> >> > >> >> > I don't think it is used any longer. AFAICT, with 2 seconds of grep, >> >> > it's >> >> > referenced in drmcompositorworker.cpp, virtualcompositorworker.cpp, and >> >> > hwcomposer.cpp >> >> > >> >> > I think these are all HWC1 legacy files, so they can probably just get >> >> > cleaned >> >> > up. >> >> >> >> Are you sure? Doesn't the GL compositor have to wait on the fences of >> >> the input buffers and create new fences for the GL compositing output >> >> buffer(s) to pass into the kernel? It looked to me like sw_sync fences >> >> are used in the latter case and that needs to be converted to use >> >> eglCreateSyncKHR. >> > >> > Hmmm, yeah thanks for pointing that out. It does look like >> > drmdisplaycomposition >> > is using sw_sync to handle the GL compositor release fences. >> > >> > I'm pretty confident that despite the known issues causing GLC to not work >> > on >> > open stacks, there are probably a bunch of unknown issues that have been >> > introduced while we try to tiptoe around it. >> > >> > If anyone wants to remove it, I'd certainly be interested in reviewing that >> > patch :-). I'd do it myself, but unfortunately the amount of time I have >> > to dedicate to drm_hwc at this point is just enough to perform [incorrect] >> > reviews. >> >> Removing GL compositor or sw_sync? I've already written a patch to do >> the former. > > Removing GL compositor. Is your patch on the list? No, I never got around to discussing it. I somewhat figured you would not be in favor of that. I'll need to rebase it as it's about 3 months old now. Rob ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/4] drm/tegra: gr2d: Properly clean up resources
On 04.05.2018 16:37, Thierry Reding wrote: > From: Thierry Reding > > Failure to register the Tegra DRM client would leak the resources. Move > cleanup code to error unwinding gotos to fix that and share the cleanup > code with the other error paths. > > Signed-off-by: Thierry Reding > --- > drivers/gpu/drm/tegra/gr2d.c | 28 ++-- > 1 file changed, 22 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/tegra/gr2d.c b/drivers/gpu/drm/tegra/gr2d.c > index 8eb530a85dd0..0b42e99da8ad 100644 > --- a/drivers/gpu/drm/tegra/gr2d.c > +++ b/drivers/gpu/drm/tegra/gr2d.c > @@ -42,8 +42,9 @@ static int gr2d_init(struct host1x_client *client) > > client->syncpts[0] = host1x_syncpt_request(client, flags); > if (!client->syncpts[0]) { > - host1x_channel_put(gr2d->channel); > - return -ENOMEM; > + err = -ENOMEM; > + dev_err(client->dev, "failed to request syncpoint: %d\n", err); > + goto put; > } > > if (tegra->domain) { > @@ -55,15 +56,30 @@ static int gr2d_init(struct host1x_client *client) > dev_err(client->dev, > "failed to attach to domain: %d\n", > err); > - host1x_syncpt_free(client->syncpts[0]); > - host1x_channel_put(gr2d->channel); > iommu_group_put(gr2d->group); > - return err; > + goto free; > } > } > } > > - return tegra_drm_register_client(tegra, drm); > + err = tegra_drm_register_client(tegra, drm); > + if (err < 0) { > + dev_err(client->dev, "failed to register client: %d\n", err); > + goto detach; > + } > + > + return 0; > + > +detach: > + if (gr2d->group) { > + iommu_detach_group(tegra->domain, gr2d->group); > + iommu_group_put(gr2d->group); > + } > +free: > + host1x_syncpt_free(client->syncpts[0]); > +put: > + host1x_channel_put(gr2d->channel); > + return err; > } > > static int gr2d_exit(struct host1x_client *client) > Reviewed-by: Dmitry Osipenko ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 12/26] drm/bridge: sii902x: provide an owner .odev device
The .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/bridge/sii902x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c index 60373d7eb220..894525b05985 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -427,8 +427,8 @@ static int sii902x_probe(struct i2c_client *client, return ret; } + sii902x->bridge.odev = dev; sii902x->bridge.funcs = &sii902x_bridge_funcs; - sii902x->bridge.of_node = dev->of_node; drm_bridge_add(&sii902x->bridge); i2c_set_clientdata(client, sii902x); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 00/26] device link, bridge supplier <-> drm device
Hi! It was noted by Russel King [1] that bridges (not using components) might disappear unexpectedly if the owner of the bridge was unbound. Jyri Sarha had previously noted the same thing with panels [2]. Jyri came up with using device links to resolve the panel issue, which was also my (independent) reaction to the note from Russel. This series builds up to the addition of that link in the last patch, but in my opinion the other 25 patches do have merit on their own. The last patch needs testing, while the others look trivial. Jyri, are you able to test? That said, I might have missed some subtlety. Oh and the reason I'm pushing this is of course so that the issue noted by Russel in [1] is addressed which in turn means that the tda998x bridge driver can be patched according to that series without objection (hopefully) and then used from the atmel-hlcdc driver (and other drivers that are not componentized). Changes since v1https://lkml.org/lkml/2018/4/26/1018 - rename .owner to .odev to not get mixed up with the module owner. - added patches for new recent drivers thc63lvd1024 and cdns-dsi - fix for problem in the rockchip_lvds driver reported by 0day - added a WARN in drm_bridge_add if there is no .odev owner device I did *not*: - add any ack from Daniel since he suggested "pdev", and I ended up with "odev" in the rename since I disliked "pdev" about as much as "owner". - add any port id. The current .of_node (that this series removes) does not identify the port, so that problem seems orthogonal to me. Cheers, Peter [1] https://lkml.org/lkml/2018/4/23/769 [2] https://www.spinics.net/lists/dri-devel/msg174275.html Peter Rosin (26): drm/bridge: allow optionally specifying an owner .odev device drm/bridge: adv7511: provide an owner .odev device drm/bridge/analogix: core: specify the owner .odev of the bridge drm/bridge: analogix-anx78xx: provide an owner .odev device drm/bridge: cdns-dsi: provide an owner .odev device drm/bridge: vga-dac: provide an owner .odev device drm/bridge: lvds-encoder: provide an owner .odev device drm/bridge: megachips-stdp-ge-b850v3-fw: provide an owner .odev device drm/bridge: nxp-ptn3460: provide an owner .odev device drm/bridge: panel: provide an owner .odev device drm/bridge: ps8622: provide an owner .odev device drm/bridge: sii902x: provide an owner .odev device drm/bridge: sii9234: provide an owner .odev device drm/bridge: sii8620: provide an owner .odev device drm/bridge: synopsys: provide an owner .odev device for the bridges drm/bridge: tc358767: provide an owner .odev device drm/bridge: thc63lvd1024: provide an owner .odev device drm/bridge: ti-tfp410: provide an owner .odev device drm/exynos: mic: provide an owner .odev device for the bridge drm/mediatek: hdmi: provide an owner .odev device for the bridge drm/msm: specify the owner .odev of the bridges drm/rcar-du: lvds: provide an owner .odev device for the bridge drm/sti: provide an owner .odev device for the bridges drm/bridge: remove the .of_node member drm/bridge: require the owner .odev to be filled in on drm_bridge_add/attach drm/bridge: establish a link between the bridge supplier and consumer drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 2 +- drivers/gpu/drm/bridge/analogix-anx78xx.c | 5 + drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 1 + drivers/gpu/drm/bridge/cdns-dsi.c | 2 +- drivers/gpu/drm/bridge/dumb-vga-dac.c | 2 +- drivers/gpu/drm/bridge/lvds-encoder.c | 2 +- .../drm/bridge/megachips-stdp-ge-b850v3-fw.c | 2 +- drivers/gpu/drm/bridge/nxp-ptn3460.c | 2 +- drivers/gpu/drm/bridge/panel.c | 4 +--- drivers/gpu/drm/bridge/parade-ps8622.c | 2 +- drivers/gpu/drm/bridge/sii902x.c | 2 +- drivers/gpu/drm/bridge/sii9234.c | 2 +- drivers/gpu/drm/bridge/sil-sii8620.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 +--- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 4 +--- drivers/gpu/drm/bridge/tc358767.c | 2 +- drivers/gpu/drm/bridge/thc63lvd1024.c | 2 +- drivers/gpu/drm/bridge/ti-tfp410.c | 2 +- drivers/gpu/drm/drm_bridge.c | 26 +- drivers/gpu/drm/exynos/exynos_drm_mic.c| 2 +- drivers/gpu/drm/mediatek/mtk_hdmi.c| 2 +- drivers/gpu/drm/msm/dsi/dsi_manager.c | 1 + drivers/gpu/drm/msm/edp/edp_bridge.c | 1 + drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 1 + drivers/gpu/drm/rcar-du/rcar_lvds.c| 2 +- drivers/gpu/drm/rockchip/rockchip_lvds.c | 2 +- drivers/gpu/drm/sti/sti_dvo.c | 2 +- drivers/gpu/drm/sti/sti_hda.c | 1 + drivers/gpu/drm/sti/sti_hdmi.c | 1 + incl
[PATCH v2 05/26] drm/bridge: cdns-dsi: provide an owner .odev device
The .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/bridge/cdns-dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/cdns-dsi.c b/drivers/gpu/drm/bridge/cdns-dsi.c index c255fc3e1be5..e9be5c3f0284 100644 --- a/drivers/gpu/drm/bridge/cdns-dsi.c +++ b/drivers/gpu/drm/bridge/cdns-dsi.c @@ -1548,8 +1548,8 @@ static int cdns_dsi_drm_probe(struct platform_device *pdev) * CDNS_DPI_INPUT. */ input->id = CDNS_DPI_INPUT; + input->bridge.odev = &pdev->dev; input->bridge.funcs = &cdns_dsi_bridge_funcs; - input->bridge.of_node = pdev->dev.of_node; /* Mask all interrupts before registering the IRQ handler. */ writel(0, dsi->regs + MCTL_MAIN_STS_CTL); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH V1 3/5] backlight: qcom-wled: Add support for short circuit handling
Handle the short circuit interrupt and check if the short circuit interrupt is valid. Re-enable the module to check if it goes away. Disable the module altogether if the short circuit event persists. Signed-off-by: Kiran Gunda --- drivers/video/backlight/qcom-wled.c | 134 ++-- 1 file changed, 130 insertions(+), 4 deletions(-) diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c index be8b8d3..2cfba77 100644 --- a/drivers/video/backlight/qcom-wled.c +++ b/drivers/video/backlight/qcom-wled.c @@ -10,6 +10,9 @@ * GNU General Public License for more details. */ +#include +#include +#include #include #include #include @@ -23,7 +26,9 @@ #define WLED3_SINK_REG_BRIGHT_MAX 0xFFF -/* Control registers */ +/* WLED3 Control registers */ +#define WLED3_CTRL_REG_FAULT_STATUS0x08 + #define WLED3_CTRL_REG_MOD_EN 0x46 #define WLED3_CTRL_REG_MOD_EN_MASKBIT(7) @@ -36,7 +41,17 @@ #define WLED3_CTRL_REG_ILIMIT 0x4e #define WLED3_CTRL_REG_ILIMIT_MASKGENMASK(2, 0) -/* sink registers */ +/* WLED4 control registers */ +#define WLED4_CTRL_REG_SHORT_PROTECT 0x5e +#define WLED4_CTRL_REG_SHORT_EN_MASK BIT(7) + +#define WLED4_CTRL_REG_SEC_ACCESS 0xd0 +#define WLED4_CTRL_REG_SEC_UNLOCK 0xa5 + +#define WLED4_CTRL_REG_TEST1 0xe2 +#define WLED4_CTRL_REG_TEST1_EXT_FET_DTEST2 0x09 + +/* WLED3 sink registers */ #define WLED3_SINK_REG_SYNC0x47 #define WLED3_SINK_REG_SYNC_MASK GENMASK(2, 0) #define WLED4_SINK_REG_SYNC_MASK GENMASK(3, 0) @@ -130,17 +145,23 @@ struct wled_config { bool cs_out_en; bool ext_gen; bool cabc; + bool external_pfet; }; struct wled { const char *name; struct device *dev; struct regmap *regmap; + struct mutex lock; /* Lock to avoid race from ISR */ + ktime_t last_short_event; u16 ctrl_addr; u16 sink_addr; u32 brightness; u32 max_brightness; + u32 short_count; const int *version; + int short_irq; + bool force_mod_disable; struct wled_config cfg; int (*wled_set_brightness)(struct wled *wled, u16 brightness); @@ -192,6 +213,9 @@ static int wled_module_enable(struct wled *wled, int val) { int rc; + if (wled->force_mod_disable) + return 0; + rc = regmap_update_bits(wled->regmap, wled->ctrl_addr + WLED3_CTRL_REG_MOD_EN, WLED3_CTRL_REG_MOD_EN_MASK, @@ -248,12 +272,13 @@ static int wled_update_status(struct backlight_device *bl) bl->props.state & BL_CORE_FBBLANK) brightness = 0; + mutex_lock(&wled->lock); if (brightness) { rc = wled->wled_set_brightness(wled, brightness); if (rc < 0) { dev_err(wled->dev, "wled failed to set brightness rc:%d\n", rc); - return rc; + goto unlock_mutex; } rc = wled->wled_sync_toggle(wled); @@ -267,15 +292,60 @@ static int wled_update_status(struct backlight_device *bl) rc = wled_module_enable(wled, !!brightness); if (rc < 0) { dev_err(wled->dev, "wled enable failed rc:%d\n", rc); - return rc; + goto unlock_mutex; } } wled->brightness = brightness; +unlock_mutex: + mutex_unlock(&wled->lock); + return rc; } +#define WLED_SHORT_DLY_MS 20 +#define WLED_SHORT_CNT_MAX 5 +#define WLED_SHORT_RESET_CNT_DLY_USHZ +static irqreturn_t wled_short_irq_handler(int irq, void *_wled) +{ + struct wled *wled = _wled; + int rc; + s64 elapsed_time; + + wled->short_count++; + mutex_lock(&wled->lock); + rc = wled_module_enable(wled, false); + if (rc < 0) { + dev_err(wled->dev, "wled disable failed rc:%d\n", rc); + goto unlock_mutex; + } + + elapsed_time = ktime_us_delta(ktime_get(), + wled->last_short_event); + if (elapsed_time > WLED_SHORT_RESET_CNT_DLY_US) + wled->short_count = 0; + + if (wled->short_count > WLED_SHORT_CNT_MAX) { + dev_err(wled->dev, "Short trigged %d times, disabling WLED forever!\n", + wled->short_count); + wled->force_mod_disable = true; + goto unlock_mutex; + } + + wled->last_short_event = ktime_get(); + + msleep(W
AW: [PATCH v4 6/7] ARM: dts: Add support for emtrion emCON-MX6 series
> -Ursprüngliche Nachricht- > Von: Shawn Guo > Gesendet: Samstag, 28. April 2018 05:13 > An: Türk, Jan > Cc: Rob Herring; Mark Rutland; Thierry Reding; David Airlie; Sascha Hauer; > Pengutronix Kernel Team; Fabio Estevam; Russell King; > devicet...@vger.kernel.org; linux-ker...@vger.kernel.org; dri- > de...@lists.freedesktop.org; LinuxArmKernelMailingListe > Betreff: Re: [PATCH v4 6/7] ARM: dts: Add support for emtrion emCON-MX6 > series > > On Fri, Apr 27, 2018 at 03:24:41PM +0200, jan.tu...@emtrion.com wrote: > > From: Jan Tuerk > > > > This patch adds support for the emtrion GmbH emCON-MX6 modules. > > They are available with imx.6 Solo, Dual-Lite, Dual and Quad equipped > > with Memory from 512MB to 2GB (configured by U-Boot). > > > > Our default developer-Kit ships with the Avari baseboard and the EDT > > ETM0700G0BDH6 Display (imx6[q|dl]-emcon-avari). > > > > The devicetree is split into the common part providing all module > > components and the basic support for all SoC versions > > (imx6qdl-emcon.dtsi) and parts which are i.mx6 S|DL and D|Q relevant. > > Finally the support for the avari baseboard in the developer-kit > > configuration is provided by the emcon-avari dts files. > > > > Signed-off-by: Jan Tuerk > > --- > > Changes for v4: > > - re-arrange the Patch-series to match the DT-submitting-patches > > - Additional patch for the Documentation of the new DT-bindings > > - alphabetically sort the DT > > - moved duplicated Avari baseboard code into separate common file. > > > > arch/arm/boot/dts/Makefile | 2 + > > arch/arm/boot/dts/imx6dl-emcon-avari.dts | 17 + > > arch/arm/boot/dts/imx6dl-emcon.dtsi| 28 + > > arch/arm/boot/dts/imx6q-emcon-avari.dts| 17 + > > arch/arm/boot/dts/imx6q-emcon.dtsi | 28 + > > arch/arm/boot/dts/imx6qdl-emcon-avari.dtsi | 208 > > arch/arm/boot/dts/imx6qdl-emcon.dtsi | 826 > + > > 7 files changed, 1126 insertions(+) > > create mode 100644 arch/arm/boot/dts/imx6dl-emcon-avari.dts > > create mode 100644 arch/arm/boot/dts/imx6dl-emcon.dtsi > > create mode 100644 arch/arm/boot/dts/imx6q-emcon-avari.dts > > create mode 100644 arch/arm/boot/dts/imx6q-emcon.dtsi > > create mode 100644 arch/arm/boot/dts/imx6qdl-emcon-avari.dtsi > > create mode 100644 arch/arm/boot/dts/imx6qdl-emcon.dtsi > > > > diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile > > index 7e2424957809..05b930da3fda 100644 > > --- a/arch/arm/boot/dts/Makefile > > +++ b/arch/arm/boot/dts/Makefile > > @@ -381,6 +381,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \ > > imx6dl-cubox-i-emmc-som-v15.dtb \ > > imx6dl-cubox-i-som-v15.dtb \ > > imx6dl-dfi-fs700-m60.dtb \ > > + imx6dl-emcon-avari.dtb \ > > imx6dl-gw51xx.dtb \ > > imx6dl-gw52xx.dtb \ > > imx6dl-gw53xx.dtb \ > > @@ -442,6 +443,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \ > > imx6q-display5-tianma-tm070-1280x768.dtb \ > > imx6q-dmo-edmqmx6.dtb \ > > imx6q-dms-ba16.dtb \ > > + imx6q-emcon-avari.dtb \ > > imx6q-evi.dtb \ > > imx6q-gk802.dtb \ > > imx6q-gw51xx.dtb \ > > diff --git a/arch/arm/boot/dts/imx6dl-emcon-avari.dts > > b/arch/arm/boot/dts/imx6dl-emcon-avari.dts > > new file mode 100644 > > index ..464c82a53da3 > > --- /dev/null > > +++ b/arch/arm/boot/dts/imx6dl-emcon-avari.dts > > @@ -0,0 +1,17 @@ > > +// SPDX-License-Identifier: (GPL-2.0 or MIT) > > +/* > > + * Copyright (C) 2018 emtrion GmbH > > + * Author: Jan Tuerk*/ > > + > > +/dts-v1/; > > +#include "imx6dl.dtsi" > > +#include "imx6qdl-emcon.dtsi" > > +/*Include camera2 pinmux*/ > > +#include "imx6dl-emcon.dtsi" > > +#include "imx6qdl-emcon-avari.dtsi" > > + > > +/ { > > + model = "emtrion SoM emCON-MX6 Solo/Dual-Lite Avari"; > > + compatible = "emtrion,emcon-mx6-avari", "fsl,imx6dl"; }; > > diff --git a/arch/arm/boot/dts/imx6dl-emcon.dtsi > > b/arch/arm/boot/dts/imx6dl-emcon.dtsi > > new file mode 100644 > > index ..0d86e0ecdb4d > > --- /dev/null > > +++ b/arch/arm/boot/dts/imx6dl-emcon.dtsi > > @@ -0,0 +1,28 @@ > > +// SPDX-License-Identifier: (GPL-2.0 or MIT) > > +/* > > + * Copyright (C) 2018 emtrion GmbH > > + * Author: Jan Tuerk*/ > > + > > +/ { > > + model = "emtrion SoM emCON-MX6 Solo/DualLite"; > > + compatible = "emtrion,emcon-mx6", "fsl,imx6dl"; }; > > + > > +&iomuxc { > > + pinctrl_cpi2: csi1grp { > > + fsl,pins = < > > + MX6QDL_PAD_EIM_D17__IPU1_CSI1_PIXCLK > 0x0b0b1 > > + MX6QDL_PAD_EIM_EB3__IPU1_CSI1_HSYNC > 0x1b0b1 > > + MX6QDL_PAD_EIM_D29__IPU1_CSI1_VSYNC > 0x1b0b1 > > + MX6QDL_PAD_EIM_A17__IPU1_CSI1_DATA12 > 0x1b0b1 > > + MX6QDL_PAD_EIM_D27__IPU1_CSI1_DATA13 > 0x1b0b1 > > + MX6QDL_PAD_EIM_D26__IPU1_CSI1_DATA14 > 0x1b0b1 > > + MX6QDL_PAD_EIM_D20__IPU1_CSI1_DATA15 > 0x1b0b1 > > + MX6QDL_
Re: [PATCH 1/4] drm/tegra: dc: Free syncpoint on errors
On 04.05.2018 16:37, Thierry Reding wrote: > From: Thierry Reding > > If an error happens during display controller initialization, the host1x > syncpoint previously requested would be leaked. Properly clean up the > syncpoint along with the other resources. > > Signed-off-by: Thierry Reding > --- > drivers/gpu/drm/tegra/dc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c > index f20648f58e49..c843f11043db 100644 > --- a/drivers/gpu/drm/tegra/dc.c > +++ b/drivers/gpu/drm/tegra/dc.c > @@ -1925,6 +1925,8 @@ static int tegra_dc_init(struct host1x_client *client) > iommu_group_put(dc->group); > } > > + host1x_syncpt_free(dc->syncpt); > + > return err; > } Reviewed-by: Dmitry Osipenko ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 3/8] drm: Add SPDX identifier and clarify license
This is dual licensed under GPL-2.0 or MIT. Signed-off-by: Dirk Hohndel (VMware) --- drivers/gpu/drm/drm_global.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_global.c b/drivers/gpu/drm/drm_global.c index b2dc21e33ae0..5799e2782dd1 100644 --- a/drivers/gpu/drm/drm_global.c +++ b/drivers/gpu/drm/drm_global.c @@ -1,7 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /** * * Copyright 2008-2009 VMware, Inc., Palo Alto, CA., USA - * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 19/26] drm/exynos: mic: provide an owner .odev device for the bridge
The .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/exynos/exynos_drm_mic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c index 2174814273e2..f9ff8d3ec937 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_mic.c +++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c @@ -417,8 +417,8 @@ static int exynos_mic_probe(struct platform_device *pdev) platform_set_drvdata(pdev, mic); + mic->bridge.odev = dev; mic->bridge.funcs = &mic_bridge_funcs; - mic->bridge.of_node = dev->of_node; drm_bridge_add(&mic->bridge); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 04/26] drm/bridge: analogix-anx78xx: provide an owner .odev device
It gets rid of an #if and the .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/bridge/analogix-anx78xx.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix-anx78xx.c index b49043866be6..1d6620aedbdb 100644 --- a/drivers/gpu/drm/bridge/analogix-anx78xx.c +++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c @@ -1332,10 +1332,6 @@ static int anx78xx_i2c_probe(struct i2c_client *client, mutex_init(&anx78xx->lock); -#if IS_ENABLED(CONFIG_OF) - anx78xx->bridge.of_node = client->dev.of_node; -#endif - anx78xx->client = client; i2c_set_clientdata(client, anx78xx); @@ -1433,6 +1429,7 @@ static int anx78xx_i2c_probe(struct i2c_client *client, goto err_poweroff; } + anx78xx->bridge.odev = &client->dev; anx78xx->bridge.funcs = &anx78xx_bridge_funcs; drm_bridge_add(&anx78xx->bridge); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH V1 1/5] qcom: wled: Rename pm8941-wled.c to qcom-wled.c
pm8941-wled.c driver is supporting the WLED peripheral on pm8941. Rename it to qcom-wled.c so that it can support WLED on multiple PMICs. Signed-off-by: Kiran Gunda --- .../bindings/leds/backlight/{pm8941-wled.txt => qcom-wled.txt}| 2 +- drivers/video/backlight/Kconfig | 8 drivers/video/backlight/Makefile | 2 +- drivers/video/backlight/{pm8941-wled.c => qcom-wled.c}| 0 4 files changed, 6 insertions(+), 6 deletions(-) rename Documentation/devicetree/bindings/leds/backlight/{pm8941-wled.txt => qcom-wled.txt} (95%) rename drivers/video/backlight/{pm8941-wled.c => qcom-wled.c} (100%) diff --git a/Documentation/devicetree/bindings/leds/backlight/pm8941-wled.txt b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt similarity index 95% rename from Documentation/devicetree/bindings/leds/backlight/pm8941-wled.txt rename to Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt index e5b294d..fb39e32 100644 --- a/Documentation/devicetree/bindings/leds/backlight/pm8941-wled.txt +++ b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt @@ -1,4 +1,4 @@ -Binding for Qualcomm PM8941 WLED driver +Binding for Qualcomm Technologies, Inc. WLED driver Required properties: - compatible: should be "qcom,pm8941-wled" diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 4e1d2ad..8c095e3 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -299,12 +299,12 @@ config BACKLIGHT_TOSA If you have an Sharp SL-6000 Zaurus say Y to enable a driver for its backlight -config BACKLIGHT_PM8941_WLED - tristate "Qualcomm PM8941 WLED Driver" +config BACKLIGHT_QCOM_WLED + tristate "Qualcomm PMIC WLED Driver" select REGMAP help - If you have the Qualcomm PM8941, say Y to enable a driver for the - WLED block. + If you have the Qualcomm PMIC, say Y to enable a driver for the + WLED block. Currently it supports PM8941 and PMI8998. config BACKLIGHT_SAHARA tristate "Tabletkiosk Sahara Touch-iT Backlight Driver" diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index 5e28f01..6fd76ef 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -49,8 +49,8 @@ obj-$(CONFIG_BACKLIGHT_OMAP1) += omap1_bl.o obj-$(CONFIG_BACKLIGHT_OT200) += ot200_bl.o obj-$(CONFIG_BACKLIGHT_PANDORA)+= pandora_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o -obj-$(CONFIG_BACKLIGHT_PM8941_WLED)+= pm8941-wled.o obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o +obj-$(CONFIG_BACKLIGHT_QCOM_WLED) += qcom-wled.o obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o diff --git a/drivers/video/backlight/pm8941-wled.c b/drivers/video/backlight/qcom-wled.c similarity index 100% rename from drivers/video/backlight/pm8941-wled.c rename to drivers/video/backlight/qcom-wled.c -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v1] i915: Convert to use match_string() helper
The new helper returns index of the matching string in an array. We are going to use it here. Signed-off-by: Andy Shevchenko --- drivers/gpu/drm/i915/intel_pipe_crc.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_pipe_crc.c b/drivers/gpu/drm/i915/intel_pipe_crc.c index 4f367c16e9e5..39a4e4edda07 100644 --- a/drivers/gpu/drm/i915/intel_pipe_crc.c +++ b/drivers/gpu/drm/i915/intel_pipe_crc.c @@ -766,13 +766,12 @@ display_crc_ctl_parse_object(const char *buf, enum intel_pipe_crc_object *o) { int i; - for (i = 0; i < ARRAY_SIZE(pipe_crc_objects); i++) - if (!strcmp(buf, pipe_crc_objects[i])) { - *o = i; - return 0; - } + i = match_string(pipe_crc_objects, ARRAY_SIZE(pipe_crc_objects), buf); + if (i < 0) + return i; - return -EINVAL; + *o = i; + return 0; } static int display_crc_ctl_parse_pipe(struct drm_i915_private *dev_priv, @@ -798,13 +797,12 @@ display_crc_ctl_parse_source(const char *buf, enum intel_pipe_crc_source *s) return 0; } - for (i = 0; i < ARRAY_SIZE(pipe_crc_sources); i++) - if (!strcmp(buf, pipe_crc_sources[i])) { - *s = i; - return 0; - } + i = match_string(pipe_crc_sources, ARRAY_SIZE(pipe_crc_sources), buf); + if (i < 0) + return i; - return -EINVAL; + *s = i; + return 0; } static int display_crc_ctl_parse(struct drm_i915_private *dev_priv, -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 08/26] drm/bridge: megachips-stdpxxxx-ge-b850v3-fw: provide an owner .odev device
The .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c b/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c index 7ccadba7c98c..29d1b5ae5fb6 100644 --- a/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c +++ b/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c @@ -313,8 +313,8 @@ static int stdp4028_ge_b850v3_fw_probe(struct i2c_client *stdp4028_i2c, i2c_set_clientdata(stdp4028_i2c, ge_b850v3_lvds_ptr); /* drm bridge initialization */ + ge_b850v3_lvds_ptr->bridge.odev = dev; ge_b850v3_lvds_ptr->bridge.funcs = &ge_b850v3_lvds_funcs; - ge_b850v3_lvds_ptr->bridge.of_node = dev->of_node; drm_bridge_add(&ge_b850v3_lvds_ptr->bridge); /* Clear pending interrupts since power up. */ -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH V1 4/5] backlight: qcom-wled: Add support for OVP interrupt handling
WLED peripheral has over voltage protection(OVP) circuitry and the OVP fault is notified through an interrupt. Though this fault condition rising is due to an incorrect hardware configuration is mitigated in the hardware, it still needs to be detected and handled. Add support for it. When WLED module is enabled, keep OVP fault interrupt disabled for 10 ms to account for soft start delay. Signed-off-by: Kiran Gunda --- drivers/video/backlight/qcom-wled.c | 118 +++- 1 file changed, 116 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c index 2cfba77..80ae084 100644 --- a/drivers/video/backlight/qcom-wled.c +++ b/drivers/video/backlight/qcom-wled.c @@ -23,14 +23,20 @@ /* From DT binding */ #define WLED_DEFAULT_BRIGHTNESS2048 - +#define WLED_SOFT_START_DLY_US 1 #define WLED3_SINK_REG_BRIGHT_MAX 0xFFF /* WLED3 Control registers */ #define WLED3_CTRL_REG_FAULT_STATUS0x08 +#define WLED3_CTRL_REG_ILIM_FAULT_BIT BIT(0) +#define WLED3_CTRL_REG_OVP_FAULT_BIT BIT(1) +#define WLED4_CTRL_REG_SC_FAULT_BIT BIT(2) + +#define WLED3_CTRL_REG_INT_RT_STS 0x10 #define WLED3_CTRL_REG_MOD_EN 0x46 #define WLED3_CTRL_REG_MOD_EN_MASKBIT(7) +#define WLED3_CTRL_REG_MOD_EN_BIT BIT(7) #define WLED3_CTRL_REG_FREQ0x4c #define WLED3_CTRL_REG_FREQ_MASK GENMASK(3, 0) @@ -161,9 +167,12 @@ struct wled { u32 short_count; const int *version; int short_irq; + int ovp_irq; bool force_mod_disable; + bool ovp_irq_disabled; struct wled_config cfg; + struct delayed_work ovp_work; int (*wled_set_brightness)(struct wled *wled, u16 brightness); int (*wled_sync_toggle)(struct wled *wled); }; @@ -209,6 +218,32 @@ static int wled4_set_brightness(struct wled *wled, u16 brightness) return 0; } +static void wled_ovp_work(struct work_struct *work) +{ + u32 val; + int rc; + + struct wled *wled = container_of(work, +struct wled, ovp_work.work); + + rc = regmap_read(wled->regmap, wled->ctrl_addr + WLED3_CTRL_REG_MOD_EN, +&val); + if (rc < 0) + return; + + if (val & WLED3_CTRL_REG_MOD_EN_BIT) { + if (wled->ovp_irq > 0 && wled->ovp_irq_disabled) { + enable_irq(wled->ovp_irq); + wled->ovp_irq_disabled = false; + } + } else { + if (wled->ovp_irq > 0 && !wled->ovp_irq_disabled) { + disable_irq(wled->ovp_irq); + wled->ovp_irq_disabled = true; + } + } +} + static int wled_module_enable(struct wled *wled, int val) { int rc; @@ -220,7 +255,12 @@ static int wled_module_enable(struct wled *wled, int val) WLED3_CTRL_REG_MOD_EN, WLED3_CTRL_REG_MOD_EN_MASK, WLED3_CTRL_REG_MOD_EN_MASK); - return rc; + if (rc < 0) + return rc; + + schedule_delayed_work(&wled->ovp_work, WLED_SOFT_START_DLY_US); + + return 0; } static int wled3_sync_toggle(struct wled *wled) @@ -346,6 +386,36 @@ static irqreturn_t wled_short_irq_handler(int irq, void *_wled) return IRQ_HANDLED; } +static irqreturn_t wled_ovp_irq_handler(int irq, void *_wled) +{ + struct wled *wled = _wled; + int rc; + u32 int_sts, fault_sts; + + rc = regmap_read(wled->regmap, +wled->ctrl_addr + WLED3_CTRL_REG_INT_RT_STS, &int_sts); + if (rc < 0) { + dev_err(wled->dev, "Error in reading WLED3_INT_RT_STS rc=%d\n", + rc); + return IRQ_HANDLED; + } + + rc = regmap_read(wled->regmap, wled->ctrl_addr + +WLED3_CTRL_REG_FAULT_STATUS, &fault_sts); + if (rc < 0) { + dev_err(wled->dev, "Error in reading WLED_FAULT_STATUS rc=%d\n", + rc); + return IRQ_HANDLED; + } + + if (fault_sts & + (WLED3_CTRL_REG_OVP_FAULT_BIT | WLED3_CTRL_REG_ILIM_FAULT_BIT)) + dev_dbg(wled->dev, "WLED OVP fault detected, int_sts=%x fault_sts= %x\n", + int_sts, fault_sts); + + return IRQ_HANDLED; +} + static int wled3_setup(struct wled *wled) { u16 addr; @@ -821,6 +891,44 @@ static int wled_configure_short_irq(struct wled *wled, return rc; } +static int wled_configure_ovp_irq(struct wled *wled, + struct platform_device *pdev) +{ + int rc
[PATCH 0/2] gpu: ipu-v3: csi: add RGB565 support
This series adds support to capture in RGB565 format on the parallel bus by using the bayer (generic) mode instead. It also contains a small cleanup patch to pass on error codes from mbus_code_to_bus_cfg in fill_csi_bus_cfg and ipu_csi_init_interface by Enrico Scholz. Enrico Scholz (1): gpu: ipu-v3: csi: pass back mbus_code_to_bus_cfg error codes Jan Luebbe (1): gpu: ipu-v3: csi: support RGB565 on parallel bus drivers/gpu/ipu-v3/ipu-csi.c | 28 ++-- 1 file changed, 22 insertions(+), 6 deletions(-) -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PULL] drm-misc-next
drm-misc-next-2018-05-04: drm-misc-next for v4.18: Ignore the dma-fence changes, they have been immediately reverted. :) Core Changes: - Rounding behavior when clipping a visible plane has changed slightly. We now consistently try to round towards the 1.0x scale to prevent running into hw limits. Driver Changes: - Add a drm driver for broadcom V3D V3.x+. (Eric) - Add syncobj support to vc4. (Stefan) - Assorted bugfixes. The following changes since commit 741c3aeb82c78e173aa7155aaffb971e5c73ab3c: drm/bridge/synopsys: dsi: use adjusted_mode in mode_set (2018-04-26 08:24:26 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2018-05-04 for you to fetch changes up to 7420e04963587dc8f6d4e8b7e79b3ad7ab5c5300: drm/selftests: Add drm helper selftest (2018-05-04 11:36:45 +0200) drm-misc-next for v4.18: Ignore the dma-fence changes, they have been immediately reverted. Core Changes: - Rounding behavior when clipping a visible plane has changed slightly. We now consistently try to round towards the 1.0x scale to prevent running into hw limits. Driver Changes: - Add a drm driver for broadcom V3D V3.x+. (Eric) - Add syncobj support to vc4. (Stefan) - Assorted bugfixes. Colin Ian King (1): gpu: drm: sti: fix spelling mistake: "initialze" -> "initialize" Daniel Vetter (13): dma-fence: Some kerneldoc polish for dma-fence.h drm: Drop DRM_CONTROL_ALLOW from ioctls drm/i915: Drop DRM_CONTROL_ALLOW drm/vmwgfx: Drop DRM_CONTROL_ALLOW dma-fence: remove fill_driver_data callback dma-fence: Make ->enable_signaling optional dma-fence: Allow wait_any_timeout for all fences dma-fence: Make ->wait callback optional drm: Remove unecessary dma_fence_ops drm/qxl: Remove unecessary dma_fence_ops Revert 190c462d5be19ba622a82f5fd0625087c870a1e6..bf3012ada1be770de5c35c1bb16f73b3a01d" drm/msm: Don't setup control node debugfs files drm: remove all control node code Eric Anholt (6): drm: Make the prime vmap/vunmap hooks optional. drm/vc4: Skip ULPS latching when we're in that ULPS state already. drm/panel: Enable DSI transactions on the RPi panel. drm/vc4: Add a pad field to align drm_vc4_submit_cl to 64 bits. dt-bindings: Add a new binding for Broadcom V3D 3.x and newer GPUs. drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+ Gerd Hoffmann (4): qxl: remove qxl_io_log() qxl: move qxl_send_monitors_config() qxl: hook monitors_config updates into crtc, not encoder. qxl: drop dummy functions Jia-Ju Bai (1): gpu: drm: bridge: adv7511: Replace mdelay with usleep_range in adv7511_probe Kristian H. Kristensen (1): drm/rockchip: Disable blending for win0 Linus Walleij (3): drm/pl111: Support the Versatile Express drm/pl111: Enable device-specific assigned memory drm/pl111: Fix module probe bug Maarten Lankhorst (5): drm/rect: Round above 1 << 16 upwards to correct scale calculation functions. drm/rect: Handle rounding errors in drm_rect_clip_scaled, v3. drm/i915: Do not adjust scale when out of bounds, v2. drm/selftests: Rename the Kconfig option to CONFIG_DRM_DEBUG_SELFTEST drm/selftests: Add drm helper selftest Manasi Navare (1): drm/dp: Rename the edp_sdp_header as dp_sdp_header Peter Rosin (1): drm/bridge: adv7511: fix spelling of driver name in Kconfig Philippe CORNU (3): drm/stm: ltdc: fix deferred endpoint management drm/stm: ltdc: add mode_valid() drm/stm: ltdc: fix warnings in ltdc_plane_create() Satendra Singh Thakur (1): drm/atomic: Handling the case when setting old crtc for plane Stefan Schake (3): drm/vc4: Syncobj import support drm/vc4: Export fence through syncobj drm/vc4: Enable syncobj support Tom Callaway (1): drm/tinydrm/mi0283qt: Always set rotation value Vaishali Thakkar (1): drm/vc4: make function vc4_allocate_bin_bo static Ville Syrjälä (2): drm: Don't pass the index to drm_property_add_enum() drm/rect: Fix drm_rect_rotation_inv() docs .../devicetree/bindings/gpu/brcm,bcm-v3d.txt | 28 + Documentation/gpu/drivers.rst | 1 + MAINTAINERS | 8 + drivers/gpu/drm/Kconfig | 11 +- drivers/gpu/drm/Makefile | 3 +- drivers/gpu/drm/bridge/adv7511/Kconfig | 2 +- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 2 +- drivers/gpu/drm/drm_atomic.c | 4 +- drivers/gpu/drm/drm_atomic_helper.c | 2 +- drivers/gpu/drm/drm_connector.c | 6 +- drivers/gpu/drm/drm_drv.c | 10 - drivers/gpu/drm/drm_framebuffer.c | 3 +- drivers/gpu/drm/drm_ioc32.c | 4 +- drivers/gpu/drm/drm_ioctl.c | 76 ++- drivers/gpu/drm/drm_prime.c | 8 +- drivers/gpu/drm/drm_property.c | 27 +- drivers/gpu/drm/drm_rect.c | 74 ++- drivers/gpu/drm/drm_sysfs.c | 4 +- drivers/gpu/drm/gma500/cdv_device.c | 4 +- drivers/gpu/drm/gma500/psb_intel_sdvo.c | 2 +- drivers/gpu/drm/i915/Kconfig.debug | 2 +- drivers/gpu/drm/i915/i915_drv.c | 8 +- drivers/gpu/drm/i915/intel_sdvo.c | 5 +- drivers/gpu/drm/i915/intel_sprite.c | 144 ++--- drivers/gpu/drm/msm/adreno/adreno_device.c |
Re: [PATCH] media: include/video/omapfb_dss.h: use IS_ENABLED()
On 05/04/2018 01:49 PM, Mauro Carvalho Chehab wrote: > Just checking for ifdefs cause build issues as reported by > kernel test: > > config: openrisc-allmodconfig (attached as .config) > compiler: or1k-linux-gcc (GCC) 6.0.0 20160327 (experimental) > > All errors (new ones prefixed by >>): > >drivers/video/fbdev/omap2/omapfb/omapfb-main.c: In function > 'omapfb_init_connections': >>> drivers/video/fbdev/omap2/omapfb/omapfb-main.c:2396:8: error: implicit >>> declaration of function 'omapdss_find_mgr_from_display' >>> [-Werror=implicit-function-declaration] > mgr = omapdss_find_mgr_from_display(def_dssdev); >^ >drivers/video/fbdev/omap2/omapfb/omapfb-main.c:2396:6: warning: assignment > makes pointer from integer without a cast [-Wint-conversion] > mgr = omapdss_find_mgr_from_display(def_dssdev); > ^ >drivers/video/fbdev/omap2/omapfb/omapfb-main.c: In function > 'omapfb_find_default_display': >>> drivers/video/fbdev/omap2/omapfb/omapfb-main.c:2430:13: error: implicit >>> declaration of function 'omapdss_get_default_display_name' >>> [-Werror=implicit-function-declaration] > def_name = omapdss_get_default_display_name(); > ^~~~ >drivers/video/fbdev/omap2/omapfb/omapfb-main.c:2430:11: warning: > assignment makes pointer from integer without a cast [-Wint-conversion] > def_name = omapdss_get_default_display_name(); > ^ > > So, use IS_ENABLED() instead. Hi, I would like to test this (the change doesn't make much sense to me), but I cannot find the kernel config file nor the kernel test robot's email of this report. Please include an lkml.kernel.org/r/ reference to such emails so that interested parties can join the party. Does this patch apply only to your media tree? so hopefully I can see it in linux-next on Monday. Thanks. > Cc: Bartlomiej Zolnierkiewicz > Cc: Randy Dunlap > Cc: tomi.valkei...@ti.com > Cc: linux-o...@vger.kernel.org > Cc: linux-fb...@vger.kernel.org > Fixes: 771f7be87ff9 ("media: omapfb: omapfb_dss.h: add stubs to build with > COMPILE_TEST && DRM_OMAP") > Signed-off-by: Mauro Carvalho Chehab > --- > include/video/omapfb_dss.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/video/omapfb_dss.h b/include/video/omapfb_dss.h > index e9775144ff3b..12755d8d9b4f 100644 > --- a/include/video/omapfb_dss.h > +++ b/include/video/omapfb_dss.h > @@ -778,7 +778,7 @@ struct omap_dss_driver { > > typedef void (*omap_dispc_isr_t) (void *arg, u32 mask); > > -#ifdef CONFIG_FB_OMAP2 > +#if IS_ENABLED(CONFIG_FB_OMAP2) > > enum omapdss_version omapdss_get_version(void); > bool omapdss_is_initialized(void); > -- ~Randy ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v1 3/3] drm/tegra: dc: Rename supports_blending to has_legacy_blending
Older Tegra's support blending. Rename SoC info entry supports_blending to has_legacy_blending to eliminate confusion. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/dc.c | 20 ++-- drivers/gpu/drm/tegra/dc.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index ba5481cd470d..fe00b3250f6a 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -478,10 +478,10 @@ static void tegra_dc_setup_window(struct tegra_plane *plane, tegra_plane_writel(plane, value, DC_WIN_WIN_OPTIONS); - if (dc->soc->supports_blending) - tegra_plane_setup_blending(plane, window); - else + if (dc->soc->has_legacy_blending) tegra_plane_setup_blending_legacy(plane); + else + tegra_plane_setup_blending(plane, window); } static const u32 tegra20_primary_formats[] = { @@ -587,7 +587,7 @@ static int tegra_plane_atomic_check(struct drm_plane *plane, * the corresponding opaque formats. However, the opaque formats can * be emulated by disabling alpha blending for the plane. */ - if (!dc->soc->supports_blending) { + if (dc->soc->has_legacy_blending) { err = tegra_plane_setup_legacy_state(tegra, plane_state); if (err < 0) return err; @@ -2069,7 +2069,7 @@ static const struct tegra_dc_soc_info tegra20_dc_soc_info = { .supports_interlacing = false, .supports_cursor = false, .supports_block_linear = false, - .supports_blending = false, + .has_legacy_blending = true, .pitch_align = 8, .has_powergate = false, .coupled_pm = true, @@ -2088,7 +2088,7 @@ static const struct tegra_dc_soc_info tegra30_dc_soc_info = { .supports_interlacing = false, .supports_cursor = false, .supports_block_linear = false, - .supports_blending = false, + .has_legacy_blending = true, .pitch_align = 8, .has_powergate = false, .coupled_pm = false, @@ -2107,7 +2107,7 @@ static const struct tegra_dc_soc_info tegra114_dc_soc_info = { .supports_interlacing = false, .supports_cursor = false, .supports_block_linear = false, - .supports_blending = false, + .has_legacy_blending = true, .pitch_align = 64, .has_powergate = true, .coupled_pm = false, @@ -2126,7 +2126,7 @@ static const struct tegra_dc_soc_info tegra124_dc_soc_info = { .supports_interlacing = true, .supports_cursor = true, .supports_block_linear = true, - .supports_blending = true, + .has_legacy_blending = false, .pitch_align = 64, .has_powergate = true, .coupled_pm = false, @@ -2145,7 +2145,7 @@ static const struct tegra_dc_soc_info tegra210_dc_soc_info = { .supports_interlacing = true, .supports_cursor = true, .supports_block_linear = true, - .supports_blending = true, + .has_legacy_blending = false, .pitch_align = 64, .has_powergate = true, .coupled_pm = false, @@ -2198,7 +2198,7 @@ static const struct tegra_dc_soc_info tegra186_dc_soc_info = { .supports_interlacing = true, .supports_cursor = true, .supports_block_linear = true, - .supports_blending = true, + .has_legacy_blending = false, .pitch_align = 64, .has_powergate = false, .coupled_pm = false, diff --git a/drivers/gpu/drm/tegra/dc.h b/drivers/gpu/drm/tegra/dc.h index 5c3d1d6faa3b..ca5cac6bf8ea 100644 --- a/drivers/gpu/drm/tegra/dc.h +++ b/drivers/gpu/drm/tegra/dc.h @@ -55,7 +55,7 @@ struct tegra_dc_soc_info { bool supports_interlacing; bool supports_cursor; bool supports_block_linear; - bool supports_blending; + bool has_legacy_blending; unsigned int pitch_align; bool has_powergate; bool coupled_pm; -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 1/2] drm/panel: Add Raydium RM67191 DSI Panel
Add support for the OLED display based on MIPI-DSI protocol from Raydium: RM67191. Signed-off-by: Robert Chiras Signed-off-by: Mirela Rabulea --- drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile| 1 + drivers/gpu/drm/panel/panel-raydium-rm67191.c | 654 ++ 3 files changed, 664 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-raydium-rm67191.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 25682ff..b0d5678 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -108,6 +108,15 @@ config DRM_PANEL_RASPBERRYPI_TOUCHSCREEN Pi 7" Touchscreen. To compile this driver as a module, choose M here. +config DRM_PANEL_RAYDIUM_RM67191 + tristate "Raydium RM67191 FHD 1080x1920 DSI video mode panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for Raydium RM67191 FHD + (1080x1920) DSI panel. + config DRM_PANEL_RAYDIUM_RM68200 tristate "Raydium RM68200 720x1280 DSI video mode panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index f26efc1..4ebe7b5 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -9,6 +9,7 @@ obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) += panel-orisetech-otm8009a.o obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += panel-panasonic-vvx10f034n00.o obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += panel-raspberrypi-touchscreen.o +obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM67191) += panel-raydium-rm67191.o obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM68200) += panel-raydium-rm68200.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o diff --git a/drivers/gpu/drm/panel/panel-raydium-rm67191.c b/drivers/gpu/drm/panel/panel-raydium-rm67191.c new file mode 100644 index 000..ee5748d --- /dev/null +++ b/drivers/gpu/drm/panel/panel-raydium-rm67191.c @@ -0,0 +1,654 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * i.MX drm driver - Raydium MIPI-DSI panel driver + * + * Copyright (C) 2017 NXP + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Write Manufacture Command Set Control */ +#define WRMAUCCTR 0xFE + +/* Manufacturer Command Set pages (CMD2) */ +struct cmd_set_entry { + u8 cmd; + u8 param; +}; + +/* + * There is no description in the Reference Manual about these commands. + * We received them from vendor, so just use them as is. + */ +static const struct cmd_set_entry manufacturer_cmd_set[] = { + {0xFE, 0x0B}, + {0x28, 0x40}, + {0x29, 0x4F}, + {0xFE, 0x0E}, + {0x4B, 0x00}, + {0x4C, 0x0F}, + {0x4D, 0x20}, + {0x4E, 0x40}, + {0x4F, 0x60}, + {0x50, 0xA0}, + {0x51, 0xC0}, + {0x52, 0xE0}, + {0x53, 0xFF}, + {0xFE, 0x0D}, + {0x18, 0x08}, + {0x42, 0x00}, + {0x08, 0x41}, + {0x46, 0x02}, + {0x72, 0x09}, + {0xFE, 0x0A}, + {0x24, 0x17}, + {0x04, 0x07}, + {0x1A, 0x0C}, + {0x0F, 0x44}, + {0xFE, 0x04}, + {0x00, 0x0C}, + {0x05, 0x08}, + {0x06, 0x08}, + {0x08, 0x08}, + {0x09, 0x08}, + {0x0A, 0xE6}, + {0x0B, 0x8C}, + {0x1A, 0x12}, + {0x1E, 0xE0}, + {0x29, 0x93}, + {0x2A, 0x93}, + {0x2F, 0x02}, + {0x31, 0x02}, + {0x33, 0x05}, + {0x37, 0x2D}, + {0x38, 0x2D}, + {0x3A, 0x1E}, + {0x3B, 0x1E}, + {0x3D, 0x27}, + {0x3F, 0x80}, + {0x40, 0x40}, + {0x41, 0xE0}, + {0x4F, 0x2F}, + {0x50, 0x1E}, + {0xFE, 0x06}, + {0x00, 0xCC}, + {0x05, 0x05}, + {0x07, 0xA2}, + {0x08, 0xCC}, + {0x0D, 0x03}, + {0x0F, 0xA2}, + {0x32, 0xCC}, + {0x37, 0x05}, + {0x39, 0x83}, + {0x3A, 0xCC}, + {0x41, 0x04}, + {0x43, 0x83}, + {0x44, 0xCC}, + {0x49, 0x05}, + {0x4B, 0xA2}, + {0x4C, 0xCC}, + {0x51, 0x03}, + {0x53, 0xA2}, + {0x75, 0xCC}, + {0x7A, 0x03}, + {0x7C, 0x83}, + {0x7D, 0xCC}, + {0x82, 0x02}, + {0x84, 0x83}, +
[PATCH v2 25/26] drm/bridge: require the owner .odev to be filled in on drm_bridge_add/attach
The .odev owner device will be handy to have around. Signed-off-by: Peter Rosin --- drivers/gpu/drm/drm_bridge.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index df084db33494..78d186b6831b 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -70,6 +70,9 @@ static LIST_HEAD(bridge_list); */ void drm_bridge_add(struct drm_bridge *bridge) { + if (WARN_ON(!bridge->odev)) + return; + mutex_lock(&bridge_lock); list_add_tail(&bridge->list, &bridge_list); mutex_unlock(&bridge_lock); @@ -115,6 +118,9 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, if (!encoder || !bridge) return -EINVAL; + if (WARN_ON(!bridge->odev)) + return -EINVAL; + if (previous && (!previous->dev || previous->encoder != encoder)) return -EINVAL; -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v5 2/4] dt-bindings: drm/bridge: Document sn65dsi86 bridge bindings
On 2018-05-02 22:31, Stephen Boyd wrote: Quoting Sandeep Panda (2018-05-01 21:32:00) diff --git a/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.txt b/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.txt new file mode 100644 index 000..0d042ce --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.txt @@ -0,0 +1,76 @@ +SN65DSI86 DSI to eDP bridge chip + + +This is the binding for Texas Instruments SN65DSI86 bridge. +http://www.ti.com/general/docs/lit/getliterature.tsp?genericPartNumber=sn65dsi86&fileType=pdf + +Required properties: +- compatible: Must be "ti,sn65dsi86" +- reg: i2c address of the chip, 0x2d as per datasheet +- enable-gpios: OF device-tree gpio specification for bridge_en pin + +- vccio-supply: A 1.8V supply that powers up the digital IOs. +- vpll-supply: A 1.8V supply that powers up the displayport PLL. +- vcca-supply: A 1.2V supply that powers up the analog circuits. +- vcc-supply: A 1.2V supply that powers up the digital core. + +Optional properties: +- interrupts: Specifier for the SN65DSI86 interrupt line. +- hpd-gpios: OF device-tree gpio specifications for HPD pin. + +- refclk-freq-khz: Value specifying the frequency of reference clock in KHz unit. Please use the clocks property instead. We may need to turn the clk on first before this can work so the driver would use the clk framework (at least in linux). clock-names could have 'refclk' because that's the pin name. Is there a way in DRM to figure out the frequency of the clock frequency for DACP/N? It looks like if refclk is grounded, then the DACP/N pins from the DSI side should be one of a set of frequencies, so I'm just curious how that will work and if the binding would need to be updated to indicate what the frequency of the DSI clock lane is, or if DRM can tell this driver through the port/graph stuff somehow. Can we do something like below? 1. Add a required dt-property to indicate what is the source of refclk, ti,sn-refclk-src = <0> ---> means refclk is derived from refclk pin. ti,sn-refclk-src = <1> ---> means refclk is derived from DACP/N pin. 2. Add a clock property to indicate the refclk frequency for refclk pin. 3. In driver, parse the refclk source dt-property. If the source is refclk pin then get the frquency from clock dt-property and program the i2c register accordingly. Else if the source is DACP/N pin then calculate the DSIA frequency based on current display mode (by the time we go for configuring refclk, drm_mode_set is already done and in diver we can calculate the frequency) and program the i2c register accordingly. + +- gpio-controller: Marks the device has a GPIO controller. +- #gpio-cells: Number of GPIO cells. Refer to binding document "gpio/gpio.txt" What's the number? 2? number is 4, i will update this in binding +- #pwm-cells : Number of cells used to specify a PWM. See pwm.txt in this directory + for a description of the cell formats. What's the number? 1? There's a pwm.txt in this directory? yes number is 1, i will update the binding. it should be pwm/pwm.txt ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 20/26] drm/mediatek: hdmi: provide an owner .odev device for the bridge
The .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/mediatek/mtk_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index 59a11026dceb..d8c7d93d0a87 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -1694,8 +1694,8 @@ static int mtk_drm_hdmi_probe(struct platform_device *pdev) mtk_hdmi_register_audio_driver(dev); + hdmi->bridge.odev = &pdev->dev; hdmi->bridge.funcs = &mtk_hdmi_bridge_funcs; - hdmi->bridge.of_node = pdev->dev.of_node; drm_bridge_add(&hdmi->bridge); ret = mtk_hdmi_clk_enable_audio(hdmi); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 11/13] drm/kms/mode/tegra: using helper func drm_display_mode_to_videomode for calculating timing parameters
To avoid duplicate logic for the same Signed-off-by: Satendra Singh Thakur Cc: Madhur Verma Cc: Hemanshu Srivastava --- drivers/gpu/drm/tegra/dc.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 9f83a65..f1d6f65 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -25,6 +25,7 @@ #include #include #include +#include static void tegra_dc_stats_reset(struct tegra_dc_stats *stats) { @@ -1436,6 +1437,7 @@ static int tegra_dc_set_timings(struct tegra_dc *dc, unsigned int h_ref_to_sync = 1; unsigned int v_ref_to_sync = 1; unsigned long value; + struct videomode vm; if (!dc->soc->has_nvdisplay) { tegra_dc_writel(dc, 0x0, DC_DISP_DISP_TIMING_OPTIONS); @@ -1443,20 +1445,17 @@ static int tegra_dc_set_timings(struct tegra_dc *dc, value = (v_ref_to_sync << 16) | h_ref_to_sync; tegra_dc_writel(dc, value, DC_DISP_REF_TO_SYNC); } - - value = ((mode->vsync_end - mode->vsync_start) << 16) | - ((mode->hsync_end - mode->hsync_start) << 0); + drm_display_mode_to_videomode(mode, &vm); + value = (vm.vsync_len << 16) | vm.hsync_len; tegra_dc_writel(dc, value, DC_DISP_SYNC_WIDTH); - value = ((mode->vtotal - mode->vsync_end) << 16) | - ((mode->htotal - mode->hsync_end) << 0); + value = (vm.vback_porch << 16) | vm.hback_porch; tegra_dc_writel(dc, value, DC_DISP_BACK_PORCH); - value = ((mode->vsync_start - mode->vdisplay) << 16) | - ((mode->hsync_start - mode->hdisplay) << 0); + value = (vm.vfront_porch << 16) | vm.hfront_porch; tegra_dc_writel(dc, value, DC_DISP_FRONT_PORCH); - value = (mode->vdisplay << 16) | mode->hdisplay; + value = (vm.vactive << 16) | vm.hactive; tegra_dc_writel(dc, value, DC_DISP_ACTIVE); return 0; -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 2/2] dt-bindings: Add Raydium RM67191 panel bindings
Signed-off-by: Robert Chiras --- .../bindings/display/panel/raydium,rm67191.txt | 38 ++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt diff --git a/Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt b/Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt new file mode 100644 index 000..0fe6d4b --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt @@ -0,0 +1,38 @@ +Raydium RM67171 OLED LCD panel with MIPI-DSI protocol + +Required properties: +- compatible: "raydium,rm67191" +- reg: virtual channel for MIPI-DSI protocol + must be <0> +- dsi-lanes: number of DSI lanes to be used + must be <3> or <4> +- port:input port node with endpoint definition as + defined in Documentation/devicetree/bindings/graph.txt; + the input port should be connected to a MIPI-DSI device + driver + +Optional properties: +- reset-gpio: a GPIO spec for the RST_B GPIO pin +- pinctrl-0phandle to the pin settings for the reset pin +- panel-width-mm: physical panel width [mm] +- panel-height-mm: physical panel height [mm] + +[1]: Documentation/devicetree/bindings/display/display-timing.txt + +Example: + + panel@0 { + compatible = "raydium,rm67191"; + reg = <0>; + pinctrl-0 = <&pinctrl_mipi_dsi_0_1_en>; + reset-gpio = <&gpio1 7 GPIO_ACTIVE_HIGH>; + dsi-lanes = <4>; + panel-width-mm = <68>; + panel-height-mm = <121>; + + port { + panel1_in: endpoint { + remote-endpoint = <&mipi1_out>; + }; + }; + }; -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 09/13] drm/kms/mode/sun4i-tv: using helper func drm_display_mode_from_videomode for calculating timing parameters
To avoid duplicate logic for horizonal/vertical sync_start/end helper func drm_display_mode_from_videomode is used Signed-off-by: Satendra Singh Thakur Cc: Madhur Verma Cc: Hemanshu Srivastava --- drivers/gpu/drm/sun4i/sun4i_tv.c | 67 +++- 1 file changed, 25 insertions(+), 42 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tv.c b/drivers/gpu/drm/sun4i/sun4i_tv.c index b070d52..7ffa930 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tv.c +++ b/drivers/gpu/drm/sun4i/sun4i_tv.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "sun4i_crtc.h" #include "sun4i_drv.h" @@ -147,16 +148,7 @@ struct tv_mode { u16 front_porch; u16 line_number; u16 vblank_level; - - u32 hdisplay; - u16 hfront_porch; - u16 hsync_len; - u16 hback_porch; - - u32 vdisplay; - u16 vfront_porch; - u16 vsync_len; - u16 vback_porch; + struct videomode vm; boolyc_en; booldac3_en; @@ -223,16 +215,16 @@ static const struct tv_mode tv_modes[] = { .back_porch = 118, .front_porch= 32, .line_number= 525, - - .hdisplay = 720, - .hfront_porch = 18, - .hsync_len = 2, - .hback_porch= 118, - - .vdisplay = 480, - .vfront_porch = 26, - .vsync_len = 2, - .vback_porch= 17, + .vm = { + .hactive= 720, + .hfront_porch = 18, + .hsync_len = 2, + .hback_porch= 118, + .vactive= 480, + .vfront_porch = 26, + .vsync_len = 2, + .vback_porch= 17, + }, .vblank_level = 240, @@ -249,16 +241,16 @@ static const struct tv_mode tv_modes[] = { .back_porch = 138, .front_porch= 24, .line_number= 625, - - .hdisplay = 720, - .hfront_porch = 3, - .hsync_len = 2, - .hback_porch= 139, - - .vdisplay = 576, - .vfront_porch = 28, - .vsync_len = 2, - .vback_porch= 19, + .vm = { + .hactive= 720, + .hfront_porch = 3, + .hsync_len = 2, + .hback_porch= 139, + .vactive= 576, + .vfront_porch = 28, + .vsync_len = 2, + .vback_porch= 19, + }, .vblank_level = 252, @@ -311,9 +303,9 @@ static const struct tv_mode *sun4i_tv_find_tv_by_mode(const struct drm_display_m DRM_DEBUG_DRIVER("Comparing mode %s vs %s (X: %d vs %d)", mode->name, tv_mode->name, -mode->vdisplay, tv_mode->vdisplay); +mode->vdisplay, tv_mode->vm.vactive); - if (mode->vdisplay == tv_mode->vdisplay) + if (mode->vdisplay == tv_mode->vm.vactive) return tv_mode; } @@ -325,19 +317,10 @@ static void sun4i_tv_mode_to_drm_mode(const struct tv_mode *tv_mode, { DRM_DEBUG_DRIVER("Creating mode %s\n", mode->name); + drm_display_mode_from_videomode(&tv_mode->vm, mode); mode->type = DRM_MODE_TYPE_DRIVER; mode->clock = 13500; mode->flags = DRM_MODE_FLAG_INTERLACE; - - mode->hdisplay = tv_mode->hdisplay; - mode->hsync_start = mode->hdisplay + tv_mode->hfront_porch; - mode->hsync_end = mode->hsync_start + tv_mode->hsync_len; - mode->htotal = mode->hsync_end + tv_mode->hback_porch; - - mode->vdisplay = tv_mode->vdisplay; - mode->vsync_start = mode->vdisplay + tv_mode->vfront_porch; - mode->vsync_end = mode->vsync_start + tv_mode->vsync_len; - mode->vtotal = mode->vsync_end + tv_mode->vback_porch; } static void sun4i_tv_disable(struct drm_encoder *encoder) -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 07/26] drm/bridge: lvds-encoder: provide an owner .odev device
The .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/bridge/lvds-encoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/lvds-encoder.c b/drivers/gpu/drm/bridge/lvds-encoder.c index 75b0d3f6e4de..a80eec17b13b 100644 --- a/drivers/gpu/drm/bridge/lvds-encoder.c +++ b/drivers/gpu/drm/bridge/lvds-encoder.c @@ -83,7 +83,7 @@ static int lvds_encoder_probe(struct platform_device *pdev) * but we need a bridge attached to our of_node for our user * to look up. */ - lvds_encoder->bridge.of_node = pdev->dev.of_node; + lvds_encoder->bridge.odev = &pdev->dev; lvds_encoder->bridge.funcs = &funcs; drm_bridge_add(&lvds_encoder->bridge); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/3] drm/sti: do not remove the drm_bridge that was never added
On 2018-05-03 11:06, Daniel Vetter wrote: > On Wed, May 02, 2018 at 09:40:23AM +0200, Peter Rosin wrote: >> The more natural approach would perhaps be to add an drm_bridge_add, >> but there are several other bridges that never call drm_bridge_add. >> Just removing the drm_bridge_remove is the easier fix. >> >> Signed-off-by: Peter Rosin > > This mess is much bigger. There's 2 pairs of bridge functions: > > - drm_bridge_attach/detach. Those are meant to be called by the overall > drm driver to connect/disconnect a drm_bridge. > > - drm_bridge_add/remove. These are supposed to be called by the bridge > driver itself to register/unregister itself. Maybe we should rename > them, since the same issue happens with drm_panel, with the same > confusion. > > I thought someone was working on a cleanup series to fix this mess, but I > didn't find anything. Ok, I just spotted the imbalance and didn't really dig into what actually happens in these error paths. Now that I have done so I believe that the removed drm_bridge_remove calls causes NULL dereferences if/when the error paths are triggered. So, I don't think this can wait for some bigger cleanup. drm_bridge_remove calls list_del_init calls __list_del_entry calls __list_del with NULL in both prev and next since the list member is never initialized. prev and next are dereferenced by __list_del and you have *boom* I recommend adding the tag Fixes: 84601dbdea36 ("drm: sti: rework init sequence") so that stable picks this one up. Cheers, Peter > -Daniel > >> --- >> drivers/gpu/drm/sti/sti_hda.c | 1 - >> drivers/gpu/drm/sti/sti_hdmi.c | 1 - >> 2 files changed, 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c >> index 67bbdb49fffc..199db13f565c 100644 >> --- a/drivers/gpu/drm/sti/sti_hda.c >> +++ b/drivers/gpu/drm/sti/sti_hda.c >> @@ -721,7 +721,6 @@ static int sti_hda_bind(struct device *dev, struct >> device *master, void *data) >> return 0; >> >> err_sysfs: >> -drm_bridge_remove(bridge); >> return -EINVAL; >> } >> >> diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c >> index 58f431102512..932724784942 100644 >> --- a/drivers/gpu/drm/sti/sti_hdmi.c >> +++ b/drivers/gpu/drm/sti/sti_hdmi.c >> @@ -1315,7 +1315,6 @@ static int sti_hdmi_bind(struct device *dev, struct >> device *master, void *data) >> return 0; >> >> err_sysfs: >> -drm_bridge_remove(bridge); >> hdmi->drm_connector = NULL; >> return -EINVAL; >> } >> -- >> 2.11.0 >> >> ___ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 13/26] drm/bridge: sii9234: provide an owner .odev device
The .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/bridge/sii9234.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/sii9234.c b/drivers/gpu/drm/bridge/sii9234.c index c77000626c22..54326357b2ee 100644 --- a/drivers/gpu/drm/bridge/sii9234.c +++ b/drivers/gpu/drm/bridge/sii9234.c @@ -948,8 +948,8 @@ static int sii9234_probe(struct i2c_client *client, i2c_set_clientdata(client, ctx); + ctx->bridge.odev = dev; ctx->bridge.funcs = &sii9234_bridge_funcs; - ctx->bridge.of_node = dev->of_node; drm_bridge_add(&ctx->bridge); sii9234_cable_in(ctx); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 02/26] drm/bridge: adv7511: provide an owner .odev device
The .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index 2614cea538e2..fd2eef916b0b 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -1204,8 +1204,8 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id) if (ret) goto err_unregister_cec; + adv7511->bridge.odev = dev; adv7511->bridge.funcs = &adv7511_bridge_funcs; - adv7511->bridge.of_node = dev->of_node; drm_bridge_add(&adv7511->bridge); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 22/26] drm/rcar-du: lvds: provide an owner .odev device for the bridge
The .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/rcar-du/rcar_lvds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c index 3d2d3bbd1342..efda02f55c95 100644 --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c @@ -463,9 +463,9 @@ static int rcar_lvds_probe(struct platform_device *pdev) if (ret < 0) return ret; + lvds->bridge.odev = &pdev->dev; lvds->bridge.driver_private = lvds; lvds->bridge.funcs = &rcar_lvds_bridge_ops; - lvds->bridge.of_node = pdev->dev.of_node; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); lvds->mmio = devm_ioremap_resource(&pdev->dev, mem); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 4/4] drm/rockchip: support dp training outside dp firmware
DP firware use fix phy config value to do training, but some board need to adjust these value to fit for their hardware design, so we use new phy config to do training outside firmware to meet this situation, if there have new phy config pass from dts, it will use training outside firmware. Signed-off-by: Chris Zhong Signed-off-by: Lin Huang --- drivers/gpu/drm/rockchip/Makefile | 3 +- drivers/gpu/drm/rockchip/cdn-dp-core.c | 23 +- drivers/gpu/drm/rockchip/cdn-dp-core.h | 2 + drivers/gpu/drm/rockchip/cdn-dp-link-training.c | 398 drivers/gpu/drm/rockchip/cdn-dp-reg.c | 33 +- drivers/gpu/drm/rockchip/cdn-dp-reg.h | 38 ++- 6 files changed, 480 insertions(+), 17 deletions(-) create mode 100644 drivers/gpu/drm/rockchip/cdn-dp-link-training.c diff --git a/drivers/gpu/drm/rockchip/Makefile b/drivers/gpu/drm/rockchip/Makefile index a314e21..b932f62 100644 --- a/drivers/gpu/drm/rockchip/Makefile +++ b/drivers/gpu/drm/rockchip/Makefile @@ -9,7 +9,8 @@ rockchipdrm-y := rockchip_drm_drv.o rockchip_drm_fb.o \ rockchipdrm-$(CONFIG_DRM_FBDEV_EMULATION) += rockchip_drm_fbdev.o rockchipdrm-$(CONFIG_ROCKCHIP_ANALOGIX_DP) += analogix_dp-rockchip.o -rockchipdrm-$(CONFIG_ROCKCHIP_CDN_DP) += cdn-dp-core.o cdn-dp-reg.o +rockchipdrm-$(CONFIG_ROCKCHIP_CDN_DP) += cdn-dp-core.o cdn-dp-reg.o \ + cdn-dp-link-training.o rockchipdrm-$(CONFIG_ROCKCHIP_DW_HDMI) += dw_hdmi-rockchip.o rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) += dw-mipi-dsi.o rockchipdrm-$(CONFIG_ROCKCHIP_INNO_HDMI) += inno_hdmi.o diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c index 268c190..a2a4208 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -629,11 +629,13 @@ static void cdn_dp_encoder_enable(struct drm_encoder *encoder) goto out; } } - - ret = cdn_dp_set_video_status(dp, CONTROL_VIDEO_IDLE); - if (ret) { - DRM_DEV_ERROR(dp->dev, "Failed to idle video %d\n", ret); - goto out; + if (dp->sw_training_success == false) { + ret = cdn_dp_set_video_status(dp, CONTROL_VIDEO_IDLE); + if (ret) { + DRM_DEV_ERROR(dp->dev, + "Failed to idle video %d\n", ret); + goto out; + } } ret = cdn_dp_config_video(dp); @@ -642,11 +644,14 @@ static void cdn_dp_encoder_enable(struct drm_encoder *encoder) goto out; } - ret = cdn_dp_set_video_status(dp, CONTROL_VIDEO_VALID); - if (ret) { - DRM_DEV_ERROR(dp->dev, "Failed to valid video %d\n", ret); - goto out; + if (dp->sw_training_success == false) { + ret = cdn_dp_set_video_status(dp, CONTROL_VIDEO_VALID); + if (ret) { + DRM_DEV_ERROR(dp->dev, "Failed to valid video %d\n", ret); + goto out; + } } + out: mutex_unlock(&dp->lock); } diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.h b/drivers/gpu/drm/rockchip/cdn-dp-core.h index 46159b2..c6050ab 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.h +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.h @@ -84,6 +84,7 @@ struct cdn_dp_device { bool connected; bool active; bool suspended; + bool sw_training_success; const struct firmware *fw; /* cdn dp firmware */ unsigned int fw_version;/* cdn fw version */ @@ -106,6 +107,7 @@ struct cdn_dp_device { u8 ports; u8 lanes; int active_port; + u8 train_set[4]; u8 dpcd[DP_RECEIVER_CAP_SIZE]; bool sink_has_audio; diff --git a/drivers/gpu/drm/rockchip/cdn-dp-link-training.c b/drivers/gpu/drm/rockchip/cdn-dp-link-training.c new file mode 100644 index 000..558c945 --- /dev/null +++ b/drivers/gpu/drm/rockchip/cdn-dp-link-training.c @@ -0,0 +1,398 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd + * Author: Chris Zhong + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cdn-dp-core.h" +#include "cdn-dp-reg.h" + +static void cdn_dp_set_signal_levels(struct cdn_dp_device *dp) +{ + struct cdn_dp_port *port = dp->port[dp->active_port]; + struct rockchip_typec_phy *tcphy = phy_get_drvdata(port->phy); + + int rate = drm_dp_bw_code_to_link_rate(dp->link.rate); + u8 swing = (dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) >> + DP_TRAIN_VOLTAGE_SWING_SHIFT; + u8 pre_emphasis = (dp->train_set[0] & DP_TRAIN_PRE_EMPHASIS_MASK) + >> DP_TRAIN_PRE_EMPHASIS_SHIFT; + + tcphy->typec_phy_config(port->phy, rate, dp->link.num_lanes, +
[PATCH V2 3/5] backlight: qcom-wled: Add support for short circuit handling
Handle the short circuit interrupt and check if the short circuit interrupt is valid. Re-enable the module to check if it goes away. Disable the module altogether if the short circuit event persists. Signed-off-by: Kiran Gunda --- drivers/video/backlight/qcom-wled.c | 134 ++-- 1 file changed, 130 insertions(+), 4 deletions(-) diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c index be8b8d3..2cfba77 100644 --- a/drivers/video/backlight/qcom-wled.c +++ b/drivers/video/backlight/qcom-wled.c @@ -10,6 +10,9 @@ * GNU General Public License for more details. */ +#include +#include +#include #include #include #include @@ -23,7 +26,9 @@ #define WLED3_SINK_REG_BRIGHT_MAX 0xFFF -/* Control registers */ +/* WLED3 Control registers */ +#define WLED3_CTRL_REG_FAULT_STATUS0x08 + #define WLED3_CTRL_REG_MOD_EN 0x46 #define WLED3_CTRL_REG_MOD_EN_MASKBIT(7) @@ -36,7 +41,17 @@ #define WLED3_CTRL_REG_ILIMIT 0x4e #define WLED3_CTRL_REG_ILIMIT_MASKGENMASK(2, 0) -/* sink registers */ +/* WLED4 control registers */ +#define WLED4_CTRL_REG_SHORT_PROTECT 0x5e +#define WLED4_CTRL_REG_SHORT_EN_MASK BIT(7) + +#define WLED4_CTRL_REG_SEC_ACCESS 0xd0 +#define WLED4_CTRL_REG_SEC_UNLOCK 0xa5 + +#define WLED4_CTRL_REG_TEST1 0xe2 +#define WLED4_CTRL_REG_TEST1_EXT_FET_DTEST2 0x09 + +/* WLED3 sink registers */ #define WLED3_SINK_REG_SYNC0x47 #define WLED3_SINK_REG_SYNC_MASK GENMASK(2, 0) #define WLED4_SINK_REG_SYNC_MASK GENMASK(3, 0) @@ -130,17 +145,23 @@ struct wled_config { bool cs_out_en; bool ext_gen; bool cabc; + bool external_pfet; }; struct wled { const char *name; struct device *dev; struct regmap *regmap; + struct mutex lock; /* Lock to avoid race from ISR */ + ktime_t last_short_event; u16 ctrl_addr; u16 sink_addr; u32 brightness; u32 max_brightness; + u32 short_count; const int *version; + int short_irq; + bool force_mod_disable; struct wled_config cfg; int (*wled_set_brightness)(struct wled *wled, u16 brightness); @@ -192,6 +213,9 @@ static int wled_module_enable(struct wled *wled, int val) { int rc; + if (wled->force_mod_disable) + return 0; + rc = regmap_update_bits(wled->regmap, wled->ctrl_addr + WLED3_CTRL_REG_MOD_EN, WLED3_CTRL_REG_MOD_EN_MASK, @@ -248,12 +272,13 @@ static int wled_update_status(struct backlight_device *bl) bl->props.state & BL_CORE_FBBLANK) brightness = 0; + mutex_lock(&wled->lock); if (brightness) { rc = wled->wled_set_brightness(wled, brightness); if (rc < 0) { dev_err(wled->dev, "wled failed to set brightness rc:%d\n", rc); - return rc; + goto unlock_mutex; } rc = wled->wled_sync_toggle(wled); @@ -267,15 +292,60 @@ static int wled_update_status(struct backlight_device *bl) rc = wled_module_enable(wled, !!brightness); if (rc < 0) { dev_err(wled->dev, "wled enable failed rc:%d\n", rc); - return rc; + goto unlock_mutex; } } wled->brightness = brightness; +unlock_mutex: + mutex_unlock(&wled->lock); + return rc; } +#define WLED_SHORT_DLY_MS 20 +#define WLED_SHORT_CNT_MAX 5 +#define WLED_SHORT_RESET_CNT_DLY_USHZ +static irqreturn_t wled_short_irq_handler(int irq, void *_wled) +{ + struct wled *wled = _wled; + int rc; + s64 elapsed_time; + + wled->short_count++; + mutex_lock(&wled->lock); + rc = wled_module_enable(wled, false); + if (rc < 0) { + dev_err(wled->dev, "wled disable failed rc:%d\n", rc); + goto unlock_mutex; + } + + elapsed_time = ktime_us_delta(ktime_get(), + wled->last_short_event); + if (elapsed_time > WLED_SHORT_RESET_CNT_DLY_US) + wled->short_count = 0; + + if (wled->short_count > WLED_SHORT_CNT_MAX) { + dev_err(wled->dev, "Short trigged %d times, disabling WLED forever!\n", + wled->short_count); + wled->force_mod_disable = true; + goto unlock_mutex; + } + + wled->last_short_event = ktime_get(); + + msleep(W
[PATCH 7/8] drm/vmwgfx: add SPDX idenitifier and clarify license
This is licensed under GPL-2.0. Signed-off-by: Dirk Hohndel (VMware) --- drivers/gpu/drm/vmwgfx/Kconfig| 1 + .../vmwgfx/device_include/vmware_pack_begin.h | 25 +-- .../vmwgfx/device_include/vmware_pack_end.h | 25 +-- drivers/gpu/drm/vmwgfx/vmwgfx_msg.h | 14 ++- 4 files changed, 5 insertions(+), 60 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/Kconfig b/drivers/gpu/drm/vmwgfx/Kconfig index 8c308dac99c5..6b28a326f8bb 100644 --- a/drivers/gpu/drm/vmwgfx/Kconfig +++ b/drivers/gpu/drm/vmwgfx/Kconfig @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 config DRM_VMWGFX tristate "DRM driver for VMware Virtual GPU" depends on DRM && PCI && X86 && MMU diff --git a/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_begin.h b/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_begin.h index 7e7b0ce34aa2..75308bd0d970 100644 --- a/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_begin.h +++ b/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_begin.h @@ -1,25 +1,2 @@ -/** - * Copyright 2015 VMware, Inc. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - **/ +/* SPDX-License-Identifier: GPL-2.0 */ #include diff --git a/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_end.h b/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_end.h index e2e440ed3d44..e93d6f28b68c 100644 --- a/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_end.h +++ b/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_end.h @@ -1,25 +1,2 @@ -/** - * Copyright 2015 VMware, Inc. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - **/ +/* SPDX-License-Identifier: GPL-2.0 */ __packed diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.h b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.h index 557a033fb610..f1589964be65 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.h @@ -1,16 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright (C) 2016, VMware, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or - * NON INFRINGEMENT. See the GNU General Public License for more - * details. + * Copyright 2016, VMware, Inc. * * Based on code from vmware.c and vmmouse.c. * Author: --
[PATCH V2 4/5] backlight: qcom-wled: Add support for OVP interrupt handling
WLED peripheral has over voltage protection(OVP) circuitry and the OVP fault is notified through an interrupt. Though this fault condition rising is due to an incorrect hardware configuration is mitigated in the hardware, it still needs to be detected and handled. Add support for it. When WLED module is enabled, keep OVP fault interrupt disabled for 10 ms to account for soft start delay. Signed-off-by: Kiran Gunda --- drivers/video/backlight/qcom-wled.c | 118 +++- 1 file changed, 116 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c index 2cfba77..80ae084 100644 --- a/drivers/video/backlight/qcom-wled.c +++ b/drivers/video/backlight/qcom-wled.c @@ -23,14 +23,20 @@ /* From DT binding */ #define WLED_DEFAULT_BRIGHTNESS2048 - +#define WLED_SOFT_START_DLY_US 1 #define WLED3_SINK_REG_BRIGHT_MAX 0xFFF /* WLED3 Control registers */ #define WLED3_CTRL_REG_FAULT_STATUS0x08 +#define WLED3_CTRL_REG_ILIM_FAULT_BIT BIT(0) +#define WLED3_CTRL_REG_OVP_FAULT_BIT BIT(1) +#define WLED4_CTRL_REG_SC_FAULT_BIT BIT(2) + +#define WLED3_CTRL_REG_INT_RT_STS 0x10 #define WLED3_CTRL_REG_MOD_EN 0x46 #define WLED3_CTRL_REG_MOD_EN_MASKBIT(7) +#define WLED3_CTRL_REG_MOD_EN_BIT BIT(7) #define WLED3_CTRL_REG_FREQ0x4c #define WLED3_CTRL_REG_FREQ_MASK GENMASK(3, 0) @@ -161,9 +167,12 @@ struct wled { u32 short_count; const int *version; int short_irq; + int ovp_irq; bool force_mod_disable; + bool ovp_irq_disabled; struct wled_config cfg; + struct delayed_work ovp_work; int (*wled_set_brightness)(struct wled *wled, u16 brightness); int (*wled_sync_toggle)(struct wled *wled); }; @@ -209,6 +218,32 @@ static int wled4_set_brightness(struct wled *wled, u16 brightness) return 0; } +static void wled_ovp_work(struct work_struct *work) +{ + u32 val; + int rc; + + struct wled *wled = container_of(work, +struct wled, ovp_work.work); + + rc = regmap_read(wled->regmap, wled->ctrl_addr + WLED3_CTRL_REG_MOD_EN, +&val); + if (rc < 0) + return; + + if (val & WLED3_CTRL_REG_MOD_EN_BIT) { + if (wled->ovp_irq > 0 && wled->ovp_irq_disabled) { + enable_irq(wled->ovp_irq); + wled->ovp_irq_disabled = false; + } + } else { + if (wled->ovp_irq > 0 && !wled->ovp_irq_disabled) { + disable_irq(wled->ovp_irq); + wled->ovp_irq_disabled = true; + } + } +} + static int wled_module_enable(struct wled *wled, int val) { int rc; @@ -220,7 +255,12 @@ static int wled_module_enable(struct wled *wled, int val) WLED3_CTRL_REG_MOD_EN, WLED3_CTRL_REG_MOD_EN_MASK, WLED3_CTRL_REG_MOD_EN_MASK); - return rc; + if (rc < 0) + return rc; + + schedule_delayed_work(&wled->ovp_work, WLED_SOFT_START_DLY_US); + + return 0; } static int wled3_sync_toggle(struct wled *wled) @@ -346,6 +386,36 @@ static irqreturn_t wled_short_irq_handler(int irq, void *_wled) return IRQ_HANDLED; } +static irqreturn_t wled_ovp_irq_handler(int irq, void *_wled) +{ + struct wled *wled = _wled; + int rc; + u32 int_sts, fault_sts; + + rc = regmap_read(wled->regmap, +wled->ctrl_addr + WLED3_CTRL_REG_INT_RT_STS, &int_sts); + if (rc < 0) { + dev_err(wled->dev, "Error in reading WLED3_INT_RT_STS rc=%d\n", + rc); + return IRQ_HANDLED; + } + + rc = regmap_read(wled->regmap, wled->ctrl_addr + +WLED3_CTRL_REG_FAULT_STATUS, &fault_sts); + if (rc < 0) { + dev_err(wled->dev, "Error in reading WLED_FAULT_STATUS rc=%d\n", + rc); + return IRQ_HANDLED; + } + + if (fault_sts & + (WLED3_CTRL_REG_OVP_FAULT_BIT | WLED3_CTRL_REG_ILIM_FAULT_BIT)) + dev_dbg(wled->dev, "WLED OVP fault detected, int_sts=%x fault_sts= %x\n", + int_sts, fault_sts); + + return IRQ_HANDLED; +} + static int wled3_setup(struct wled *wled) { u16 addr; @@ -821,6 +891,44 @@ static int wled_configure_short_irq(struct wled *wled, return rc; } +static int wled_configure_ovp_irq(struct wled *wled, + struct platform_device *pdev) +{ + int rc
[PATCH 6/8] drm/ttm: add SPDX idenitifier and clarify license
This is dual licensed under GPL-2.0 or MIT. Signed-off-by: Dirk Hohndel (VMware) --- drivers/gpu/drm/ttm/ttm_agp_backend.c | 1 + drivers/gpu/drm/ttm/ttm_bo.c | 1 + drivers/gpu/drm/ttm/ttm_bo_manager.c | 1 + drivers/gpu/drm/ttm/ttm_bo_util.c | 1 + drivers/gpu/drm/ttm/ttm_bo_vm.c| 1 + drivers/gpu/drm/ttm/ttm_execbuf_util.c | 1 + drivers/gpu/drm/ttm/ttm_lock.c | 1 + drivers/gpu/drm/ttm/ttm_memory.c | 1 + drivers/gpu/drm/ttm/ttm_module.c | 1 + drivers/gpu/drm/ttm/ttm_object.c | 1 + drivers/gpu/drm/ttm/ttm_tt.c | 1 + 11 files changed, 11 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c index 7c2485fe88d8..e2e965ad8e2f 100644 --- a/drivers/gpu/drm/ttm/ttm_agp_backend.c +++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /** * * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 98e06f8bf23b..7db7dc50e19e 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /** * * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c index a7c232dc39cb..2b545411bab5 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_manager.c +++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /** * * Copyright (c) 2007-2010 VMware, Inc., Palo Alto, CA., USA diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 2ebbae6067ab..db7c4e3bfec2 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /** * * Copyright (c) 2007-2009 VMware, Inc., Palo Alto, CA., USA diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c index 8eba95b3c737..90e4a043d5be 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /** * * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA diff --git a/drivers/gpu/drm/ttm/ttm_execbuf_util.c b/drivers/gpu/drm/ttm/ttm_execbuf_util.c index 3dca206e85f7..f7c5bd4912e6 100644 --- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c +++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /** * * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA diff --git a/drivers/gpu/drm/ttm/ttm_lock.c b/drivers/gpu/drm/ttm/ttm_lock.c index 913f4318cdc0..21a355055c2f 100644 --- a/drivers/gpu/drm/ttm/ttm_lock.c +++ b/drivers/gpu/drm/ttm/ttm_lock.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /** * * Copyright (c) 2007-2009 VMware, Inc., Palo Alto, CA., USA diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c index 27856c55dc84..7ff4cfe56c24 100644 --- a/drivers/gpu/drm/ttm/ttm_memory.c +++ b/drivers/gpu/drm/ttm/ttm_memory.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /** * * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA diff --git a/drivers/gpu/drm/ttm/ttm_module.c b/drivers/gpu/drm/ttm/ttm_module.c index 66fc6395eb54..79da35a36ada 100644 --- a/drivers/gpu/drm/ttm/ttm_module.c +++ b/drivers/gpu/drm/ttm/ttm_module.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /** * * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA diff --git a/drivers/gpu/drm/ttm/ttm_object.c b/drivers/gpu/drm/ttm/ttm_object.c index 1aa2baa83959..4964148a0448 100644 --- a/drivers/gpu/drm/ttm/ttm_object.c +++ b/drivers/gpu/drm/ttm/ttm_object.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /** * * Copyright (c) 2009-2013 VMware, Inc., Palo Alto, CA., USA diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 7e672be987b5..81069c3fa19f 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /
[PATCH v2 10/26] drm/bridge: panel: provide an owner .odev device
It gets rid of an #ifdef and the .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/bridge/panel.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index 6d99d4a3beb3..f43d77b5ed20 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -169,10 +169,8 @@ struct drm_bridge *drm_panel_bridge_add(struct drm_panel *panel, panel_bridge->connector_type = connector_type; panel_bridge->panel = panel; + panel_bridge->bridge.odev = panel->dev; panel_bridge->bridge.funcs = &panel_bridge_bridge_funcs; -#ifdef CONFIG_OF - panel_bridge->bridge.of_node = panel->dev->of_node; -#endif drm_bridge_add(&panel_bridge->bridge); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v1 2/5] drm/tegra: gr2d: Add IOMMU support
On 04.05.2018 13:54, Thierry Reding wrote: > On Fri, May 04, 2018 at 02:47:20AM +0300, Dmitry Osipenko wrote: >> Attach GR2D to the display IOMMU group in order to provide GR2D access >> to BO's IOVA. >> >> Signed-off-by: Dmitry Osipenko >> --- >> drivers/gpu/drm/tegra/gr2d.c | 31 +-- >> 1 file changed, 29 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/tegra/gr2d.c b/drivers/gpu/drm/tegra/gr2d.c >> index 9a8ea93016a9..8eb530a85dd0 100644 >> --- a/drivers/gpu/drm/tegra/gr2d.c >> +++ b/drivers/gpu/drm/tegra/gr2d.c >> @@ -7,12 +7,14 @@ >> */ >> >> #include >> +#include >> >> #include "drm.h" >> #include "gem.h" >> #include "gr2d.h" >> >> struct gr2d { >> +struct iommu_group *group; >> struct tegra_drm_client client; >> struct host1x_channel *channel; >> struct clk *clk; >> @@ -30,7 +32,9 @@ static int gr2d_init(struct host1x_client *client) >> struct tegra_drm_client *drm = host1x_to_drm_client(client); >> struct drm_device *dev = dev_get_drvdata(client->parent); >> unsigned long flags = HOST1X_SYNCPT_HAS_BASE; >> +struct tegra_drm *tegra = dev->dev_private; >> struct gr2d *gr2d = to_gr2d(drm); >> +int err; >> >> gr2d->channel = host1x_channel_request(client->dev); >> if (!gr2d->channel) >> @@ -42,23 +46,46 @@ static int gr2d_init(struct host1x_client *client) >> return -ENOMEM; >> } >> >> -return tegra_drm_register_client(dev->dev_private, drm); >> +if (tegra->domain) { >> +gr2d->group = iommu_group_get(client->dev); >> + >> +if (gr2d->group) { >> +err = iommu_attach_group(tegra->domain, gr2d->group); >> +if (err < 0) { >> +dev_err(client->dev, >> +"failed to attach to domain: %d\n", >> +err); >> +host1x_syncpt_free(client->syncpts[0]); >> +host1x_channel_put(gr2d->channel); >> +iommu_group_put(gr2d->group); >> +return err; >> +} >> +} >> +} > > This is almost identical to the code in DC, perhaps we should factor > this out into a separate helper? Nothing that needs to be done right > now, I'll take a look at it and see if I can come up with something > good in a follow-up patch. Sounds good. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 06/26] drm/bridge: vga-dac: provide an owner .odev device
The .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/bridge/dumb-vga-dac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/dumb-vga-dac.c b/drivers/gpu/drm/bridge/dumb-vga-dac.c index 9837c8d69e69..95cce18e8943 100644 --- a/drivers/gpu/drm/bridge/dumb-vga-dac.c +++ b/drivers/gpu/drm/bridge/dumb-vga-dac.c @@ -205,8 +205,8 @@ static int dumb_vga_probe(struct platform_device *pdev) } } + vga->bridge.odev = &pdev->dev; vga->bridge.funcs = &dumb_vga_bridge_funcs; - vga->bridge.of_node = pdev->dev.of_node; vga->bridge.timings = of_device_get_match_data(&pdev->dev); drm_bridge_add(&vga->bridge); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v1] drm: panel-orientation-quirks: Convert to use match_string() helper
The new helper returns index of the matching string in an array. We are going to use it here. Signed-off-by: Andy Shevchenko --- drivers/gpu/drm/drm_panel_orientation_quirks.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c index caebddda8bce..fe9c6c731e87 100644 --- a/drivers/gpu/drm/drm_panel_orientation_quirks.c +++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c @@ -172,10 +172,9 @@ int drm_get_panel_orientation_quirk(int width, int height) if (!bios_date) continue; - for (i = 0; data->bios_dates[i]; i++) { - if (!strcmp(data->bios_dates[i], bios_date)) - return data->orientation; - } + i = match_string(data->bios_dates, -1, bios_date); + if (i >= 0) + return data->orientation; } return DRM_MODE_PANEL_ORIENTATION_UNKNOWN; -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 03/26] drm/bridge/analogix: core: specify the owner .odev of the bridge
This will become mandatory. Signed-off-by: Peter Rosin --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index 2bcbfadb6ac5..c60f29216213 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1467,6 +1467,7 @@ static int analogix_dp_create_bridge(struct drm_device *drm_dev, dp->bridge = bridge; + bridge->odev = dp->dev; bridge->driver_private = dp; bridge->funcs = &analogix_dp_bridge_funcs; -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v1 1/5] drm/tegra: dc: Balance IOMMU group refcounting
On 04.05.2018 13:45, Thierry Reding wrote: > On Fri, May 04, 2018 at 02:47:19AM +0300, Dmitry Osipenko wrote: >> Remove unneeded iommu_group_get() and add missing iommu_group_put(), >> correcting IOMMU group refcount. This is a minor correction / cleanup that >> doesn't really fix anything because Tegra's IOMMU driver are built-in and >> hence groups refcounting can't hold IOMMU driver from unloading. >> >> Signed-off-by: Dmitry Osipenko >> --- >> drivers/gpu/drm/tegra/dc.c | 35 +-- >> drivers/gpu/drm/tegra/dc.h | 2 +- >> drivers/gpu/drm/tegra/drm.h | 2 +- >> 3 files changed, 19 insertions(+), 20 deletions(-) >> >> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c >> index d7a0f62c6e2e..9fc34c6a7218 100644 >> --- a/drivers/gpu/drm/tegra/dc.c >> +++ b/drivers/gpu/drm/tegra/dc.c >> @@ -1927,7 +1927,6 @@ static irqreturn_t tegra_dc_irq(int irq, void *data) >> static int tegra_dc_init(struct host1x_client *client) >> { >> struct drm_device *drm = dev_get_drvdata(client->parent); >> -struct iommu_group *group = iommu_group_get(client->dev); >> unsigned long flags = HOST1X_SYNCPT_CLIENT_MANAGED; >> struct tegra_dc *dc = host1x_client_to_dc(client); >> struct tegra_drm *tegra = drm->dev_private; >> @@ -1939,20 +1938,21 @@ static int tegra_dc_init(struct host1x_client >> *client) >> if (!dc->syncpt) >> dev_warn(dc->dev, "failed to allocate syncpoint\n"); >> >> -if (group && tegra->domain) { >> -if (group != tegra->group) { >> -err = iommu_attach_group(tegra->domain, group); >> +if (tegra->domain) { >> +dc->group = iommu_group_get(client->dev); >> + >> +if (dc->group && dc->group != tegra->dc_group) { >> +err = iommu_attach_group(tegra->domain, dc->group); >> if (err < 0) { >> dev_err(dc->dev, >> "failed to attach to domain: %d\n", >> err); >> +iommu_group_put(dc->group); >> return err; >> } >> >> -tegra->group = group; >> +tegra->dc_group = dc->group; >> } >> - >> -dc->domain = tegra->domain; >> } >> >> if (dc->soc->wgrps) >> @@ -2017,13 +2017,13 @@ static int tegra_dc_init(struct host1x_client >> *client) >> if (!IS_ERR(primary)) >> drm_plane_cleanup(primary); >> >> -if (group && dc->domain) { >> -if (group == tegra->group) { >> -iommu_detach_group(dc->domain, group); >> -tegra->group = NULL; >> +if (dc->group) { >> +if (dc->group && dc->group == tegra->dc_group) { > > You can drop the dc->group check from the second conditional. Indeed. >> +iommu_detach_group(tegra->domain, dc->group); >> +tegra->dc_group = NULL; >> } >> >> -dc->domain = NULL; >> +iommu_group_put(dc->group); >> } >> >> return err; >> @@ -2032,7 +2032,6 @@ static int tegra_dc_init(struct host1x_client *client) >> static int tegra_dc_exit(struct host1x_client *client) >> { >> struct drm_device *drm = dev_get_drvdata(client->parent); >> -struct iommu_group *group = iommu_group_get(client->dev); >> struct tegra_dc *dc = host1x_client_to_dc(client); >> struct tegra_drm *tegra = drm->dev_private; >> int err; >> @@ -2045,13 +2044,13 @@ static int tegra_dc_exit(struct host1x_client >> *client) >> return err; >> } >> >> -if (group && dc->domain) { >> -if (group == tegra->group) { >> -iommu_detach_group(dc->domain, group); >> -tegra->group = NULL; >> +if (dc->group) { >> +if (dc->group && dc->group == tegra->dc_group) { >> +iommu_detach_group(tegra->domain, dc->group); >> +tegra->dc_group = NULL; >> } >> >> -dc->domain = NULL; >> +iommu_group_put(dc->group); >> } >> >> host1x_syncpt_free(dc->syncpt); >> diff --git a/drivers/gpu/drm/tegra/dc.h b/drivers/gpu/drm/tegra/dc.h >> index ca5cac6bf8ea..5ca4e07333bb 100644 >> --- a/drivers/gpu/drm/tegra/dc.h >> +++ b/drivers/gpu/drm/tegra/dc.h >> @@ -94,7 +94,7 @@ struct tegra_dc { >> >> const struct tegra_dc_soc_info *soc; >> >> -struct iommu_domain *domain; >> +struct iommu_group *group; >> }; >> >> static inline struct tegra_dc * >> diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h >> index 4f41aaec8530..640a6911 100644 >> --- a/drivers/gpu/drm/tegra/drm.h >> +++ b/drivers/gpu/drm/tegra/drm.h >> @@ -46,7 +46,7 @@ struct tegra_drm { >> struct drm_device *drm; >> >> struct iommu_domain *domain; >> -st
[PATCH v2 11/26] drm/bridge: ps8622: provide an owner .odev device
The .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/bridge/parade-ps8622.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c index 81198f5e9afa..957420a1c924 100644 --- a/drivers/gpu/drm/bridge/parade-ps8622.c +++ b/drivers/gpu/drm/bridge/parade-ps8622.c @@ -595,8 +595,8 @@ static int ps8622_probe(struct i2c_client *client, ps8622->bl->props.brightness = PS8622_MAX_BRIGHTNESS; } + ps8622->bridge.odev = dev; ps8622->bridge.funcs = &ps8622_bridge_funcs; - ps8622->bridge.of_node = dev->of_node; drm_bridge_add(&ps8622->bridge); i2c_set_clientdata(client, ps8622); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 21/26] drm/msm: specify the owner .odev of the bridges
This will become mandatory. Signed-off-by: Peter Rosin --- drivers/gpu/drm/msm/dsi/dsi_manager.c | 1 + drivers/gpu/drm/msm/edp/edp_bridge.c | 1 + drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 1 + 3 files changed, 3 insertions(+) diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 4cb1cb68878b..1668e8abe5c1 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -710,6 +710,7 @@ struct drm_bridge *msm_dsi_manager_bridge_init(u8 id) encoder = msm_dsi->encoder; bridge = &dsi_bridge->base; + bridge->odev = msm_dsi->dev->dev; bridge->funcs = &dsi_mgr_bridge_funcs; ret = drm_bridge_attach(encoder, bridge, NULL); diff --git a/drivers/gpu/drm/msm/edp/edp_bridge.c b/drivers/gpu/drm/msm/edp/edp_bridge.c index 931a5c97cccf..4c56e29c57b7 100644 --- a/drivers/gpu/drm/msm/edp/edp_bridge.c +++ b/drivers/gpu/drm/msm/edp/edp_bridge.c @@ -104,6 +104,7 @@ struct drm_bridge *msm_edp_bridge_init(struct msm_edp *edp) edp_bridge->edp = edp; bridge = &edp_bridge->base; + bridge->odev = edp->dev->dev; bridge->funcs = &edp_bridge_funcs; ret = drm_bridge_attach(edp->encoder, bridge, NULL); diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c index 7e357077ed26..aa6dd1bc5dc0 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -293,6 +293,7 @@ struct drm_bridge *msm_hdmi_bridge_init(struct hdmi *hdmi) hdmi_bridge->hdmi = hdmi; bridge = &hdmi_bridge->base; + bridge->odev = hdmi->dev->dev; bridge->funcs = &msm_hdmi_bridge_funcs; ret = drm_bridge_attach(hdmi->encoder, bridge, NULL); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/2] gpu: ipu-v3: csi: support RGB565 on parallel bus
The CSI_SENS_CONF_DATA_FMT_RGB565 configuration only works for MIPI CSI-2 sources. On the parallel bus, we need to use bayer (generic) mode instead. To handle this difference, we pass the mbus_type to mbus_code_to_bus_cfg(). Signed-off-by: Jan Luebbe --- drivers/gpu/ipu-v3/ipu-csi.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/ipu-v3/ipu-csi.c b/drivers/gpu/ipu-v3/ipu-csi.c index 39c3aabb6d17..28a6b6243baa 100644 --- a/drivers/gpu/ipu-v3/ipu-csi.c +++ b/drivers/gpu/ipu-v3/ipu-csi.c @@ -224,14 +224,18 @@ static int ipu_csi_set_testgen_mclk(struct ipu_csi *csi, u32 pixel_clk, * Find the CSI data format and data width for the given V4L2 media * bus pixel format code. */ -static int mbus_code_to_bus_cfg(struct ipu_csi_bus_config *cfg, u32 mbus_code) +static int mbus_code_to_bus_cfg(struct ipu_csi_bus_config *cfg, u32 mbus_code, + enum v4l2_mbus_type mbus_type) { switch (mbus_code) { case MEDIA_BUS_FMT_BGR565_2X8_BE: case MEDIA_BUS_FMT_BGR565_2X8_LE: case MEDIA_BUS_FMT_RGB565_2X8_BE: case MEDIA_BUS_FMT_RGB565_2X8_LE: - cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_RGB565; + if (mbus_type == V4L2_MBUS_CSI2) + cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_RGB565; + else + cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER; cfg->mipi_dt = MIPI_DT_RGB565; cfg->data_width = IPU_CSI_DATA_WIDTH_8; break; @@ -326,7 +330,7 @@ static int fill_csi_bus_cfg(struct ipu_csi_bus_config *csicfg, memset(csicfg, 0, sizeof(*csicfg)); - rc = mbus_code_to_bus_cfg(csicfg, mbus_fmt->code); + rc = mbus_code_to_bus_cfg(csicfg, mbus_fmt->code, mbus_cfg->type); if (rc < 0) return rc; @@ -600,7 +604,7 @@ int ipu_csi_set_mipi_datatype(struct ipu_csi *csi, u32 vc, if (vc > 3) return -EINVAL; - rc = mbus_code_to_bus_cfg(&cfg, mbus_fmt->code); + rc = mbus_code_to_bus_cfg(&cfg, mbus_fmt->code, V4L2_MBUS_CSI2); if (rc < 0) return rc; -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH RESEND 1/2] drm/msm: remove unbalanced mutex unlock
On Thursday, May 03, 2018 02:24 PM, Rob Clark wrote: > On Thu, May 3, 2018 at 8:00 AM, Daniel Mack wrote: >> This regression stems from 0e08270a1f01 ("drm/msm: Separate locking of >> buffer resources from struct_mutex"). >> >> Signed-off-by: Daniel Mack >> Cc: Sushmita Susheelendra >> Cc: Rob Clark >> Fixes: 0e08270a1f01 ("drm/msm: Separate locking of buffer resources from >> struct_mutex") >> --- >> I'm resending these two patches as I got no reply last time. > > I've applied these two to msm-next. Sorry I missed them before... > for some reason they don't seem to show up in the dri-devel > patchworks[1] No problem, and thanks for applying them :) Daniel > > BR, > -R > > [1] https://patchwork.freedesktop.org/project/dri-devel/series/ > >> >> drivers/gpu/drm/msm/dsi/dsi_host.c | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c >> b/drivers/gpu/drm/msm/dsi/dsi_host.c >> index 0f7324a686ca..27637d8a99ff 100644 >> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c >> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c >> @@ -994,7 +994,6 @@ static int dsi_tx_buf_alloc(struct msm_dsi_host >> *msm_host, int size) >> >> ret = msm_gem_get_iova(msm_host->tx_gem_obj, >> priv->kms->aspace, &iova); >> - mutex_unlock(&dev->struct_mutex); >> if (ret) { >> pr_err("%s: failed to get iova, %d\n", __func__, >> ret); >> return ret; >> -- >> 2.14.3 >> ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 17/26] drm/bridge: thc63lvd1024: provide an owner .odev device
The .of_node member is going away. Signed-off-by: Peter Rosin --- drivers/gpu/drm/bridge/thc63lvd1024.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/thc63lvd1024.c b/drivers/gpu/drm/bridge/thc63lvd1024.c index c8b9edd5a7f4..4765c9c45aef 100644 --- a/drivers/gpu/drm/bridge/thc63lvd1024.c +++ b/drivers/gpu/drm/bridge/thc63lvd1024.c @@ -167,8 +167,8 @@ static int thc63_probe(struct platform_device *pdev) if (ret) return ret; + thc63->bridge.odev = &pdev->dev; thc63->bridge.driver_private = thc63; - thc63->bridge.of_node = pdev->dev.of_node; thc63->bridge.funcs = &thc63_bridge_func; drm_bridge_add(&thc63->bridge); -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 7/8] drm/vmwgfx: add SPDX idenitifier and clarify license
Hi Thomas, On Fri, May 04, 2018 at 08:18:09AM +0200, Thomas Hellstrom wrote: > On 05/04/2018 12:15 AM, Dirk Hohndel (VMware) wrote: > > This is licensed under GPL-2.0. > > > > Signed-off-by: Dirk Hohndel (VMware) > > --- > > drivers/gpu/drm/vmwgfx/Kconfig| 1 + > > .../vmwgfx/device_include/vmware_pack_begin.h | 25 +-- > > .../vmwgfx/device_include/vmware_pack_end.h | 25 +-- > > drivers/gpu/drm/vmwgfx/vmwgfx_msg.h | 14 ++- > > 4 files changed, 5 insertions(+), 60 deletions(-) > > > > diff --git a/drivers/gpu/drm/vmwgfx/Kconfig b/drivers/gpu/drm/vmwgfx/Kconfig > > index 8c308dac99c5..6b28a326f8bb 100644 > > --- a/drivers/gpu/drm/vmwgfx/Kconfig > > +++ b/drivers/gpu/drm/vmwgfx/Kconfig > > @@ -1,3 +1,4 @@ > > +# SPDX-License-Identifier: GPL-2.0 > > config DRM_VMWGFX > > tristate "DRM driver for VMware Virtual GPU" > > depends on DRM && PCI && X86 && MMU As a Kconfig file I think it seems unlikely there is a reason to dual license - and given the provenance of this file, I think one might argue that this is derived from GPL-2 code. > > diff --git a/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_begin.h > > b/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_begin.h > > index 7e7b0ce34aa2..75308bd0d970 100644 > > --- a/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_begin.h > > +++ b/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_begin.h > > @@ -1,25 +1,2 @@ > > -/** > > - * Copyright 2015 VMware, Inc. All rights reserved. > > - * > > - * Permission is hereby granted, free of charge, to any person > > - * obtaining a copy of this software and associated documentation > > - * files (the "Software"), to deal in the Software without > > - * restriction, including without limitation the rights to use, copy, > > - * modify, merge, publish, distribute, sublicense, and/or sell copies > > - * of the Software, and to permit persons to whom the Software is > > - * furnished to do so, subject to the following conditions: > > - * > > - * The above copyright notice and this permission notice shall be > > - * included in all copies or substantial portions of the Software. > > - * > > - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, > > - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF > > - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND > > - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS > > - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN > > - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN > > - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > > - * SOFTWARE. > > - * > > - **/ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > #include This file is a single line that includes a GPL-2 header file. Technically I think one could claim that this could be dual licensed - I fail to see the purpose. > > diff --git a/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_end.h > > b/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_end.h > > index e2e440ed3d44..e93d6f28b68c 100644 > > --- a/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_end.h > > +++ b/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_end.h > > @@ -1,25 +1,2 @@ > > -/** > > - * Copyright 2015 VMware, Inc. All rights reserved. > > - * > > - * Permission is hereby granted, free of charge, to any person > > - * obtaining a copy of this software and associated documentation > > - * files (the "Software"), to deal in the Software without > > - * restriction, including without limitation the rights to use, copy, > > - * modify, merge, publish, distribute, sublicense, and/or sell copies > > - * of the Software, and to permit persons to whom the Software is > > - * furnished to do so, subject to the following conditions: > > - * > > - * The above copyright notice and this permission notice shall be > > - * included in all copies or substantial portions of the Software. > > - * > > - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, > > - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF > > - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND > > - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS > > - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN > > - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN > > - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > > - * SOFTWARE. > > - * > > - **/ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > __packed This file contains, fundamentally, the pragma "__packed". Claiming any license for this file is a bit ridiculous, but since it's part of the kernel,
Re: [PATCH v1 2/3] drm/tegra: plane: Implement zPos plane property for older Tegra's
On 04.05.2018 15:15, Thierry Reding wrote: > On Fri, May 04, 2018 at 03:08:43AM +0300, Dmitry Osipenko wrote: >> Older Tegra's do not support planes z position handling in hardware, >> but HW provides knobs for zPos implementation in software. >> >> Signed-off-by: Dmitry Osipenko >> --- >> drivers/gpu/drm/tegra/dc.c| 134 --- >> drivers/gpu/drm/tegra/plane.c | 193 -- >> drivers/gpu/drm/tegra/plane.h | 13 ++- >> 3 files changed, 244 insertions(+), 96 deletions(-) > > This is obviously a lot to review, but it looks pretty good. On minor > comment below. > >> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c >> index 2e81142281c3..ba5481cd470d 100644 >> --- a/drivers/gpu/drm/tegra/dc.c >> +++ b/drivers/gpu/drm/tegra/dc.c >> @@ -162,29 +162,90 @@ static void tegra_plane_setup_blending_legacy(struct >> tegra_plane *plane) > [...] >> +case 1: >> +/* >> + * When both middle and topmost windows have an alpha, >> + * these windows a mixed together and then the result >> + * is blended over the bottom window. >> + */ >> +if ((state->blending[0].alpha && >> + state->blending[0].top)) > > There seems to be one pair of parentheses too much here. Good catch ;) ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 02/13] drm/kms/mode/bridge-tc358767: using helper func drm_display_mode_to_videomode for calculating timing parameters
To avoid duplicate logic for timing parameters Signed-off-by: Satendra Singh Thakur Cc: Madhur Verma Cc: Hemanshu Srivastava --- drivers/gpu/drm/bridge/tc358767.c | 42 ++- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 08ab7d6a..d90ac27 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -39,6 +39,7 @@ #include #include #include +#include /* Registers */ @@ -653,14 +654,9 @@ static int tc_set_video_mode(struct tc_data *tc, struct drm_display_mode *mode) int ret; int vid_sync_dly; int max_tu_symbol; + struct videomode vm; - int left_margin = mode->htotal - mode->hsync_end; - int right_margin = mode->hsync_start - mode->hdisplay; - int hsync_len = mode->hsync_end - mode->hsync_start; - int upper_margin = mode->vtotal - mode->vsync_end; - int lower_margin = mode->vsync_start - mode->vdisplay; - int vsync_len = mode->vsync_end - mode->vsync_start; - + drm_display_mode_to_videomode(mode, &vm); /* * Recommended maximum number of symbols transferred in a transfer unit: * DIV_ROUND_UP((input active video bandwidth in bytes) * tu_size, @@ -670,11 +666,11 @@ static int tc_set_video_mode(struct tc_data *tc, struct drm_display_mode *mode) max_tu_symbol = TU_SIZE_RECOMMENDED - 1; dev_dbg(tc->dev, "set mode %dx%d\n", - mode->hdisplay, mode->vdisplay); + vm.hactive, vm.vactive); dev_dbg(tc->dev, "H margin %d,%d sync %d\n", - left_margin, right_margin, hsync_len); + vm.hback_porch, vm.hfront_porch, vm.hsync_len); dev_dbg(tc->dev, "V margin %d,%d sync %d\n", - upper_margin, lower_margin, vsync_len); + vm.vback_porch, vm.vfront_porch, vm.vsync_len); dev_dbg(tc->dev, "total: %dx%d\n", mode->htotal, mode->vtotal); @@ -686,14 +682,14 @@ static int tc_set_video_mode(struct tc_data *tc, struct drm_display_mode *mode) */ tc_write(VPCTRL0, (0 << 20) /* VSDELAY */ | OPXLFMT_RGB888 | FRMSYNC_DISABLED | MSF_DISABLED); - tc_write(HTIM01, (ALIGN(left_margin, 2) << 16) | /* H back porch */ -(ALIGN(hsync_len, 2) << 0));/* Hsync */ - tc_write(HTIM02, (ALIGN(right_margin, 2) << 16) | /* H front porch */ -(ALIGN(mode->hdisplay, 2) << 0)); /* width */ - tc_write(VTIM01, (upper_margin << 16) | /* V back porch */ -(vsync_len << 0)); /* Vsync */ - tc_write(VTIM02, (lower_margin << 16) | /* V front porch */ -(mode->vdisplay << 0));/* height */ + tc_write(HTIM01, (ALIGN(vm.hback_porch, 2) << 16) | /* H back porch */ +(ALIGN(vm.hsync_len, 2) << 0)); /* Hsync */ + tc_write(HTIM02, (ALIGN(vm.hfront_porch, 2) << 16) | /* H front porch */ +(ALIGN(vm.hactive, 2) << 0)); /* width */ + tc_write(VTIM01, (vm.vback_porch << 16) | /* V back porch */ +(vm.vsync_len << 0)); /* Vsync */ + tc_write(VTIM02, (vm.vfront_porch << 16) | /* V front porch */ +(vm.vactive << 0));/* height */ tc_write(VFUEN0, VFUEN);/* update settings */ /* Test pattern settings */ @@ -706,7 +702,7 @@ static int tc_set_video_mode(struct tc_data *tc, struct drm_display_mode *mode) 0); /* DP Main Stream Attributes */ - vid_sync_dly = hsync_len + left_margin + mode->hdisplay; + vid_sync_dly = vm.hsync_len + vm.hback_porch + vm.hactive; tc_write(DP0_VIDSYNCDELAY, (max_tu_symbol << 16) |/* thresh_dly */ (vid_sync_dly << 0)); @@ -714,12 +710,12 @@ static int tc_set_video_mode(struct tc_data *tc, struct drm_display_mode *mode) tc_write(DP0_TOTALVAL, (mode->vtotal << 16) | (mode->htotal)); tc_write(DP0_STARTVAL, -((upper_margin + vsync_len) << 16) | -((left_margin + hsync_len) << 0)); +((vm.vback_porch + vm.vsync_len) << 16) | +((vm.hback_porch + vm.hsync_len) << 0)); - tc_write(DP0_ACTIVEVAL, (mode->vdisplay << 16) | (mode->hdisplay)); + tc_write(DP0_ACTIVEVAL, (vm.vactive << 16) | (vm.hactive)); - tc_write(DP0_SYNCVAL, (vsync_len << 16) | (hsync_len << 0)); + tc_write(DP0_SYNCVAL, (vm.vsync_len << 16) | (vm.hsync_len << 0)); tc_write(DPIPXLFMT, VS_POL_ACTIVE_LOW | HS_POL_ACTIVE_LOW | DE_POL_ACTIVE_HIGH | SUB_CFG_TYPE_CONFIG1 | DPI_BPP_RGB888); -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/
[PATCH v1 09/13] drm/kms/mode/sun4i-tv: using helper func drm_display_mode_from_videomode for calculating timing parameters
To avoid duplicate logic for horizonal/vertical sync_start/end helper func drm_display_mode_from_videomode is used Acked-by: Maxime Ripard Signed-off-by: Satendra Singh Thakur Acked-by: Madhur Verma Cc: Hemanshu Srivastava --- v1: Added acked-by fields drivers/gpu/drm/sun4i/sun4i_tv.c | 67 +++- 1 file changed, 25 insertions(+), 42 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tv.c b/drivers/gpu/drm/sun4i/sun4i_tv.c index b070d52..7ffa930 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tv.c +++ b/drivers/gpu/drm/sun4i/sun4i_tv.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "sun4i_crtc.h" #include "sun4i_drv.h" @@ -147,16 +148,7 @@ struct tv_mode { u16 front_porch; u16 line_number; u16 vblank_level; - - u32 hdisplay; - u16 hfront_porch; - u16 hsync_len; - u16 hback_porch; - - u32 vdisplay; - u16 vfront_porch; - u16 vsync_len; - u16 vback_porch; + struct videomode vm; boolyc_en; booldac3_en; @@ -223,16 +215,16 @@ static const struct tv_mode tv_modes[] = { .back_porch = 118, .front_porch= 32, .line_number= 525, - - .hdisplay = 720, - .hfront_porch = 18, - .hsync_len = 2, - .hback_porch= 118, - - .vdisplay = 480, - .vfront_porch = 26, - .vsync_len = 2, - .vback_porch= 17, + .vm = { + .hactive= 720, + .hfront_porch = 18, + .hsync_len = 2, + .hback_porch= 118, + .vactive= 480, + .vfront_porch = 26, + .vsync_len = 2, + .vback_porch= 17, + }, .vblank_level = 240, @@ -249,16 +241,16 @@ static const struct tv_mode tv_modes[] = { .back_porch = 138, .front_porch= 24, .line_number= 625, - - .hdisplay = 720, - .hfront_porch = 3, - .hsync_len = 2, - .hback_porch= 139, - - .vdisplay = 576, - .vfront_porch = 28, - .vsync_len = 2, - .vback_porch= 19, + .vm = { + .hactive= 720, + .hfront_porch = 3, + .hsync_len = 2, + .hback_porch= 139, + .vactive= 576, + .vfront_porch = 28, + .vsync_len = 2, + .vback_porch= 19, + }, .vblank_level = 252, @@ -311,9 +303,9 @@ static const struct tv_mode *sun4i_tv_find_tv_by_mode(const struct drm_display_m DRM_DEBUG_DRIVER("Comparing mode %s vs %s (X: %d vs %d)", mode->name, tv_mode->name, -mode->vdisplay, tv_mode->vdisplay); +mode->vdisplay, tv_mode->vm.vactive); - if (mode->vdisplay == tv_mode->vdisplay) + if (mode->vdisplay == tv_mode->vm.vactive) return tv_mode; } @@ -325,19 +317,10 @@ static void sun4i_tv_mode_to_drm_mode(const struct tv_mode *tv_mode, { DRM_DEBUG_DRIVER("Creating mode %s\n", mode->name); + drm_display_mode_from_videomode(&tv_mode->vm, mode); mode->type = DRM_MODE_TYPE_DRIVER; mode->clock = 13500; mode->flags = DRM_MODE_FLAG_INTERLACE; - - mode->hdisplay = tv_mode->hdisplay; - mode->hsync_start = mode->hdisplay + tv_mode->hfront_porch; - mode->hsync_end = mode->hsync_start + tv_mode->hsync_len; - mode->htotal = mode->hsync_end + tv_mode->hback_porch; - - mode->vdisplay = tv_mode->vdisplay; - mode->vsync_start = mode->vdisplay + tv_mode->vfront_porch; - mode->vsync_end = mode->vsync_start + tv_mode->vsync_len; - mode->vtotal = mode->vsync_end + tv_mode->vback_porch; } static void sun4i_tv_disable(struct drm_encoder *encoder) -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 05/13] drm/kms/mode/gma500-mdfld_dsi_dpi: using helper function drm_display_mode_to_videomode for calculating timing parameters
To avoid duplicate logic for the same Signed-off-by: Satendra Singh Thakur Cc: Madhur Verma Cc: Hemanshu Srivastava --- drivers/gpu/drm/gma500/mdfld_dsi_dpi.c | 28 ++-- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c b/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c index a05c0206..0ac3e1f 100644 --- a/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c +++ b/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c @@ -24,7 +24,7 @@ * jim liu * Jackie Li */ - +#include #include "mdfld_dsi_dpi.h" #include "mdfld_output.h" #include "mdfld_dsi_pkg_sender.h" @@ -429,36 +429,28 @@ int mdfld_dsi_dpi_timing_calculation(struct drm_display_mode *mode, struct mdfld_dsi_dpi_timing *dpi_timing, int num_lane, int bpp) { - int pclk_hsync, pclk_hfp, pclk_hbp, pclk_hactive; - int pclk_vsync, pclk_vfp, pclk_vbp; - - pclk_hactive = mode->hdisplay; - pclk_hfp = mode->hsync_start - mode->hdisplay; - pclk_hsync = mode->hsync_end - mode->hsync_start; - pclk_hbp = mode->htotal - mode->hsync_end; + struct videomode vm; - pclk_vfp = mode->vsync_start - mode->vdisplay; - pclk_vsync = mode->vsync_end - mode->vsync_start; - pclk_vbp = mode->vtotal - mode->vsync_end; + drm_display_mode_to_videomode(mode, &vm); /* * byte clock counts were calculated by following formula * bclock_count = pclk_count * bpp / num_lane / 8 */ dpi_timing->hsync_count = mdfld_dsi_dpi_to_byte_clock_count( - pclk_hsync, num_lane, bpp); + vm.hsync_len, num_lane, bpp); dpi_timing->hbp_count = mdfld_dsi_dpi_to_byte_clock_count( - pclk_hbp, num_lane, bpp); + vm.hback_porch, num_lane, bpp); dpi_timing->hfp_count = mdfld_dsi_dpi_to_byte_clock_count( - pclk_hfp, num_lane, bpp); + vm.hfront_porch, num_lane, bpp); dpi_timing->hactive_count = mdfld_dsi_dpi_to_byte_clock_count( - pclk_hactive, num_lane, bpp); + vm.hactive, num_lane, bpp); dpi_timing->vsync_count = mdfld_dsi_dpi_to_byte_clock_count( - pclk_vsync, num_lane, bpp); + vm.vsync_len, num_lane, bpp); dpi_timing->vbp_count = mdfld_dsi_dpi_to_byte_clock_count( - pclk_vbp, num_lane, bpp); + vm.vback_porch, num_lane, bpp); dpi_timing->vfp_count = mdfld_dsi_dpi_to_byte_clock_count( - pclk_vfp, num_lane, bpp); + vm.vfront_porch, num_lane, bpp); return 0; } -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v1 0/3] Couple more DRM plane features on Tegra
Hi, This series improves DRM plane support by supporting zPos on older Tegra's and enabling plane scaling filters (up to Tegra210). Dmitry Osipenko (3): drm/tegra: dc: Enable plane scaling filters drm/tegra: plane: Implement zPos plane property for older Tegra's drm/tegra: dc: Rename supports_blending to has_legacy_blending drivers/gpu/drm/tegra/dc.c| 205 ++ drivers/gpu/drm/tegra/dc.h| 9 +- drivers/gpu/drm/tegra/plane.c | 193 +++- drivers/gpu/drm/tegra/plane.h | 13 ++- 4 files changed, 313 insertions(+), 107 deletions(-) -- 2.17.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel