[BACKPORT 4.14.y 1/8] drm/i915/fbdev: Actually configure untiled displays
From: Chris Wilson If we skipped all the connectors that were not part of a tile, we would leave conn_seq=0 and conn_configured=0, convincing ourselves that we had stagnated in our configuration attempts. Avoid this situation by starting conn_seq=ALL_CONNECTORS, and repeating until we find no more connectors to configure. Fixes: 754a76591b12 ("drm/i915/fbdev: Stop repeating tile configuration on stagnation") Reported-by: Maarten Lankhorst Signed-off-by: Chris Wilson Cc: Maarten Lankhorst Reviewed-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20190215123019.32283-1-ch...@chris-wilson.co.uk Cc: # v3.19+ Signed-off-by: Baolin Wang --- drivers/gpu/drm/i915/intel_fbdev.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c index da2d309..14eb8a0 100644 --- a/drivers/gpu/drm/i915/intel_fbdev.c +++ b/drivers/gpu/drm/i915/intel_fbdev.c @@ -326,8 +326,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, bool *enabled, int width, int height) { struct drm_i915_private *dev_priv = to_i915(fb_helper->dev); - unsigned long conn_configured, conn_seq, mask; unsigned int count = min(fb_helper->connector_count, BITS_PER_LONG); + unsigned long conn_configured, conn_seq; int i, j; bool *save_enabled; bool fallback = true, ret = true; @@ -345,10 +345,9 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, drm_modeset_backoff(&ctx); memcpy(save_enabled, enabled, count); - mask = GENMASK(count - 1, 0); + conn_seq = GENMASK(count - 1, 0); conn_configured = 0; retry: - conn_seq = conn_configured; for (i = 0; i < count; i++) { struct drm_fb_helper_connector *fb_conn; struct drm_connector *connector; @@ -361,7 +360,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, if (conn_configured & BIT(i)) continue; - if (conn_seq == 0 && !connector->has_tile) + /* First pass, only consider tiled connectors */ + if (conn_seq == GENMASK(count - 1, 0) && !connector->has_tile) continue; if (connector->status == connector_status_connected) @@ -465,8 +465,10 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, conn_configured |= BIT(i); } - if ((conn_configured & mask) != mask && conn_configured != conn_seq) + if (conn_configured != conn_seq) { /* repeat until no more are found */ + conn_seq = conn_configured; goto retry; + } /* * If the BIOS didn't enable everything it could, fall back to have the -- 1.7.9.5
[BACKPORT 4.14.y 0/8] Candidates from Spreadtrum 4.14 product kernel
With Arnd's script [1] help, I found some bugfixes in Spreadtrum 4.14 product kernel, but missing in v4.14.141: 86fda90ab588 net: sctp: fix warning "NULL check before some freeing functions is not needed" 25a09ce79639 ppp: mppe: Revert "ppp: mppe: Add softdep to arc4" d9b308b1f8a1 drm/i915/fbdev: Actually configure untiled displays 47d3d7fdb10a ip6: fix skb leak in ip6frag_expire_frag_queue() 5b9cea15a3de serial: sprd: Modify the baud rate calculation formula 513e1073d52e locking/lockdep: Add debug_locks check in __lock_downgrade() 957063c92473 pinctrl: sprd: Use define directive for sprd_pinconf_params values 87a2b65fc855 power: supply: sysfs: ratelimit property read error message [1] https://lore.kernel.org/lkml/20190322154425.3852517-19-a...@arndb.de/T/ Chris Wilson (1): drm/i915/fbdev: Actually configure untiled displays David Lechner (1): power: supply: sysfs: ratelimit property read error message Eric Biggers (1): ppp: mppe: Revert "ppp: mppe: Add softdep to arc4" Eric Dumazet (1): ip6: fix skb leak in ip6frag_expire_frag_queue() Hariprasad Kelam (1): net: sctp: fix warning "NULL check before some freeing functions is not needed" Lanqing Liu (1): serial: sprd: Modify the baud rate calculation formula Nathan Chancellor (1): pinctrl: sprd: Use define directive for sprd_pinconf_params values Waiman Long (1): locking/lockdep: Add debug_locks check in __lock_downgrade() drivers/gpu/drm/i915/intel_fbdev.c| 12 +++- drivers/net/ppp/ppp_mppe.c|1 - drivers/pinctrl/sprd/pinctrl-sprd.c |6 ++ drivers/power/supply/power_supply_sysfs.c |3 ++- drivers/tty/serial/sprd_serial.c |2 +- include/net/ipv6_frag.h |1 - kernel/locking/lockdep.c |3 +++ net/sctp/sm_make_chunk.c | 12 8 files changed, 19 insertions(+), 21 deletions(-) -- 1.7.9.5
Re: [PATCH 4/5] drm/qxl: use drm_gem_object_funcs callbacks
Hi Am 03.09.19 um 08:24 schrieb Gerd Hoffmann: > On Mon, Sep 02, 2019 at 04:34:49PM +0200, Thomas Zimmermann wrote: >> This patch seems unrelated. > > Well, patch 5/5 depends on it because it hooks the > drm_gem_ttm_print_info helper into the new > qxl_object_funcs added by this patch. Acked-by: Thomas Zimmermann > >> Am 02.09.19 um 14:41 schrieb Gerd Hoffmann: >>> Switch qxl to use drm_gem_object_funcs callbacks >>> instead of drm_driver callbacks. >>> >>> Signed-off-by: Gerd Hoffmann >>> --- >>> drivers/gpu/drm/qxl/qxl_drv.c| 8 >>> drivers/gpu/drm/qxl/qxl_object.c | 12 >>> 2 files changed, 12 insertions(+), 8 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c >>> index 2b726a51a302..996d428fa7e6 100644 >>> --- a/drivers/gpu/drm/qxl/qxl_drv.c >>> +++ b/drivers/gpu/drm/qxl/qxl_drv.c >>> @@ -258,16 +258,8 @@ static struct drm_driver qxl_driver = { >>> #endif >>> .prime_handle_to_fd = drm_gem_prime_handle_to_fd, >>> .prime_fd_to_handle = drm_gem_prime_fd_to_handle, >>> - .gem_prime_pin = qxl_gem_prime_pin, >>> - .gem_prime_unpin = qxl_gem_prime_unpin, >>> - .gem_prime_get_sg_table = qxl_gem_prime_get_sg_table, >>> .gem_prime_import_sg_table = qxl_gem_prime_import_sg_table, >>> - .gem_prime_vmap = qxl_gem_prime_vmap, >>> - .gem_prime_vunmap = qxl_gem_prime_vunmap, >>> .gem_prime_mmap = qxl_gem_prime_mmap, >>> - .gem_free_object_unlocked = qxl_gem_object_free, >>> - .gem_open_object = qxl_gem_object_open, >>> - .gem_close_object = qxl_gem_object_close, >>> .fops = &qxl_fops, >>> .ioctls = qxl_ioctls, >>> .irq_handler = qxl_irq_handler, >>> diff --git a/drivers/gpu/drm/qxl/qxl_object.c >>> b/drivers/gpu/drm/qxl/qxl_object.c >>> index 548dfe6f3b26..29aab7b14513 100644 >>> --- a/drivers/gpu/drm/qxl/qxl_object.c >>> +++ b/drivers/gpu/drm/qxl/qxl_object.c >>> @@ -77,6 +77,17 @@ void qxl_ttm_placement_from_domain(struct qxl_bo *qbo, >>> u32 domain, bool pinned) >>> } >>> } >>> >>> +static const struct drm_gem_object_funcs qxl_object_funcs = { >>> + .free = qxl_gem_object_free, >>> + .open = qxl_gem_object_open, >>> + .close = qxl_gem_object_close, >>> + .pin = qxl_gem_prime_pin, >>> + .unpin = qxl_gem_prime_unpin, >>> + .get_sg_table = qxl_gem_prime_get_sg_table, >>> + .vmap = qxl_gem_prime_vmap, >>> + .vunmap = qxl_gem_prime_vunmap, >>> +}; >>> + >>> int qxl_bo_create(struct qxl_device *qdev, >>> unsigned long size, bool kernel, bool pinned, u32 domain, >>> struct qxl_surface *surf, >>> @@ -100,6 +111,7 @@ int qxl_bo_create(struct qxl_device *qdev, >>> kfree(bo); >>> return r; >>> } >>> + bo->tbo.base.funcs = &qxl_object_funcs; >>> bo->type = domain; >>> bo->pin_count = pinned ? 1 : 0; >>> bo->surface_id = 0; >>> >> >> -- >> Thomas Zimmermann >> Graphics Driver Developer >> SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany >> GF: Felix Imendörffer, Mary Higgins, Sri Rasiah >> HRB 21284 (AG Nürnberg) >> > > > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel > -- Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg) signature.asc Description: OpenPGP digital signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: gnome-shell stuck because of amdgpu driver [5.3 RC5]
On Fri, 30 Aug 2019 at 08:30, Hillf Danton wrote: > > Add a warning to show if it makes sense in field: neither regression nor > problem will have been observed with the warning printed. > I caught the problem. [21793.094289] [ cut here ] [21793.094296] gnome shell stuck warning [21793.094391] WARNING: CPU: 14 PID: 1768 at drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:332 amdgpu_fence_wait_empty+0x1c2/0x230 [amdgpu] [21793.094394] Modules linked in: rfcomm fuse xt_CHECKSUM xt_MASQUERADE nf_nat_tftp nf_conntrack_tftp tun bridge stp llc nf_conntrack_netbios_ns nf_conntrack_broadcast xt_CT ip6t_REJECT nf_reject_ipv6 ip6t_rpfilter ipt_REJECT nf_reject_ipv4 xt_conntrack ebtable_nat ip6table_nat ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat iptable_mangle iptable_raw iptable_security nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip_set nfnetlink ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter cmac bnep sunrpc vfat fat edac_mce_amd kvm_amd snd_hda_codec_realtek rtwpci rtw88 snd_hda_codec_generic snd_usb_audio kvm ledtrig_audio snd_hda_codec_hdmi snd_hda_intel mac80211 snd_hda_codec snd_usbmidi_lib irqbypass uvcvideo snd_rawmidi snd_hda_core videobuf2_vmalloc videobuf2_memops crct10dif_pclmul btusb videobuf2_v4l2 snd_hwdep crc32_pclmul btrtl videobuf2_common snd_seq eeepc_wmi btbcm xpad asus_wmi btintel snd_seq_device ghash_clmulni_intel cfg80211 sparse_keymap [21793.094426] ff_memless joydev bluetooth videodev video snd_pcm wmi_bmof mc ecdh_generic snd_timer ecc snd ccp rfkill libarc4 soundcore sp5100_tco k10temp i2c_piix4 gpio_amdpt gpio_generic acpi_cpufreq binfmt_misc ip_tables hid_logitech_hidpp hid_logitech_dj amdgpu amd_iommu_v2 gpu_sched ttm drm_kms_helper igb drm nvme dca crc32c_intel i2c_algo_bit nvme_core wmi pinctrl_amd [21793.094449] CPU: 14 PID: 1768 Comm: Xorg Tainted: GW 5.3.0-0.rc6.git2.1b.fc32.x86_64 #1 [21793.094452] Hardware name: System manufacturer System Product Name/ROG STRIX X470-I GAMING, BIOS 2406 06/21/2019 [21793.094499] RIP: 0010:amdgpu_fence_wait_empty+0x1c2/0x230 [amdgpu] [21793.094502] Code: b5 f4 e9 c1 fe ff ff 31 c0 c3 48 89 ef e8 36 69 f8 f4 84 c0 74 08 48 89 ef e8 8a e9 15 f5 48 c7 c7 2c d6 91 c0 e8 86 f8 ad f4 <0f> 0b b8 ea ff ff ff 5d c3 e8 f0 97 b7 f4 84 c0 0f 85 73 ff ff ff [21793.094505] RSP: 0018:ae13418c3798 EFLAGS: 00010282 [21793.094508] RAX: RBX: 8aa065f85a80 RCX: 0006 [21793.094511] RDX: 0007 RSI: 8a9fe32ec070 RDI: 8aa07bdd9e00 [21793.094513] RBP: 8aa069469d00 R08: 13d219a4ead6 R09: [21793.094516] R10: R11: R12: 8aa065f8 [21793.094518] R13: R14: R15: 8aa065fb [21793.094521] FS: 7f586201cf00() GS:8aa07bc0() knlGS: [21793.094524] CS: 0010 DS: ES: CR0: 80050033 [21793.094526] CR2: 7f57fc5b5000 CR3: 00076334 CR4: 003406e0 [21793.094528] Call Trace: [21793.094580] amdgpu_pm_compute_clocks+0x70/0x5f0 [amdgpu] [21793.094655] dm_pp_apply_display_requirements+0x1a8/0x1c0 [amdgpu] [21793.094728] dce12_update_clocks+0xd8/0x110 [amdgpu] [21793.094799] dc_commit_state+0x414/0x590 [amdgpu] [21793.094807] ? find_held_lock+0x32/0x90 [21793.094880] amdgpu_dm_atomic_commit_tail+0xd18/0x1cf0 [amdgpu] [21793.094888] ? reacquire_held_locks+0xed/0x210 [21793.094898] ? ttm_eu_backoff_reservation+0xa5/0x160 [ttm] [21793.094903] ? find_held_lock+0x32/0x90 [21793.094906] ? find_held_lock+0x32/0x90 [21793.094912] ? __lock_acquire+0x247/0x1910 [21793.094920] ? find_held_lock+0x32/0x90 [21793.094925] ? mark_held_locks+0x50/0x80 [21793.094929] ? _raw_spin_unlock_irq+0x29/0x40 [21793.094933] ? lockdep_hardirqs_on+0xf0/0x180 [21793.094937] ? _raw_spin_unlock_irq+0x29/0x40 [21793.094941] ? wait_for_completion_timeout+0x75/0x190 [21793.094954] ? commit_tail+0x3c/0x70 [drm_kms_helper] [21793.094962] commit_tail+0x3c/0x70 [drm_kms_helper] [21793.094971] drm_atomic_helper_commit+0xe3/0x150 [drm_kms_helper] [21793.094986] drm_mode_atomic_ioctl+0x793/0x9b0 [drm] [21793.094994] ? __lock_acquire+0x247/0x1910 [21793.095013] ? drm_atomic_set_property+0xa50/0xa50 [drm] [21793.095025] drm_ioctl_kernel+0xaa/0xf0 [drm] [21793.095039] drm_ioctl+0x208/0x390 [drm] [21793.095053] ? drm_atomic_set_property+0xa50/0xa50 [drm] [21793.095060] ? lockdep_hardirqs_on+0xf0/0x180 [21793.095108] amdgpu_drm_ioctl+0x49/0x80 [amdgpu] [21793.095114] do_vfs_ioctl+0x411/0x750 [21793.095121] ksys_ioctl+0x5e/0x90 [21793.095126] __x64_sys_ioctl+0x16/0x20 [21793.095130] do_syscall_64+0x5c/0xb0 [21793.095135] entry_SYSCALL_64_after_hwframe+0x49/0xbe [21793.095138] RIP: 0033:0x7f586249300b [21793.095142] Code: 0f 1e fa 48 8b 05 7d 9e 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 4d 9e 0c 00 f7 d8 64 8
Re: [pull] amdgpu drm-next-5.4
On Sat, 31 Aug 2019 at 07:27, Alex Deucher wrote: > > Hi Dave, Daniel, > > Mostly bug fixes. The big addition is display support for renoir > which is new for 5.4. I realize it's a bit late to add it but the > rest of the code for renoir is already in so it would be nice to > get the display part in as well. If not, let me know, and I'll > respin without it. Thanks! dim: c072b0c24e6b ("drm/amdgpu: fix GFXOFF on Picasso and Raven2"): Fixes: SHA1 in not pointing at an ancestor: dim: 98f58ada2d37 ("drm/amdgpu/gfx9: update pg_flags after determining if gfx off is possible") dim: ERROR: issues in commits detected, aborting b05f65d7720b172b6fde3abfa49ed66837071d45 seems to be the correct ancestor in my tree. No problems on the renoir code. Dave. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 4/5] drm/qxl: use drm_gem_object_funcs callbacks
On Mon, Sep 02, 2019 at 04:34:49PM +0200, Thomas Zimmermann wrote: > This patch seems unrelated. Well, patch 5/5 depends on it because it hooks the drm_gem_ttm_print_info helper into the new qxl_object_funcs added by this patch. > Am 02.09.19 um 14:41 schrieb Gerd Hoffmann: > > Switch qxl to use drm_gem_object_funcs callbacks > > instead of drm_driver callbacks. > > > > Signed-off-by: Gerd Hoffmann > > --- > > drivers/gpu/drm/qxl/qxl_drv.c| 8 > > drivers/gpu/drm/qxl/qxl_object.c | 12 > > 2 files changed, 12 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c > > index 2b726a51a302..996d428fa7e6 100644 > > --- a/drivers/gpu/drm/qxl/qxl_drv.c > > +++ b/drivers/gpu/drm/qxl/qxl_drv.c > > @@ -258,16 +258,8 @@ static struct drm_driver qxl_driver = { > > #endif > > .prime_handle_to_fd = drm_gem_prime_handle_to_fd, > > .prime_fd_to_handle = drm_gem_prime_fd_to_handle, > > - .gem_prime_pin = qxl_gem_prime_pin, > > - .gem_prime_unpin = qxl_gem_prime_unpin, > > - .gem_prime_get_sg_table = qxl_gem_prime_get_sg_table, > > .gem_prime_import_sg_table = qxl_gem_prime_import_sg_table, > > - .gem_prime_vmap = qxl_gem_prime_vmap, > > - .gem_prime_vunmap = qxl_gem_prime_vunmap, > > .gem_prime_mmap = qxl_gem_prime_mmap, > > - .gem_free_object_unlocked = qxl_gem_object_free, > > - .gem_open_object = qxl_gem_object_open, > > - .gem_close_object = qxl_gem_object_close, > > .fops = &qxl_fops, > > .ioctls = qxl_ioctls, > > .irq_handler = qxl_irq_handler, > > diff --git a/drivers/gpu/drm/qxl/qxl_object.c > > b/drivers/gpu/drm/qxl/qxl_object.c > > index 548dfe6f3b26..29aab7b14513 100644 > > --- a/drivers/gpu/drm/qxl/qxl_object.c > > +++ b/drivers/gpu/drm/qxl/qxl_object.c > > @@ -77,6 +77,17 @@ void qxl_ttm_placement_from_domain(struct qxl_bo *qbo, > > u32 domain, bool pinned) > > } > > } > > > > +static const struct drm_gem_object_funcs qxl_object_funcs = { > > + .free = qxl_gem_object_free, > > + .open = qxl_gem_object_open, > > + .close = qxl_gem_object_close, > > + .pin = qxl_gem_prime_pin, > > + .unpin = qxl_gem_prime_unpin, > > + .get_sg_table = qxl_gem_prime_get_sg_table, > > + .vmap = qxl_gem_prime_vmap, > > + .vunmap = qxl_gem_prime_vunmap, > > +}; > > + > > int qxl_bo_create(struct qxl_device *qdev, > > unsigned long size, bool kernel, bool pinned, u32 domain, > > struct qxl_surface *surf, > > @@ -100,6 +111,7 @@ int qxl_bo_create(struct qxl_device *qdev, > > kfree(bo); > > return r; > > } > > + bo->tbo.base.funcs = &qxl_object_funcs; > > bo->type = domain; > > bo->pin_count = pinned ? 1 : 0; > > bo->surface_id = 0; > > > > -- > Thomas Zimmermann > Graphics Driver Developer > SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany > GF: Felix Imendörffer, Mary Higgins, Sri Rasiah > HRB 21284 (AG Nürnberg) > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/5] drm/vram: add vram-mm debugfs file
Hi, > > +++ b/include/drm/drm_gem_vram_helper.h > > @@ -123,6 +123,7 @@ int drm_gem_vram_driver_dumb_mmap_offset(struct > > drm_file *file, > > * &struct drm_driver with default functions. > > */ > > #define DRM_GEM_VRAM_DRIVER \ > > + .debugfs_init = drm_vram_mm_debugfs_init, \ > > > +int drm_vram_mm_debugfs_init(struct drm_minor *minor); > > I cannot find a caller of this function. Will this be called form > drm_debugfs_init()? Yes, via drm_driver->debugfs_init which is set above. cheers, Gerd
Re: [PATCH 2/5] drm/vram: use drm_gem_ttm_print_info
Hi, > > @@ -169,6 +169,7 @@ config DRM_VRAM_HELPER > > tristate > > depends on DRM > > select DRM_TTM > > + select DRM_TTM_HELPER > > I thought that VRAM helpers already depend on TTM helpers. No, they don't. Patch #1 adds them ;) cheers, Gerd ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/5] drm/ttm: add drm_gem_ttm_print_info()
Hi, > > + [ TTM_PL_SYSTEM ] = "system", > > + [ TTM_PL_TT ] = "tt", > > + [ TTM_PL_VRAM ] = "vram", > > + [ TTM_PL_PRIV ] = "priv", > > + > > This 'gap' in the array seems to be a problem for drivers that use these > bits. Could the print logic be moved into s separate function that also > takes the array as an argument? Are there any drivers which actually use these bits and which therefore might want to use a different array? Also note they should not cause any problems (other than not being printed). There is an explicit check here ... > > + if (!plname[i]) > > + continue; .. to skip unknown bits. cheers, Gerd
[PATCH] drm: bridge/dw_hdmi: add audio sample channel status setting
From: Yakir Yang When transmitting IEC60985 linear PCM audio, we configure the Audio Sample Channel Status information of all the channel status bits in the IEC60958 frame. Refer to 60958-3 page 10 for frequency, original frequency, and wordlength setting. This fix the issue that audio does not come out on some monitors (e.g. LG 22CV241) Signed-off-by: Yakir Yang Signed-off-by: Cheng-Yi Chiang --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 59 +++ drivers/gpu/drm/bridge/synopsys/dw-hdmi.h | 20 2 files changed, 79 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index bd65d0479683..34d46e25d610 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -582,6 +582,63 @@ static unsigned int hdmi_compute_n(unsigned int freq, unsigned long pixel_clk) return n; } +static void hdmi_set_schnl(struct dw_hdmi *hdmi) +{ + u8 aud_schnl_samplerate; + u8 aud_schnl_8; + + /* These registers are on RK3288 using version 2.0a. */ + if (hdmi->version != 0x200a) + return; + + switch (hdmi->sample_rate) { + case 32000: + aud_schnl_samplerate = HDMI_FC_AUDSCHNLS7_SMPRATE_32K; + break; + case 44100: + aud_schnl_samplerate = HDMI_FC_AUDSCHNLS7_SMPRATE_44K1; + break; + case 48000: + aud_schnl_samplerate = HDMI_FC_AUDSCHNLS7_SMPRATE_48K; + break; + case 88200: + aud_schnl_samplerate = HDMI_FC_AUDSCHNLS7_SMPRATE_88K2; + break; + case 96000: + aud_schnl_samplerate = HDMI_FC_AUDSCHNLS7_SMPRATE_96K; + break; + case 176400: + aud_schnl_samplerate = HDMI_FC_AUDSCHNLS7_SMPRATE_176K4; + break; + case 192000: + aud_schnl_samplerate = HDMI_FC_AUDSCHNLS7_SMPRATE_192K; + break; + case 768000: + aud_schnl_samplerate = HDMI_FC_AUDSCHNLS7_SMPRATE_768K; + break; + default: + dev_warn(hdmi->dev, "Unsupported audio sample rate (%u)\n", +hdmi->sample_rate); + return; + } + + /* set channel status register */ + hdmi_modb(hdmi, aud_schnl_samplerate, HDMI_FC_AUDSCHNLS7_SMPRATE_MASK, + HDMI_FC_AUDSCHNLS7); + + /* +* Set original frequency to be the same as frequency. +* Use one-complement value as stated in IEC60958-3 page 13. +*/ + aud_schnl_8 = (~aud_schnl_samplerate) << + HDMI_FC_AUDSCHNLS8_ORIGSAMPFREQ_OFFSET; + + /* This means word length is 16 bit. Refer to IEC60958-3 page 12. */ + aud_schnl_8 |= 2 << HDMI_FC_AUDSCHNLS8_WORDLEGNTH_OFFSET; + + hdmi_writeb(hdmi, aud_schnl_8, HDMI_FC_AUDSCHNLS8); +} + static void hdmi_set_clk_regenerator(struct dw_hdmi *hdmi, unsigned long pixel_clk, unsigned int sample_rate) { @@ -620,6 +677,8 @@ static void hdmi_set_clk_regenerator(struct dw_hdmi *hdmi, hdmi->audio_cts = cts; hdmi_set_cts_n(hdmi, cts, hdmi->audio_enable ? n : 0); spin_unlock_irq(&hdmi->audio_lock); + + hdmi_set_schnl(hdmi); } static void hdmi_init_clk_regenerator(struct dw_hdmi *hdmi) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h index 6988f12d89d9..619ebc1c8354 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h @@ -158,6 +158,17 @@ #define HDMI_FC_SPDDEVICEINF0x1062 #define HDMI_FC_AUDSCONF0x1063 #define HDMI_FC_AUDSSTAT0x1064 +#define HDMI_FC_AUDSV 0x1065 +#define HDMI_FC_AUDSU 0x1066 +#define HDMI_FC_AUDSCHNLS0 0x1067 +#define HDMI_FC_AUDSCHNLS1 0x1068 +#define HDMI_FC_AUDSCHNLS2 0x1069 +#define HDMI_FC_AUDSCHNLS3 0x106a +#define HDMI_FC_AUDSCHNLS4 0x106b +#define HDMI_FC_AUDSCHNLS5 0x106c +#define HDMI_FC_AUDSCHNLS6 0x106d +#define HDMI_FC_AUDSCHNLS7 0x106e +#define HDMI_FC_AUDSCHNLS8 0x106f #define HDMI_FC_DATACH0FILL 0x1070 #define HDMI_FC_DATACH1FILL 0x1071 #define HDMI_FC_DATACH2FILL 0x1072 @@ -706,6 +717,15 @@ enum { /* HDMI_FC_AUDSCHNLS7 field values */ HDMI_FC_AUDSCHNLS7_ACCURACY_OFFSET = 4, HDMI_FC_AUDSCHNLS7_ACCURACY_MASK = 0x30, + HDMI_FC_AUDSCHNLS7_SMPRATE_MASK = 0x0f, + HDMI_FC_AUDSCHNLS7_SMPRATE_192K = 0xe, + HDMI_FC_AUDSCHNLS7_SMPRATE_176K4 = 0xc, + HDMI_FC_AUDSCHNLS7_SMPRATE_96K = 0xa, + HDMI_FC_AUDSCHNLS7_SMPRATE_768K = 0x9, +
[PATCH v3 2/7] drm/i915/dp: Add support of BT.2020 Colorimetry to DP MSA
When BT.2020 Colorimetry output is used for DP, we should program BT.2020 Colorimetry to MSA and VSC SDP. It adds output_colorspace to intel_crtc_state struct as a place holder of pipe's output colorspace. In order to distinguish needed colorimetry for VSC SDP, it adds intel_dp_needs_vsc_sdp function. If the output colorspace requires vsc sdp or output format is YCbCr 4:2:0, it uses MSA with VSC SDP. As per DP 1.4a spec section 2.2.4.3 [MSA Field for Indication of Color Encoding Format and Content Color Gamut] while sending BT.2020 Colorimetry signals we should program MSA MISC1 fields which indicate VSC SDP for the Pixel Encoding/Colorimetry Format. v2: Remove useless parentheses v3: Addressed review comments from Ville - In order to checking output format and output colorspace on intel_dp_needs_vsc_sdp(), it passes entire intel_crtc_state stucture. - Remove a pointless variable. Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar --- drivers/gpu/drm/i915/display/intel_ddi.c | 7 +++-- .../drm/i915/display/intel_display_types.h| 3 ++ drivers/gpu/drm/i915/display/intel_dp.c | 29 ++- drivers/gpu/drm/i915/display/intel_dp.h | 1 + 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index 49c35af583f9..87dc5a19cb7b 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -1737,11 +1737,12 @@ void intel_ddi_set_pipe_settings(const struct intel_crtc_state *crtc_state) /* * As per DP 1.4a spec section 2.2.4.3 [MSA Field for Indication * of Color Encoding Format and Content Color Gamut] while sending -* YCBCR 420 signals we should program MSA MISC1 fields which -* indicate VSC SDP for the Pixel Encoding/Colorimetry Format. +* YCBCR 420, HDR BT.2020 signals we should program MSA MISC1 fields +* which indicate VSC SDP for the Pixel Encoding/Colorimetry Format. */ - if (crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) + if (intel_dp_needs_vsc_sdp(crtc_state)) temp |= TRANS_MSA_USE_VSC_SDP; + I915_WRITE(TRANS_MSA_MISC(cpu_transcoder), temp); } diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 61277a87dbe7..c62bad369c8e 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -971,6 +971,9 @@ struct intel_crtc_state { /* Output format RGB/YCBCR etc */ enum intel_output_format output_format; + /* Output colorspace sRGB/BT.2020 etc */ + u32 output_colorspace; + /* Output down scaling is done in LSPCON device */ bool lspcon_downsampling; diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 776be3e16ac6..6b7587c71e49 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -2187,6 +2187,8 @@ intel_dp_compute_config(struct intel_encoder *encoder, pipe_config->has_pch_encoder = true; pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; + pipe_config->output_colorspace = intel_conn_state->base.colorspace; + if (lspcon->active) lspcon_ycbcr420_config(&intel_connector->base, pipe_config); else @@ -4445,6 +4447,31 @@ u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp, return 0; } +bool +intel_dp_needs_vsc_sdp(const struct intel_crtc_state *crtc_state) +{ + /* +* As per DP 1.4a spec section 2.2.4.3 [MSA Field for Indication +* of Color Encoding Format and Content Color Gamut], in order to +* sending YCBCR 420 or HDR BT.2020 signals we should use DP VSC SDP. +*/ + if (crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) + return true; + + switch (crtc_state->output_colorspace) { + case DRM_MODE_COLORIMETRY_SYCC_601: + case DRM_MODE_COLORIMETRY_OPYCC_601: + case DRM_MODE_COLORIMETRY_BT2020_YCC: + case DRM_MODE_COLORIMETRY_BT2020_RGB: + case DRM_MODE_COLORIMETRY_BT2020_CYCC: + return true; + default: + break; + } + + return false; +} + static void intel_dp_setup_vsc_sdp(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state, @@ -4573,7 +4600,7 @@ void intel_dp_vsc_enable(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_YCBCR420) + if (!intel_dp_needs_vsc_sdp(crtc_state)) return; intel_dp_setup_vsc_sdp(intel_dp, crtc_state, conn_state); diff --git a/drivers/gpu/
[PATCH v3 6/7] drm/i915/dp: Program an Infoframe SDP Header and DB for HDR Static Metadata
Function intel_dp_setup_hdr_metadata_infoframe_sdp handles Infoframe SDP header and data block setup for HDR Static Metadata. It enables writing of HDR metadata infoframe SDP to panel. Support for HDR video was introduced in DisplayPort 1.4. It implements the CTA-861-G standard for transport of static HDR metadata. The HDR Metadata will be provided by userspace compositors, based on blending policies and passed to the driver through a blob property. Because each of GEN11 and prior GEN11 have different register size for HDR Metadata Infoframe SDP packet, it adds and uses different register size. Setup Infoframe SDP header and data block in function intel_dp_setup_hdr_metadata_infoframe_sdp for HDR Static Metadata as per dp 1.4 spec and CTA-861-F spec. As per DP 1.4 spec, 2.2.2.5 SDP Formats. It enables Dynamic Range and Mastering Infoframe for HDR content, which is defined in CTA-861-F spec. According to DP 1.4 spec and CEA-861-F spec Table 5, in order to transmit static HDR metadata, we have to use Non-audio INFOFRAME SDP v1.3. ++---+ | [ Packet Type Value ] | [ Packet Type ] | ++---+ | 80h + Non-audio INFOFRAME Type | CEA-861-F Non-audio INFOFRAME | ++---+ | [Transmission Timing] | ++ | As per CEA-861-F for INFOFRAME, including CEA-861.3 within | | which Dynamic Range and Mastering INFOFRAME are defined| ++ v2: Add a missed blank line after function declaration. v3: Remove not handled return values from intel_dp_setup_hdr_metadata_infoframe_sdp(). [Uma] Signed-off-by: Gwan-gyeong Mun --- drivers/gpu/drm/i915/display/intel_ddi.c | 1 + drivers/gpu/drm/i915/display/intel_dp.c | 89 drivers/gpu/drm/i915/display/intel_dp.h | 3 + 3 files changed, 93 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index 87dc5a19cb7b..111a5c95be85 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -3612,6 +3612,7 @@ static void intel_enable_ddi_dp(struct intel_encoder *encoder, intel_edp_backlight_on(crtc_state, conn_state); intel_psr_enable(intel_dp, crtc_state); intel_dp_vsc_enable(intel_dp, crtc_state, conn_state); + intel_dp_hdr_metadata_enable(intel_dp, crtc_state, conn_state); intel_edp_drrs_enable(intel_dp, crtc_state); if (crtc_state->has_audio) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 9fa107d720ee..7fcc9f28d2e7 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -4596,6 +4596,83 @@ intel_dp_setup_vsc_sdp(struct intel_dp *intel_dp, crtc_state, DP_SDP_VSC, &vsc_sdp, sizeof(vsc_sdp)); } +static void +intel_dp_setup_hdr_metadata_infoframe_sdp(struct intel_dp *intel_dp, + const struct intel_crtc_state *crtc_state, + const struct drm_connector_state *conn_state) +{ + struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); + struct drm_i915_private *dev_priv = to_i915(intel_dig_port->base.base.dev); + struct dp_sdp infoframe_sdp = {}; + struct hdmi_drm_infoframe drm_infoframe = {}; + const int infoframe_size = HDMI_INFOFRAME_HEADER_SIZE + HDMI_DRM_INFOFRAME_SIZE; + unsigned char buf[HDMI_INFOFRAME_HEADER_SIZE + HDMI_DRM_INFOFRAME_SIZE]; + ssize_t len; + int ret; + + ret = drm_hdmi_infoframe_set_hdr_metadata(&drm_infoframe, conn_state); + if (ret) { + DRM_DEBUG_KMS("couldn't set HDR metadata in infoframe\n"); + return; + } + + len = hdmi_drm_infoframe_pack_only(&drm_infoframe, buf, sizeof(buf)); + if (len < 0) { + DRM_DEBUG_KMS("buffer size is smaller than hdr metadata infoframe\n"); + return; + } + + if (len != infoframe_size) { + DRM_DEBUG_KMS("wrong static hdr metadata size\n"); + return; + } + + /* +* Set up the infoframe sdp packet for HDR static metadata. +* Prepare VSC Header for SU as per DP 1.4a spec, +* Table 2-100 and Table 2-101 +*/ + + /* Packet ID, 00h for non-Audio INFOFRAME */ + infoframe_sdp.sdp_header.HB0 = 0; + /* +* Packet Type 80h + Non-audio INFOFRAME Type value +* HDMI_INFOFRAME_TYPE_DRM: 0x87, +*/ + infoframe_sdp.sdp_header.HB1 = drm_infoframe.type; + /* +* Least Significant Eight Bits of (Data Byte Count – 1) +
[PATCH v3 5/7] drm/i915: Add new GMP register size for GEN11
According to Bspec, GEN11 and prior GEN11 have different register size for HDR Metadata Infoframe SDP packet. It adds new VIDEO_DIP_GMP_DATA_SIZE for GEN11. And it makes handle different register size for HDMI_PACKET_TYPE_GAMUT_METADATA on hsw_dip_data_size() for each GEN platforms. It addresses Uma's review comments. Signed-off-by: Gwan-gyeong Mun --- drivers/gpu/drm/i915/display/intel_hdmi.c | 10 -- drivers/gpu/drm/i915/i915_reg.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index c500fc9154c8..287999b31217 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -189,13 +189,19 @@ hsw_dip_data_reg(struct drm_i915_private *dev_priv, } } -static int hsw_dip_data_size(unsigned int type) +static int hsw_dip_data_size(struct drm_i915_private *dev_priv, +unsigned int type) { switch (type) { case DP_SDP_VSC: return VIDEO_DIP_VSC_DATA_SIZE; case DP_SDP_PPS: return VIDEO_DIP_PPS_DATA_SIZE; + case HDMI_PACKET_TYPE_GAMUT_METADATA: + if (INTEL_GEN(dev_priv) >= 11) + return VIDEO_DIP_GMP_DATA_SIZE; + else + return VIDEO_DIP_DATA_SIZE; default: return VIDEO_DIP_DATA_SIZE; } @@ -514,7 +520,7 @@ static void hsw_write_infoframe(struct intel_encoder *encoder, int i; u32 val = I915_READ(ctl_reg); - data_size = hsw_dip_data_size(type); + data_size = hsw_dip_data_size(dev_priv, type); val &= ~hsw_infoframe_enable(type); I915_WRITE(ctl_reg, val); diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 6c43b8c583bb..8b31ad7426d6 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -4667,6 +4667,7 @@ enum { * (Haswell and newer) to see which VIDEO_DIP_DATA byte corresponds to each byte * of the infoframe structure specified by CEA-861. */ #define VIDEO_DIP_DATA_SIZE 32 +#define VIDEO_DIP_GMP_DATA_SIZE 36 #define VIDEO_DIP_VSC_DATA_SIZE 36 #define VIDEO_DIP_PPS_DATA_SIZE 132 #define VIDEO_DIP_CTL _MMIO(0x61170) -- 2.23.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3 7/7] drm/i915/dp: Attach HDR metadata property to DP connector
It attaches HDR metadata property to DP connector on GLK+. It enables HDR metadata infoframe sdp on GLK+ to be used to send HDR metadata to DP sink. v2: Minor style fix Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar --- drivers/gpu/drm/i915/display/intel_dp.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 7fcc9f28d2e7..2466d7aff670 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -6536,6 +6536,11 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect intel_attach_colorspace_property(connector); + if (IS_GEMINILAKE(dev_priv) || INTEL_GEN(dev_priv) >= 11) + drm_object_attach_property(&connector->base, + connector->dev->mode_config.hdr_output_metadata_property, + 0); + if (intel_dp_is_edp(intel_dp)) { u32 allowed_scalers; -- 2.23.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3 4/7] drm/i915/dp: Attach colorspace property
It attaches the colorspace connector property to a DisplayPort connector. Based on colorspace change, modeset will be triggered to switch to a new colorspace. Based on colorspace property value create a VSC SDP packet with appropriate colorspace. This would help to enable wider color gamut like BT2020 on a sink device. Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar --- drivers/gpu/drm/i915/display/intel_dp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 6b7587c71e49..9fa107d720ee 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -6445,6 +6445,8 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect else if (INTEL_GEN(dev_priv) >= 5) drm_connector_attach_max_bpc_property(connector, 6, 12); + intel_attach_colorspace_property(connector); + if (intel_dp_is_edp(intel_dp)) { u32 allowed_scalers; -- 2.23.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3 3/7] drm: Add DisplayPort colorspace property
In order to use colorspace property to Display Port connectors, it extends DRM_MODE_CONNECTOR_DisplayPort connector_type on drm_mode_create_colorspace_property function. v3: Addressed review comments from Ville - Add new colorimetry options for DP 1.4a spec. - Separate set of colorimetry enum values for DP. Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar --- drivers/gpu/drm/drm_connector.c | 43 + include/drm/drm_connector.h | 8 ++ 2 files changed, 51 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 4c766624b20d..013cf96e3012 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -882,6 +882,41 @@ static const struct drm_prop_enum_list hdmi_colorspaces[] = { { DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER, "DCI-P3_RGB_Theater" }, }; +/* + * As per DP 1.4a spec, 2.2.5.7.5 VSC SDP Payload for Pixel Encoding/Colorimetry + * Format Table 2-120 + */ +static const struct drm_prop_enum_list dp_colorspaces[] = { + /* For Default case, driver will set the colorspace */ + { DRM_MODE_COLORIMETRY_DEFAULT, "Default" }, + /* Colorimetry based on IEC 61966-2-1 */ + { DRM_MODE_COLORIMETRY_SRGB, "sRGB" }, + { DRM_MODE_COLORIMETRY_WIDE_GAMUT_FIXED_POINT_RGB, "RGB_wide_gamut_fixed_point" }, + /* Colorimetry based on IEC 61966-2-2 */ + { DRM_MODE_COLORIMETRY_SCRGB, "scRGB" }, + { DRM_MODE_COLORIMETRY_ADOBE_RGB, "Adobe_RGB" }, + /* Colorimetry based on SMPTE RP 431-2 */ + { DRM_MODE_COLORIMETRY_DCP_P3_RGB, "DCI-P3_RGB" }, + /* Colorimetry based on ITU-R BT.2020 */ + { DRM_MODE_COLORIMETRY_BT2020_RGB, "BT2020_RGB" }, + { DRM_MODE_COLORIMETRY_BT601_YCC, "BT601_YCC" }, + { DRM_MODE_COLORIMETRY_BT709_YCC, "BT709_YCC" }, + /* Standard Definition Colorimetry based on IEC 61966-2-4 */ + { DRM_MODE_COLORIMETRY_XVYCC_601, "XVYCC_601" }, + /* High Definition Colorimetry based on IEC 61966-2-4 */ + { DRM_MODE_COLORIMETRY_XVYCC_709, "XVYCC_709" }, + /* Colorimetry based on IEC 61966-2-1/Amendment 1 */ + { DRM_MODE_COLORIMETRY_SYCC_601, "SYCC_601" }, + /* Colorimetry based on IEC 61966-2-5 [33] */ + { DRM_MODE_COLORIMETRY_OPYCC_601, "opYCC_601" }, + /* Colorimetry based on ITU-R BT.2020 */ + { DRM_MODE_COLORIMETRY_BT2020_CYCC, "BT2020_CYCC" }, + /* Colorimetry based on ITU-R BT.2020 */ + { DRM_MODE_COLORIMETRY_BT2020_YCC, "BT2020_YCC" }, + /* Colorumetry for Y Only */ + { DRM_MODE_COLORIMETRY_DICOM_PART_14_GRAYSCALE, "DICOM_Part_14_Grayscale_Display_Function" }, +}; + /** * DOC: standard connector properties * @@ -1710,6 +1745,14 @@ int drm_mode_create_colorspace_property(struct drm_connector *connector) ARRAY_SIZE(hdmi_colorspaces)); if (!prop) return -ENOMEM; + } else if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort || + connector->connector_type == DRM_MODE_CONNECTOR_eDP) { + prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, + "Colorspace", + dp_colorspaces, + ARRAY_SIZE(dp_colorspaces)); + if (!prop) + return -ENOMEM; } else { DRM_DEBUG_KMS("Colorspace property not supported\n"); return 0; diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 681cb590f952..8848e5d6b0c4 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -281,6 +281,14 @@ enum drm_panel_orientation { /* Additional Colorimetry extension added as part of CTA 861.G */ #define DRM_MODE_COLORIMETRY_DCI_P3_RGB_D6511 #define DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER12 +/* Additional Colorimetry Options added for DP 1.4a VSC Colorimetry Format */ +#define DRM_MODE_COLORIMETRY_SRGB 13 +#define DRM_MODE_COLORIMETRY_WIDE_GAMUT_FIXED_POINT_RGB14 +#define DRM_MODE_COLORIMETRY_SCRGB 15 +#define DRM_MODE_COLORIMETRY_ADOBE_RGB 16 +#define DRM_MODE_COLORIMETRY_DCP_P3_RGB17 +#define DRM_MODE_COLORIMETRY_BT601_YCC 18 +#define DRM_MODE_COLORIMETRY_DICOM_PART_14_GRAYSCALE 19 /** * enum drm_bus_flags - bus_flags info for &drm_display_info -- 2.23.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3 1/7] drm/i915/dp: Extend program of VSC Header and DB for Colorimetry Format
It refactors and renames a function which handled vsc sdp header and data block setup for supporting colorimetry format. Function intel_dp_setup_vsc_sdp handles vsc sdp header and data block setup for pixel encoding / colorimetry format. In order to use colorspace information of a connector, it adds an argument of drm_connector_state type. Setup VSC header and data block in function intel_dp_setup_vsc_sdp for pixel encoding / colorimetry format as per dp 1.4a spec, section 2.2.5.7.1, table 2-119: VSC SDP Header Bytes, section 2.2.5.7.5, table 2-120: VSC SDP Payload for DB16 through DB18. Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar --- drivers/gpu/drm/i915/display/intel_ddi.c | 2 +- drivers/gpu/drm/i915/display/intel_display.h | 2 - drivers/gpu/drm/i915/display/intel_dp.c | 68 drivers/gpu/drm/i915/display/intel_dp.h | 3 + 4 files changed, 60 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index 1fe0bf01e580..49c35af583f9 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -3610,7 +3610,7 @@ static void intel_enable_ddi_dp(struct intel_encoder *encoder, intel_edp_backlight_on(crtc_state, conn_state); intel_psr_enable(intel_dp, crtc_state); - intel_dp_ycbcr_420_enable(intel_dp, crtc_state); + intel_dp_vsc_enable(intel_dp, crtc_state, conn_state); intel_edp_drrs_enable(intel_dp, crtc_state); if (crtc_state->has_audio) diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h index 33fd523c4622..8de63be75620 100644 --- a/drivers/gpu/drm/i915/display/intel_display.h +++ b/drivers/gpu/drm/i915/display/intel_display.h @@ -526,8 +526,6 @@ void intel_dp_get_m_n(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config); void intel_dp_set_m_n(const struct intel_crtc_state *crtc_state, enum link_m_n_set m_n); -void intel_dp_ycbcr_420_enable(struct intel_dp *intel_dp, - const struct intel_crtc_state *crtc_state); int intel_dotclock_calculate(int link_freq, const struct intel_link_m_n *m_n); bool bxt_find_best_dpll(struct intel_crtc_state *crtc_state, struct dpll *best_clock); diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 5673ed75e428..776be3e16ac6 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -4446,8 +4446,9 @@ u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp, } static void -intel_pixel_encoding_setup_vsc(struct intel_dp *intel_dp, - const struct intel_crtc_state *crtc_state) +intel_dp_setup_vsc_sdp(struct intel_dp *intel_dp, + const struct intel_crtc_state *crtc_state, + const struct drm_connector_state *conn_state) { struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); struct dp_sdp vsc_sdp = {}; @@ -4468,13 +4469,55 @@ intel_pixel_encoding_setup_vsc(struct intel_dp *intel_dp, */ vsc_sdp.sdp_header.HB3 = 0x13; - /* -* YCbCr 420 = 3h DB16[7:4] ITU-R BT.601 = 0h, ITU-R BT.709 = 1h -* DB16[3:0] DP 1.4a spec, Table 2-120 -*/ - vsc_sdp.db[16] = 0x3 << 4; /* 0x3 << 4 , YCbCr 420*/ - /* RGB->YCBCR color conversion uses the BT.709 color space. */ - vsc_sdp.db[16] |= 0x1; /* 0x1, ITU-R BT.709 */ + /* DP 1.4a spec, Table 2-120 */ + switch (crtc_state->output_format) { + case INTEL_OUTPUT_FORMAT_YCBCR444: + vsc_sdp.db[16] = 0x1 << 4; /* YCbCr 444 : DB16[7:4] = 1h */ + break; + case INTEL_OUTPUT_FORMAT_YCBCR420: + vsc_sdp.db[16] = 0x3 << 4; /* YCbCr 420 : DB16[7:4] = 3h */ + break; + case INTEL_OUTPUT_FORMAT_RGB: + default: + /* RGB: DB16[7:4] = 0h */ + break; + } + + switch (conn_state->colorspace) { + case DRM_MODE_COLORIMETRY_BT709_YCC: + vsc_sdp.db[16] |= 0x1; + break; + case DRM_MODE_COLORIMETRY_XVYCC_601: + vsc_sdp.db[16] |= 0x2; + break; + case DRM_MODE_COLORIMETRY_XVYCC_709: + vsc_sdp.db[16] |= 0x3; + break; + case DRM_MODE_COLORIMETRY_SYCC_601: + vsc_sdp.db[16] |= 0x4; + break; + case DRM_MODE_COLORIMETRY_OPYCC_601: + vsc_sdp.db[16] |= 0x5; + break; + case DRM_MODE_COLORIMETRY_BT2020_CYCC: + case DRM_MODE_COLORIMETRY_BT2020_RGB: + vsc_sdp.db[16] |= 0x6; + break; + case DRM_MODE_COLORIMETRY_BT2020_YCC: + vsc_sdp.db[16] |= 0x7; + break; + case DRM_MODE_COLORIMETRY_DCI_
[PATCH v3 0/6] drm/i915/dp: Support for DP HDR outputs
Support for HDR10 video was introduced in DisplayPort 1.4. On GLK+ platform, in order to use DisplayPort HDR10, we need to support BT.2020 colorimetry and HDR Static metadata. It implements the CTA-861-G standard for transport of static HDR metadata. It enables writing of HDR metadata infoframe SDP to the panel. The HDR Metadata will be provided by userspace compositors, based on blending policies and passed to the driver through a blob property. And It refactors, renames and extends a function which handled vsc sdp header and data block setup for supporting colorimetry format. And It attaches the colorspace connector property and HDR metadata property to a DisplayPort connector. These patches tested on below test environment. Test Environment: - Tested System: GLK and Gen11 platform. - Monitor: Dell UP2718Q 4K HDR Monitor. - In order to test DP HDR10, test environment uses patched Kodi-gbm, patched Media driver and HDR10 video. You can find these on below. [patched Kodi-gbm] - repo: https://github.com/Kwiboo/xbmc/tree/drmprime-hdr [download 4K HDR video file] - link: https://4kmedia.org/lg-new-york-hdr-uhd-4k-demo/ [Media Driver for GLK] - repo https://gitlab.freedesktop.org/emersion/intel-vaapi-driver master branch [Media Driver for ICL] - repo: https://github.com/harishkrupo/media-driver/tree/p010_composite v2: - Add a missed blank line after function declaration. - Remove useless parentheses. - Minor style fix. v3: - Remove not handled return values from intel_dp_setup_hdr_metadata_infoframe_sdp(). [Uma] - Add handling of different register size for HDMI_PACKET_TYPE_GAMUT_METADATA on hsw_dip_data_size() for each GEN platforms [Uma] - Add new colorimetry options for DP 1.4a spec. [Ville] - Separate set of colorimetry enum values for DP. [Ville] - In order to checking output format and output colorspace on intel_dp_needs_vsc_sdp(), it passes entire intel_crtc_state stucture.[Ville] - Remove a pointless variable. [Ville] Gwan-gyeong Mun (7): drm/i915/dp: Extend program of VSC Header and DB for Colorimetry Format drm/i915/dp: Add support of BT.2020 Colorimetry to DP MSA drm: Add DisplayPort colorspace property drm/i915/dp: Attach colorspace property drm/i915: Add new GMP register size for GEN11 drm/i915/dp: Program an Infoframe SDP Header and DB for HDR Static Metadata drm/i915/dp: Attach HDR metadata property to DP connector drivers/gpu/drm/drm_connector.c | 43 drivers/gpu/drm/i915/display/intel_ddi.c | 10 +- drivers/gpu/drm/i915/display/intel_display.h | 2 - .../drm/i915/display/intel_display_types.h| 3 + drivers/gpu/drm/i915/display/intel_dp.c | 193 -- drivers/gpu/drm/i915/display/intel_dp.h | 7 + drivers/gpu/drm/i915/display/intel_hdmi.c | 10 +- drivers/gpu/drm/i915/i915_reg.h | 1 + include/drm/drm_connector.h | 8 + 9 files changed, 256 insertions(+), 21 deletions(-) -- 2.23.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 5/6] drm/i915/dp: Program an Infoframe SDP Header and DB for HDR Static Metadata
On Tue, 2019-08-27 at 01:14 +0530, Shankar, Uma wrote: > > -Original Message- > > From: Mun, Gwan-gyeong > > Sent: Friday, August 23, 2019 3:23 PM > > To: intel-...@lists.freedesktop.org > > Cc: dri-devel@lists.freedesktop.org; Shankar, Uma < > > uma.shan...@intel.com>; > > Sharma, Shashank > > Subject: [PATCH v2 5/6] drm/i915/dp: Program an Infoframe SDP > > Header and DB for > > HDR Static Metadata > > > > Function intel_dp_setup_hdr_metadata_infoframe_sdp handles > > Infoframe SDP > > header and data block setup for HDR Static Metadata. It enables > > writing of HDR > > metadata infoframe SDP to panel. Support for HDR video was > > introduced in > > DisplayPort 1.4. It implements the CTA-861-G standard for transport > > of static HDR > > metadata. The HDR Metadata will be provided by userspace > > compositors, based on > > blending policies and passed to the driver through a blob property. > > > > Because each of GEN11 and prior GEN11 have different register size > > for HDR > > Metadata Infoframe SDP packet, it adds and uses different register > > size. > > > > Setup Infoframe SDP header and data block in function > > intel_dp_setup_hdr_metadata_infoframe_sdp for HDR Static Metadata > > as per dp 1.4 > > spec and CTA-861-F spec. > > As per DP 1.4 spec, 2.2.2.5 SDP Formats. It enables Dynamic Range > > and Mastering > > Infoframe for HDR content, which is defined in CTA-861-F spec. > > According to DP 1.4 spec and CEA-861-F spec Table 5, in order to > > transmit static HDR > > metadata, we have to use Non-audio INFOFRAME SDP v1.3. > > > > ++---+ > > > [ Packet Type Value ] | [ Packet Type ] | > > ++---+ > > > 80h + Non-audio INFOFRAME Type | CEA-861-F Non-audio INFOFRAME | > > ++---+ > > > [Transmission Timing] | > > ++ > > > As per CEA-861-F for INFOFRAME, including CEA-861.3 within | > > > which Dynamic Range and Mastering INFOFRAME are defined| > > ++ > > > > v2: Add a missed blank line after function declaration. > > > > Signed-off-by: Gwan-gyeong Mun > > --- > > drivers/gpu/drm/i915/display/intel_ddi.c | 1 + > > drivers/gpu/drm/i915/display/intel_dp.c | 91 > > > > drivers/gpu/drm/i915/display/intel_dp.h | 3 + > > drivers/gpu/drm/i915/i915_reg.h | 1 + > > 4 files changed, 96 insertions(+) > > > > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c > > b/drivers/gpu/drm/i915/display/intel_ddi.c > > index 5c42b58c1c2f..9f5bea941bcd 100644 > > --- a/drivers/gpu/drm/i915/display/intel_ddi.c > > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c > > @@ -3478,6 +3478,7 @@ static void intel_enable_ddi_dp(struct > > intel_encoder > > *encoder, > > intel_edp_backlight_on(crtc_state, conn_state); > > intel_psr_enable(intel_dp, crtc_state); > > intel_dp_vsc_enable(intel_dp, crtc_state, conn_state); > > + intel_dp_hdr_metadata_enable(intel_dp, crtc_state, conn_state); > > intel_edp_drrs_enable(intel_dp, crtc_state); > > > > if (crtc_state->has_audio) > > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c > > b/drivers/gpu/drm/i915/display/intel_dp.c > > index 7218e159f55d..00da8221eaba 100644 > > --- a/drivers/gpu/drm/i915/display/intel_dp.c > > +++ b/drivers/gpu/drm/i915/display/intel_dp.c > > @@ -4554,6 +4554,85 @@ intel_dp_setup_vsc_sdp(struct intel_dp > > *intel_dp, > > crtc_state, DP_SDP_VSC, &vsc_sdp, > > sizeof(vsc_sdp)); } > > > > +static int > > +intel_dp_setup_hdr_metadata_infoframe_sdp(struct intel_dp > > *intel_dp, > > + const struct intel_crtc_state > > *crtc_state, > > + const struct > > drm_connector_state > > The return value is not handled, you may convert it as void. > Okay, I'll remove the return values which is not handled from intel_dp_setup_hdr_metadata_infoframe_sdp(). > > *conn_state) { > > + struct intel_digital_port *intel_dig_port = > > dp_to_dig_port(intel_dp); > > + struct drm_i915_private *dev_priv = to_i915(intel_dig_port- > > >base.base.dev); > > + struct dp_sdp infoframe_sdp = {}; > > + struct hdmi_drm_infoframe drm_infoframe = {}; > > + const int infoframe_size = HDMI_INFOFRAME_HEADER_SIZE + > > HDMI_DRM_INFOFRAME_SIZE; > > + unsigned char buf[HDMI_INFOFRAME_HEADER_SIZE + > > HDMI_DRM_INFOFRAME_SIZE]; > > + ssize_t len; > > + int ret; > > + > > + ret = drm_hdmi_infoframe_set_hdr_metadata(&drm_infoframe, > > conn_state); > > + if (ret) { > > + DRM_DEBUG_KMS("couldn't set HDR metadata in > > infoframe\n"); > > + return ret; > > + } > > + > > + len = hdmi_drm_infoframe_pack_only(&drm_info
Re: [Intel-gfx] [PATCH v2 3/6] drm: Add DisplayPort colorspace property
On Mon, 2019-09-02 at 17:44 +0300, Ville Syrjälä wrote: > On Fri, Aug 23, 2019 at 12:52:29PM +0300, Gwan-gyeong Mun wrote: > > In order to use colorspace property to Display Port connectors, it > > extends > > DRM_MODE_CONNECTOR_DisplayPort connector_type on > > drm_mode_create_colorspace_property function. > > > > Signed-off-by: Gwan-gyeong Mun > > --- > > drivers/gpu/drm/drm_connector.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/drm_connector.c > > b/drivers/gpu/drm/drm_connector.c > > index 4c766624b20d..655ada9d4c16 100644 > > --- a/drivers/gpu/drm/drm_connector.c > > +++ b/drivers/gpu/drm/drm_connector.c > > @@ -1703,7 +1703,9 @@ int > > drm_mode_create_colorspace_property(struct drm_connector > > *connector) > > struct drm_property *prop; > > > > if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA || > > - connector->connector_type == DRM_MODE_CONNECTOR_HDMIB) { > > + connector->connector_type == DRM_MODE_CONNECTOR_HDMIB || > > + connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort > > || > > + connector->connector_type == DRM_MODE_CONNECTOR_eDP) { > > We don't need a separate set of enum values for DP? > I checked DP 1.4a spec, 2.2.5.7.5 VSC SDP Payload for Pixel Encoding/Colorimetry again, Followed your comments, the spec requires more new colorimetry options for DP 1.4a colorimetry format. I'll add missed colorimetry options and will separate set of colorimetry enum values for DP. > > prop = drm_property_create_enum(dev, > > DRM_MODE_PROP_ENUM, > > "Colorspace", > > hdmi_colorspaces, > > -- > > 2.22.0 > > > > ___ > > Intel-gfx mailing list > > intel-...@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH v2 2/6] drm/i915/dp: Add support of BT.2020 Colorimetry to DP MSA
On Mon, 2019-09-02 at 17:43 +0300, Ville Syrjälä wrote: > On Fri, Aug 23, 2019 at 12:52:28PM +0300, Gwan-gyeong Mun wrote: > > When BT.2020 Colorimetry output is used for DP, we should program > > BT.2020 > > Colorimetry to MSA and VSC SDP. It adds output_colorspace to > > intel_crtc_state struct as a place holder of pipe's output > > colorspace. > > In order to distinguish needed colorimetry for VSC SDP, it adds > > intel_dp_needs_vsc_colorimetry function. > > If the output colorspace requires vsc sdp or output format is YCbCr > > 4:2:0, > > it uses MSA with VSC SDP. > > > > As per DP 1.4a spec section 2.2.4.3 [MSA Field for Indication of > > Color Encoding Format and Content Color Gamut] while sending > > BT.2020 Colorimetry signals we should program MSA MISC1 fields > > which > > indicate VSC SDP for the Pixel Encoding/Colorimetry Format. > > > > v2: Remove useless parentheses > > > > Signed-off-by: Gwan-gyeong Mun > > --- > > drivers/gpu/drm/i915/display/intel_ddi.c | 8 +++--- > > .../drm/i915/display/intel_display_types.h| 3 +++ > > drivers/gpu/drm/i915/display/intel_dp.c | 25 > > ++- > > drivers/gpu/drm/i915/display/intel_dp.h | 1 + > > 4 files changed, 33 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c > > b/drivers/gpu/drm/i915/display/intel_ddi.c > > index 4f7ea0a35976..5c42b58c1c2f 100644 > > --- a/drivers/gpu/drm/i915/display/intel_ddi.c > > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c > > @@ -1737,11 +1737,13 @@ void intel_ddi_set_pipe_settings(const > > struct intel_crtc_state *crtc_state) > > /* > > * As per DP 1.4a spec section 2.2.4.3 [MSA Field for > > Indication > > * of Color Encoding Format and Content Color Gamut] while > > sending > > -* YCBCR 420 signals we should program MSA MISC1 fields which > > -* indicate VSC SDP for the Pixel Encoding/Colorimetry Format. > > +* YCBCR 420, HDR BT.2020 signals we should program MSA MISC1 > > fields > > +* which indicate VSC SDP for the Pixel Encoding/Colorimetry > > Format. > > */ > > - if (crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) > > + if (crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR420 > > || > > + intel_dp_needs_vsc_colorimetry(crtc_state- > > >output_colorspace)) > > temp |= TRANS_MSA_USE_VSC_SDP; > > + > > I915_WRITE(TRANS_MSA_MISC(cpu_transcoder), temp); > > } > > > > diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h > > b/drivers/gpu/drm/i915/display/intel_display_types.h > > index 449abaea619f..9845abcf6f29 100644 > > --- a/drivers/gpu/drm/i915/display/intel_display_types.h > > +++ b/drivers/gpu/drm/i915/display/intel_display_types.h > > @@ -964,6 +964,9 @@ struct intel_crtc_state { > > /* Output format RGB/YCBCR etc */ > > enum intel_output_format output_format; > > > > + /* Output colorspace sRGB/BT.2020 etc */ > > + u32 output_colorspace; > > + > > /* Output down scaling is done in LSPCON device */ > > bool lspcon_downsampling; > > > > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c > > b/drivers/gpu/drm/i915/display/intel_dp.c > > index 55d5ab97061c..295d5ed2be96 100644 > > --- a/drivers/gpu/drm/i915/display/intel_dp.c > > +++ b/drivers/gpu/drm/i915/display/intel_dp.c > > @@ -2164,6 +2164,8 @@ intel_dp_compute_config(struct intel_encoder > > *encoder, > > pipe_config->has_pch_encoder = true; > > > > pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; > > + pipe_config->output_colorspace = intel_conn_state- > > >base.colorspace; > > + > > if (lspcon->active) > > lspcon_ycbcr420_config(&intel_connector->base, > > pipe_config); > > else > > @@ -4408,6 +4410,26 @@ u8 intel_dp_dsc_get_slice_count(struct > > intel_dp *intel_dp, > > return 0; > > } > > > > +bool > > +intel_dp_needs_vsc_colorimetry(u32 colorspace) > > I would pass the entire crtc state here so you handle handle the > 4:2:0 > case here as well. > Okay, I'll pass the entire intel_crtc_state stucture value to intel_dp_needs_vsc_colorimetry() for checking output format (YCbCr 4:2:0) and output colorspace here. And I'll change the fuction name to intel_dp_needs_vsc_sdp(). > > +{ > > + bool ret = false; > > Pointless variable. > I'll remove pointless variables. > > + > > + switch (colorspace) { > > + case DRM_MODE_COLORIMETRY_SYCC_601: > > + case DRM_MODE_COLORIMETRY_OPYCC_601: > > + case DRM_MODE_COLORIMETRY_BT2020_YCC: > > + case DRM_MODE_COLORIMETRY_BT2020_RGB: > > + case DRM_MODE_COLORIMETRY_BT2020_CYCC: > > + ret = true; > > + break; > > + default: > > + break; > > + } > > + > > + return ret; > > +} > > + > > static void > > intel_dp_setup_vsc_sdp(struct intel_dp *intel_dp, > >const struct intel_crtc_state *crtc_state, > > @@ -4536,7 +4558,8 @@ void intel_dp_vsc_enable(struct intel_dp > > *intel_dp, > > co
[PATCH] arm64: dts: mt8183: Add gce setting in display node
In order to use GCE function, we need add some informations into display node (mboxes, mediatek,gce-client-reg, mediatek,gce-events). Signed-off-by: Bibby Hsieh Signed-off-by: Yongqiang Niu --- arch/arm64/boot/dts/mediatek/mt8183.dtsi | 15 +++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi index 5616d158a4fa..b7d294c1c5b4 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi @@ -485,6 +485,11 @@ compatible = "mediatek,mt8183-display"; reg = <0 0x1400 0 0x1000>; power-domains = <&scpsys MT8183_POWER_DOMAIN_DISP>; + mboxes = <&gce 0 CMDQ_THR_PRIO_HIGHEST 1>, +<&gce 1 CMDQ_THR_PRIO_HIGHEST 1>; + mediatek,gce-client-reg = <&gce SUBSYS_1400 0 0x1000>; + mediatek,gce-events = , + ; }; ovl0: ovl@14008000 { @@ -494,6 +499,7 @@ power-domains = <&scpsys MT8183_POWER_DOMAIN_DISP>; clocks = <&mmsys CLK_MM_DISP_OVL0>; mediatek,larb = <&larb0>; + mediatek,gce-client-reg = <&gce SUBSYS_1400 0x8000 0x1000>; }; ovl_2l0: ovl@14009000 { @@ -503,6 +509,7 @@ power-domains = <&scpsys MT8183_POWER_DOMAIN_DISP>; clocks = <&mmsys CLK_MM_DISP_OVL0_2L>; mediatek,larb = <&larb0>; + mediatek,gce-client-reg = <&gce SUBSYS_1400 0x9000 0x1000>; }; ovl_2l1: ovl@1400a000 { @@ -512,6 +519,7 @@ power-domains = <&scpsys MT8183_POWER_DOMAIN_DISP>; clocks = <&mmsys CLK_MM_DISP_OVL1_2L>; mediatek,larb = <&larb0>; + mediatek,gce-client-reg = <&gce SUBSYS_1400 0xa000 0x1000>; }; rdma0: rdma@1400b000 { @@ -522,6 +530,7 @@ clocks = <&mmsys CLK_MM_DISP_RDMA0>; mediatek,larb = <&larb0>; mediatek,rdma_fifo_size = <5>; + mediatek,gce-client-reg = <&gce SUBSYS_1400 0xb000 0x1000>; }; rdma1: rdma@1400c000 { @@ -532,6 +541,7 @@ clocks = <&mmsys CLK_MM_DISP_RDMA1>; mediatek,larb = <&larb0>; mediatek,rdma_fifo_size = <2>; + mediatek,gce-client-reg = <&gce SUBSYS_1400 0xc000 0x1000>; }; color0: color@1400e000 { @@ -541,6 +551,7 @@ interrupts = ; power-domains = <&scpsys MT8183_POWER_DOMAIN_DISP>; clocks = <&mmsys CLK_MM_DISP_COLOR0>; + mediatek,gce-client-reg = <&gce SUBSYS_1400 0xe000 0x1000>; }; ccorr0: ccorr@1400f000 { @@ -549,6 +560,7 @@ interrupts = ; power-domains = <&scpsys MT8183_POWER_DOMAIN_DISP>; clocks = <&mmsys CLK_MM_DISP_CCORR0>; + mediatek,gce-client-reg = <&gce SUBSYS_1400 0xf000 0x1000>; }; aal0: aal@1401 { @@ -558,6 +570,7 @@ interrupts = ; power-domains = <&scpsys MT8183_POWER_DOMAIN_DISP>; clocks = <&mmsys CLK_MM_DISP_AAL0>; + mediatek,gce-client-reg = <&gce SUBSYS_1401 0 0x1000>; }; gamma0: gamma@14011000 { @@ -567,6 +580,7 @@ interrupts = ; power-domains = <&scpsys MT8183_POWER_DOMAIN_DISP>; clocks = <&mmsys CLK_MM_DISP_GAMMA0>; + mediatek,gce-client-reg = <&gce SUBSYS_1401 0x1000 0x1000>; }; dither0: dither@14012000 { @@ -575,6 +589,7 @@ interrupts = ; power-domains = <&scpsys MT8183_POWER_DOMAIN_DISP>; clocks = <&mmsys CLK_MM_DISP_DITHER0>; + mediatek,gce-client-reg = <&gce SUBSYS_1401 0x2000 0x1000>; }; mutex: mutex@14016000 { -- 2.18.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 111241] Shadertoy shader causing hang
https://bugs.freedesktop.org/show_bug.cgi?id=111241 Timothy Arceri changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #13 from Timothy Arceri --- (In reply to Dieter Nützel from comment #12) > (In reply to Pierre-Eric Pelloux-Prayer from comment #11) > > (In reply to Dieter Nützel from comment #8) > > > BTW > > > > > > Pierre-Eric can you look into this > > > > > > Shadertoy shader corruption, too? > > > https://www.shadertoy.com/view/Xt3cWS > > > > > > > The "Buffer A" shader doesn't write fragColor when uv.y is < 0.1 or > 0.9. > > > > So the content is undefined and may be black on some platform or random. > > > > radeonsi is correct here, but we might want to replace undef values with 0x0 > > to get a default value instead of random. > > Cool to have you around for bug hunting...;-) > > Any hints where I shoud change 'undef values with 0x0' for testing? > > And sorry that I 'hijacked' this thread - should I open a new ticket? I don't think you need to open a bug for it at all. As its not a bug in Mesa its a shader bug. Closing this bug report as it should be fixed by: commit 47cc660d9c19572e5ef2dce7c8ae1766a2ac9885 glsl: replace 'x + (-x)' with constant 0 This fixes a hang in shadertoy for radeonsi where a buffer was initialized with: value -= value with value being undefined. In this case LLVM replace the operation with an assignment to NaN. Cc: 19.1 19.2 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111241 Reviewed-by: Marek Olšák -- 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: Display-Port HPD handling, link status, and bandwidth checks
On 25/08/2019 23:23, Ilia Mirkin wrote: > You'll probably get a more detailed reply during the week, but for now > have a look at the "link-status" property, which was made for > precisely this situation. I think basically the idea is to ignore link > training as part of the modeset, and just return the link status > depending on the success. (And you should filter out totally > infeasible modes, i.e. outside the monitor's max lanes/bandwidth > capabilities, which I believe are available via DPCD or EDID.) > > See https://www.kernel.org/doc/html/latest/gpu/drm-kms.html for a bit > more info as well. > It looks like only i915 is really implementing the "link-status" property (e.g. setting it to something else than "GOOD"). And it only sets it in delayed work right after a failed link-training. But it looks like setting "link-status" bad and calling drm_kms_helper_hotplug_event() indeed triggers another modeset at least from fbdev console. I guess the correct way would be checking if the link is still up after receiving an HPD short pulse and setting link-status bad and calling drm_kms_helper_hotplug_event() if the link is down. I just wonder if the real user space clients like Weston or X work the same way as fbdev does. Maybe my first question is now answered, but I am still wondering about this: >> 1. When should the link training happen? >>a) In connector detect()? >> - This would enable us to do mode filtering (in mode_valid()) >> based on the established link band-width (then again >> mode_valid() documentation suggests that modes should only >> be filtered based on "configuration-invariant hardware >> constraints"). >>b) In check phase (this would currently mean mode_fixup)? >> - This is the last point where we can reject a mode that can not >> be sent over the DP-link >>c) In commit phase (e.g. bridge enable()) >> - This is bad since we should not fail any more in the commit >> phase Thanks, Jyri > Cheers, > > -ilia > > On Sun, Aug 25, 2019 at 7:12 AM Jyri Sarha wrote: >> >> Hi, >> >> I am working on a new DisplayPort bridge-driver and there is a couple of >> things that I do not know how to handle. >> >> 1. When should the link training happen? >>a) In connector detect()? >> - This would enable us to do mode filtering (in mode_valid()) >> based on the established link band-width (then again >> mode_valid() documentation suggests that modes should only >> be filtered based on "configuration-invariant hardware >> constraints"). >>b) In check phase (this would currently mean mode_fixup)? >> - This is the last point where we can reject a mode that can not >> be sent over the DP-link >>c) In commit phase (e.g. bridge enable()) >> - This is bad since we should not fail any more in the commit >> phase >> >> 2. DP-link sometimes drops after a succesful link training and DP-sink >>is supposed to send short HPD pulse about it. What are the >>recommended ways to handle the situation? >> >>a) Send hotplug event and let the DRM client deal with it? >> - This does not work too well because even if the client tries >> to restore the display by committing the same state again - >> like fbdev does - the bridge does not go trough disable-enable >> cycle, since display mode has not changed. >> - Despite it not working so well, this is what the most drivers >> appear to do. >> >>b) Driver internally re-trains the link but send a hotplug event >> always after it? >> - This is what i915 does, if I read the code right. >> - How to treat a training failure? Sending hotplug event does not >> really help (see above). >> >>c) Silently re-train the link if we were able to restore the link >> and the display mode, and send HPD only if something went wrong? >> >> Best regards, >> Jyri >> >> -- >> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. >> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki >> ___ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 204725] black screen
https://bugzilla.kernel.org/show_bug.cgi?id=204725 Mike Lothian (m...@fireburn.co.uk) changed: What|Removed |Added CC||m...@fireburn.co.uk --- Comment #47 from Mike Lothian (m...@fireburn.co.uk) --- It's selected automatically if you set DRM_FBDEV_EMULATION - which is "Enable legacy fbdev support for your modesetting driver" and unset above That should get your console working -- 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
[RESEND PATCH v3 6/7] backlight: gpio: remove def_value from struct gpio_backlight
From: Bartosz Golaszewski This field is unused outside of probe(). There's no need to store it. We can make it into a local variable. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Reviewed-by: Daniel Thompson --- drivers/video/backlight/gpio_backlight.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index 70882556f047..cd6a75bca9cc 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -21,7 +21,6 @@ struct gpio_backlight { struct device *fbdev; struct gpio_desc *gpiod; - int def_value; }; static int gpio_backlight_update_status(struct backlight_device *bl) @@ -61,7 +60,7 @@ static int gpio_backlight_probe(struct platform_device *pdev) struct backlight_device *bl; struct gpio_backlight *gbl; enum gpiod_flags flags; - int ret; + int ret, def_value; gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL); if (gbl == NULL) @@ -70,8 +69,8 @@ static int gpio_backlight_probe(struct platform_device *pdev) if (pdata) gbl->fbdev = pdata->fbdev; - gbl->def_value = device_property_read_bool(&pdev->dev, "default-on"); - flags = gbl->def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; + def_value = device_property_read_bool(&pdev->dev, "default-on"); + flags = def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; gbl->gpiod = devm_gpiod_get(&pdev->dev, NULL, flags); if (IS_ERR(gbl->gpiod)) { @@ -94,7 +93,7 @@ static int gpio_backlight_probe(struct platform_device *pdev) return PTR_ERR(bl); } - bl->props.brightness = gbl->def_value; + bl->props.brightness = def_value; backlight_update_status(bl); platform_set_drvdata(pdev, bl); -- 2.21.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/amd/display: Restore backlight brightness after system resume
Laptops with AMD APU doesn't restore display backlight brightness after system resume. This issue started when DC was introduced. Let's use BL_CORE_SUSPENDRESUME so the backlight core calls update_status callback after system resume to restore the backlight level. Tested on Dell Inspiron 3180 (Stoney Ridge) and Dell Latitude 5495 (Raven Ridge). Cc: Signed-off-by: Kai-Heng Feng --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 1b0949dd7808..183ef18ac6f3 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -2111,6 +2111,7 @@ static int amdgpu_dm_backlight_get_brightness(struct backlight_device *bd) } static const struct backlight_ops amdgpu_dm_backlight_ops = { + .options = BL_CORE_SUSPENDRESUME, .get_brightness = amdgpu_dm_backlight_get_brightness, .update_status = amdgpu_dm_backlight_update_status, }; -- 2.17.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] video/fbdev/68328fb: Remove dead code
This is dead code since 3.15. If their is no plan to use it further, these can be removed forever. Signed-off-by: Souptick Joarder --- drivers/video/fbdev/68328fb.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers/video/fbdev/68328fb.c b/drivers/video/fbdev/68328fb.c index d48e960..02d22b7 100644 --- a/drivers/video/fbdev/68328fb.c +++ b/drivers/video/fbdev/68328fb.c @@ -405,20 +405,8 @@ static int mc68x328fb_mmap(struct fb_info *info, struct vm_area_struct *vma) int __init mc68x328fb_setup(char *options) { -#if 0 - char *this_opt; -#endif - if (!options || !*options) return 1; -#if 0 - while ((this_opt = strsep(&options, ",")) != NULL) { - if (!*this_opt) - continue; - if (!strncmp(this_opt, "disable", 7)) - mc68x328fb_enable = 0; - } -#endif return 1; } -- 1.9.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v1] backlight: lm3630a: Switch to use fwnode_property_count_uXX()
On Mon, Aug 12, 2019 at 09:04:44AM +0100, Lee Jones wrote: > On Tue, 23 Jul 2019, Andy Shevchenko wrote: > > > Use use fwnode_property_count_uXX() directly, that makes code neater. > > > > Signed-off-by: Andy Shevchenko > > --- > > drivers/video/backlight/lm3630a_bl.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > Applied, thanks. Thanks. However, I haven't still noticed a trace of it in Linux next. -- With Best Regards, Andy Shevchenko ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/3] drm/edid: no CEA extension is not an error
On Mon, 2 Sep 2019 14:46:51 +0300, Ville Syrjälä wrote: > On Fri, Aug 30, 2019 at 06:16:52PM +0200, Jean Delvare wrote: > > It is fine for displays without audio functionality to not implement > > CEA extension in their EDID. Do not return an error in that case, > > instead return 0 as if there was a CEA extension with no audio or > > speaker block. > > > > This fixes half of bug fdo#107825: > > https://bugs.freedesktop.org/show_bug.cgi?id=107825 > > > > Signed-off-by: Jean Delvare > > Cc: Maarten Lankhorst > > Cc: Maxime Ripard > > Cc: Sean Paul > > Cc: David Airlie > > Cc: Daniel Vetter > > --- > > drivers/gpu/drm/drm_edid.c |4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > --- linux-5.2.orig/drivers/gpu/drm/drm_edid.c 2019-08-30 > > 17:57:38.10995 +0200 > > +++ linux-5.2/drivers/gpu/drm/drm_edid.c2019-08-30 18:04:36.840333834 > > +0200 > > @@ -4130,7 +4130,7 @@ int drm_edid_to_sad(struct edid *edid, s > > cea = drm_find_cea_extension(edid); > > if (!cea) { > > DRM_DEBUG_KMS("SAD: no CEA Extension found\n"); > > - return -ENOENT; > > + return 0; > > } > > Seems reasonable. Maybe the cea_revision<3 branches should alse return 0? I wasn't sure about that one, as I'm not familiar with this CEA extension thing. If revision < 3 means the data is invalid then returning an error is fine. If on the other hand revision < 3 simply means that the block types we are looking for were not defined back then yes returning 0 instead would be better. I'll do whatever developers more familiar with this topic think is better. > Either way > Reviewed-by: Ville Syrjälä Thanks, -- Jean Delvare SUSE L3 Support ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 111524] AMD A9 R5 GPU doesn't work after resume
https://bugs.freedesktop.org/show_bug.cgi?id=111524 --- Comment #5 from Samuel Sieb --- Created attachment 145236 --> https://bugs.freedesktop.org/attachment.cgi?id=145236&action=edit dmesg with drm.debug=4 I've seen mention elsewhere about setting the drm.debug value. If you need a different setting, let me know. -- 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 204725] black screen
https://bugzilla.kernel.org/show_bug.cgi?id=204725 --- Comment #46 from Dmitri Seletski (drj...@gmail.com) --- (In reply to Mike Lothian from comment #37) > I think you need CONFIG_FB_SIMPLE & CONFIG_FB_BOOT_VESA_SUPPORT=y configured > > This is what I have in my .config for a Ryzen card > > CONFIG_DRM_KMS_FB_HELPER=y > CONFIG_FB_CMDLINE=y > CONFIG_FB_NOTIFY=y > CONFIG_FB_CFB_FILLRECT=y > CONFIG_FB_CFB_COPYAREA=y > CONFIG_FB_CFB_IMAGEBLIT=y > CONFIG_FB_SYS_FILLRECT=y > CONFIG_FB_SYS_COPYAREA=y > CONFIG_FB_SYS_IMAGEBLIT=y > CONFIG_FB_SYS_FOPS=y > CONFIG_FB_DEFERRED_IO=y > CONFIG_FB_MODE_HELPERS=y > CONFIG_FB_EFI=y > CONFIG_FB_SIMPLE=y > > And I'm sure I had the above issue when playing with these options before I am a little confused. CONFIG_DRM_KMS_FB_HELPER I have this in my 'make menuconfig' │ Symbol: DRM_KMS_FB_HELPER [=n] │ │ Type : bool │ │ Defined at drivers/gpu/drm/Kconfig:75 │ │ Depends on: HAS_IOMEM [=y] && DRM_KMS_HELPER [=m] I checked every option under 'drivers/gpu/drm/' I don't see one option with description of 'CONFIG_DRM_KMS_FB_HELPER'. Is this normal? I only have, under "Device Drivers > Graphics support > Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)": --- Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) │ │ │ │ [ ] DRM DP AUX Interface │ │ │ │ [ ] Insert extra checks and debug info into the DRM range managers │ │ │ │ < > kselftests for DRM │ │ │ │ [ ] Enable legacy fbdev support for your modesetting driver │ │ │ │ [*] Allow to specify an EDID data set instead of probing for it. I supposed I can just add CONFIG_DRM_KMS_FB_HELPER=y line to .config and compile it this way, but why is it disabled and not in config file by default? Is it even significant? -- 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
Re: Adreno crash on i.MX53 running 5.3-rc6
Hi Robin, On Mon, Sep 2, 2019 at 11:45 AM Robin Murphy wrote: > Try 0036bc73ccbe - that looks like something that CONFIG_DMA_API_DEBUG > should have been screaming about anyway. Thanks for your suggestion. I can successfully boot after reverting the following commits: commit 141db5703c887f46957615cd6616ca28fe4691e0 (HEAD) Author: Fabio Estevam Date: Mon Sep 2 14:58:18 2019 -0300 Revert "drm/msm: stop abusing dma_map/unmap for cache" This reverts commit 0036bc73ccbe7e600a3468bf8e8879b122252274. commit fa5b1f620f2984c254877d6049214c39c24c8207 Author: Fabio Estevam Date: Mon Sep 2 14:56:01 2019 -0300 Revert "drm/msm: Use the correct dma_sync calls in msm_gem" This reverts commit 3de433c5b38af49a5fc7602721e2ab5d39f1e69c. Rob, What would be the recommended approach for fixing this? Thanks ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 201497] [amdgpu]: '*ERROR* No EDID read' is back in 4.19
https://bugzilla.kernel.org/show_bug.cgi?id=201497 --- Comment #10 from Daniel Andersson (engyw...@gmail.com) --- Is this going to get fixed? -- 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
Re: [PATCH] drm/amd/display: Restore backlight brightness after system resume
Hi, [This is an automated email] This commit has been processed because it contains a -stable tag. The stable tag indicates that it's relevant for the following trees: all The bot has tested the following trees: v5.2.11, v4.19.69, v4.14.141, v4.9.190, v4.4.190. v5.2.11: Build OK! v4.19.69: Build OK! v4.14.141: Failed to apply! Possible dependencies: 1b0c0f9dc5ca ("drm/amdgpu: move userptr BOs to CPU domain during CS v2") 1ed3d2567c80 ("drm/amdgpu: keep the MMU lock until the update ends v4") 3fe89771cb0a ("drm/amdgpu: stop reserving the BO in the MMU callback v3") 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") 60de1c1740f3 ("drm/amdgpu: use a rw_semaphore for MMU notifiers") 9a18999640fa ("drm/amdgpu: move MMU notifier related defines to amdgpu_mn.h") 9cca0b8e5df0 ("drm/amdgpu: move amdgpu_cs_sysvm_access_required into find_mapping") a216ab09955d ("drm/amdgpu: fix userptr put_page handling") b72cf4fca2bb ("drm/amdgpu: move taking mmap_sem into get_user_pages v2") ca666a3c298f ("drm/amdgpu: stop using BO status for user pages") v4.9.190: Failed to apply! Possible dependencies: 1cec20f0ea0e ("dma-buf: Restart reservation_object_wait_timeout_rcu() after writes") 3fe89771cb0a ("drm/amdgpu: stop reserving the BO in the MMU callback v3") 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") 4df654d293c6 ("drm/amdgpu: move amdgpu_uvd structure to uvd header") 5e5681788bef ("drm/amdgpu: move amdgpu_vce structure to vce header") 660e855813f7 ("amdgpu: use drm sync objects for shared semaphores (v6)") 78010cd9736e ("dma-buf/fence: add an lockdep_assert_held()") 95aa13f6b196 ("drm/amdgpu: move amdgpu_vcn structure to vcn header") 95d0906f8506 ("drm/amdgpu: add initial vcn support and decode tests") 9a18999640fa ("drm/amdgpu: move MMU notifier related defines to amdgpu_mn.h") b636922553ee ("drm/amdgpu: only move VM BOs in the LRU during validation v2") b72cf4fca2bb ("drm/amdgpu: move taking mmap_sem into get_user_pages v2") f54d1867005c ("dma-buf: Rename struct fence to dma_fence") fedf54132d24 ("dma-buf: Restart reservation_object_get_fences_rcu() after writes") v4.4.190: Failed to apply! Possible dependencies: 1f7371b2a5fa ("drm/amd/powerplay: add basic powerplay framework") 288912cb95d1 ("drm/amdgpu: use $(src) in Makefile (v2)") 37cd0ca204a5 ("drm/amdgpu: unify AMDGPU_CTX_MAX_CS_PENDING and amdgpu_sched_jobs") 3c0eea6c35d9 ("drm/amdgpu: put VM page tables directly into duplicates list") 3f99dd814a6f ("drm/amdgpu: save and restore UVD context with suspend and resume") 4325198180e5 ("drm/amdgpu: remove GART page addr array") 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") 4acabfe3793e ("drm/amdgpu: fix num_ibs check") 4df654d293c6 ("drm/amdgpu: move amdgpu_uvd structure to uvd header") 50838c8cc413 ("drm/amdgpu: add proper job alloc/free functions") 56467ebfb254 ("drm/amdgpu: split VM PD and PT handling during CS") 5e5681788bef ("drm/amdgpu: move amdgpu_vce structure to vce header") 7270f8391df1 ("drm/amdgpu: add amdgpu_set_ib_value helper (v2)") 95aa13f6b196 ("drm/amdgpu: move amdgpu_vcn structure to vcn header") 9a18999640fa ("drm/amdgpu: move MMU notifier related defines to amdgpu_mn.h") a1d29476d666 ("drm/amdgpu: optionally enable GART debugfs file") a8fe58cec351 ("drm/amd: add ACP driver support") c036554170fc ("drm/amdgpu: handle more than 10 UVD sessions (v2)") c3cca41e6249 ("drm/amdgpu: cleanup amdgpu_cs_parser structure") cadf97b196a1 ("drm/amdgpu: clean up non-scheduler code path (v2)") cd75dc6887f1 ("drm/amdgpu: separate pushing CS to scheduler") d71518b5aa7c ("drm/amdgpu: cleanup in kernel job submission") d7af97dbccf0 ("drm/amdgpu: send UVD IB tests directly to the ring again") d8e0cae64550 ("drm/amdgpu: validate duplicates first") f69f90a113f2 ("drm/amdgpu: fix amdgpu_cs_get_threshold_for_moves handling") fdba11f4079e ("drm/amdgpu: move all Kconfig options to amdgpu/Kconfig") NOTE: The patch will not be queued to stable trees until it is upstream. How should we proceed with this patch? -- Thanks, Sasha ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 111077] link_shader and deserialize_glsl_program suddenly consume huge amount of RAM
https://bugs.freedesktop.org/show_bug.cgi?id=111077 --- Comment #22 from rol...@rptd.ch --- Hi Marek, This is going to be complicated. The application is not yet free to use by others (working on getting it to release shape). I would have to figure out first how to break this down into a reproducible test case since I don't know myself what triggers the bug. If you can think of some corner values to narrow down in what direction to search I can fully mess with the source code over here. The faulty commit talks about UBO maximum size so this might be a start. The OpenGL Capabilities from the GPU is this: - UBO Maximum Block Size = 65536 - UBO Buffer Offset Alignment = 4 So the maximum size used by the application is 65536 bytes. UBOs are used as shared buffers so blocks of data are placed next to each other respecting alignment and updated. UBOs are created like this: glBindBuffer(GL_UNIFORM_BUFFER, pUBO) // <= done once glBufferData(GL_UNIFORM_BUFFER, bufferSize, NULL, GL_DYNAMIC_DRAW) // <= done once glMapBufferRange(GL_UNIFORM_BUFFER, stride * elementCount, elementStride, GL_WRITE_ONLY | GL_MAP_INVALIDATE_RANGE_BIT) // <= done for each data block written Data then written and unmapped In particular this means a larger UBO is created once then individual blocks are written to it using ranged mapping. Just a wield guess but could the problem be related to this kind of usage pattern? -- 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 204725] black screen
https://bugzilla.kernel.org/show_bug.cgi?id=204725 --- Comment #45 from Dmitri Seletski (drj...@gmail.com) --- (In reply to Michel Dänzer from comment #44) > (In reply to Dmitri Seletski from comment #39) > > /usr/lib64/dri/swrast_dri.so failed (libLLVMAMDGPUCodeGen.so.8: cannot open > > shared object file: No such file or directory) > > BTW, LLVM only builds shared libraries like libLLVMAMDGPUCodeGen if > BUILD_SHARED_LIBS is enabled in its build configuration, which is bad for > performance and other reasons. Make sure you don't have any customization > which enables this, and if Gentoo enables it by default, please ask them not > to. LLVM_BUILD_LLVM_DYLIB should be enabled instead. I have send email to llvm mainteiners of Gentoo. I am just a user, in case what. -- 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
Re: [PATCH 1/2] drm/panel: Add DT bindings for Sony ACX424AKP
On Mon, Sep 2, 2019 at 4:40 PM Thierry Reding wrote: > Hm... my recollection is that command mode is only supported on "smart" > panels that have an internal framebuffer. So the commands actually > instruct the panel to update their internal framebuffer, which means you > can technically switch off the display engine when there are no updates. That is my understanding as well. > Under those circumstances I think it'd make sense to default to command > mode if both the panel and the host support it and stick with video mode > if for example the host can't do command mode. Makes sense to me. Maybe we should rather have a generic setting like: dsi-enforce-video-mode; and the default always being command mode, if we have consensus that command mode should always be preferred. > Or perhaps this is something that could be set from some userspace > policy maker via a connector property? A compositor for instance would > have a pretty good idea of what kind of activity is going on, so it > could at some point decide to switch between video mode and command mode > if one of them is more appropriate for the given workload. It's probably more that userspace should be made aware of the fact that we have partial updates, and if I understand correctly that is done by dirtyrect/damage API in drm_damage_helper.c (Very nice overview doc at the top of the file!) The driver enables damage by calling drm_plane_enable_fb_damage_clips() then in the .update() callback uses drm_atomic_helper_damage_merged() to figure out damaged rectangles and update those with special commands. tinydrm/ili9225.c is a pretty clean example of a driver actually doing this. There are not many of them. > Command mode can also be used to do partial updates, if I remember > correctly, which again would make it possible for a compositor to send > only a subset of a screen update. Indeed, who needs a blitter when you can just update the dirtyrects. It is a bit terse but intuitively I feel that the damage interface is what userspace should use, then DRM should be able to infer that a damaged rectangle can be updated on the display, and the display controller need to announce that it can handle these partial updates. This requires that the display controller can generate such complex command streams in response to drm_atomic_helper_damage_merged() of course, from a DSI protocol level it is supported, but we are not writing these command sequences with software, they are generated by hardware. So the display controller DSI portions must be able to send individual rectangles as well. But this is all science fiction. What all DSI display controllers in mailine do today (I think) is to simply scan out the whole framebuffer continously with a vblank TE IRQ to avoid tearing. Andrzej knows for sure what is out there I think. Yours, Linus Walleij ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 111481] AMD Navi GPU frequent freezes on both Manjaro/Ubuntu with kernel 5.3 and mesa 19.2 -git/llvm9
https://bugs.freedesktop.org/show_bug.cgi?id=111481 --- Comment #24 from Marko Popovic --- (In reply to Pierre-Eric Pelloux-Prayer from comment #22) > Yes, it's possible that there are different bugs. > > For the citra bug: I suspect an issue with Geometry Shaders + NGG but this > will require more debugging to confirm (also: using wavesize=64 didn't help, > so it's not a regression caused by a0d330bedb9e). > > I'm also testing using AMD_DEBUG=nodma system wide to see if it prevents the > sdma0 kind of hangs. Ok, I confirm that AMD_DEBUG=nodma gets rid of Rocket-League startup crash, will report about the desktop stability for the rest of the day! -- 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 111481] AMD Navi GPU frequent freezes on both Manjaro/Ubuntu with kernel 5.3 and mesa 19.2 -git/llvm9
https://bugs.freedesktop.org/show_bug.cgi?id=111481 --- Comment #23 from Marko Popovic --- (In reply to Pierre-Eric Pelloux-Prayer from comment #22) > > Okay I just got another random hang on the desktop. even with the > > environment variable turned on the whole time. Unfortunately it seems to be > > very hardly tracable seems to be very random :( Seems that Citra hang is > > unrelated to this bug after all, it's a completely different bug. It's good > > that we discovered another (citra-related) bug on the way but probably we > > can't mark that workaround to solve anything because hangs still randomly > > occur on the desktop. > > Yes, it's possible that there are different bugs. > > For the citra bug: I suspect an issue with Geometry Shaders + NGG but this > will require more debugging to confirm (also: using wavesize=64 didn't help, > so it's not a regression caused by a0d330bedb9e). > > I'm also testing using AMD_DEBUG=nodma system wide to see if it prevents the > sdma0 kind of hangs. Yes both Rocket League and Desktop hangs seem to be the sdma0 type. I will add that parameter as well and see if there is any difference with Rocket League hang and use the desktop with both flags enabled. Well I mean actually finding multiple bugs while debugging 1 can only be a good thing, after all less bugs in the future and my personal computing seems to have quite a few corner cases it seems that otherwise go unnoticed :D which should benefit many new happy Navi users -- 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 111481] AMD Navi GPU frequent freezes on both Manjaro/Ubuntu with kernel 5.3 and mesa 19.2 -git/llvm9
https://bugs.freedesktop.org/show_bug.cgi?id=111481 --- Comment #22 from Pierre-Eric Pelloux-Prayer --- > Okay I just got another random hang on the desktop. even with the > environment variable turned on the whole time. Unfortunately it seems to be > very hardly tracable seems to be very random :( Seems that Citra hang is > unrelated to this bug after all, it's a completely different bug. It's good > that we discovered another (citra-related) bug on the way but probably we > can't mark that workaround to solve anything because hangs still randomly > occur on the desktop. Yes, it's possible that there are different bugs. For the citra bug: I suspect an issue with Geometry Shaders + NGG but this will require more debugging to confirm (also: using wavesize=64 didn't help, so it's not a regression caused by a0d330bedb9e). I'm also testing using AMD_DEBUG=nodma system wide to see if it prevents the sdma0 kind of hangs. -- 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 111481] AMD Navi GPU frequent freezes on both Manjaro/Ubuntu with kernel 5.3 and mesa 19.2 -git/llvm9
https://bugs.freedesktop.org/show_bug.cgi?id=111481 --- Comment #21 from Marko Popovic --- (In reply to Pierre-Eric Pelloux-Prayer from comment #19) > (In reply to Marko Popovic from comment #17) > > (In reply to Pierre-Eric Pelloux-Prayer from comment #15) > > > (In reply to Marko Popovic from comment #14) > > > > > > > > Yes, always happens at the same place with Citra emulator > > > > > > Could you capture a trace of the problem (using Apitrace or Renderdoc)? > > > > > > This would be very helpful to fix it. > > > > I added reproduced Citra crash recorded by using command: > > apitrace trace ./citra-qt > > > > I hope this is correct, if you need anything else or done differently please > > just let me know! > > Thanks for the trace! > > Replaying the trace a few times is enough to reliably to reproduce the hang. > > Using AMD_DEBUG=nongg seems to prevent it so it could be a temporary > workaround until a proper fix is found. > Could you confirm this on your system? > > > > > > I am adding Rocket League crash output from apitrace. > > This trace file is very small (only one frame) and doesn't hang here. Okay I just got another random hang on the desktop. even with the environment variable turned on the whole time. Unfortunately it seems to be very hardly tracable seems to be very random :( Seems that Citra hang is unrelated to this bug after all, it's a completely different bug. It's good that we discovered another (citra-related) bug on the way but probably we can't mark that workaround to solve anything because hangs still randomly occur on the desktop. -- 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] drm/mcde: Some fixes to handling video mode
On Mon, Sep 02, 2019 at 09:17:14AM +0200, Linus Walleij wrote: > The video DSI mode had not really been tested. These fixes makes > it more likely to work on real hardware: > - Set the HS clock to something the video mode reported by the > panel can handle rather than the max HS rate. > - Put the active width (x width) in the right bits and the VSA > (vertical sync active) in the right bits (those were swapped). > - Calculate the packet sizes in bytes as in the vendor driver, > rather than in bits. > - Handle negative result in front/back/sync packages and fall > back to zero like in the vendor driver. > > Cc: Stephan Gerhold > Fixes: 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE") > Signed-off-by: Linus Walleij > --- > drivers/gpu/drm/mcde/mcde_dsi.c | 60 ++--- > 1 file changed, 41 insertions(+), 19 deletions(-) > > diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c > index 90659d190d78..f5079f0e24ca 100644 > --- a/drivers/gpu/drm/mcde/mcde_dsi.c > +++ b/drivers/gpu/drm/mcde/mcde_dsi.c > @@ -365,11 +365,12 @@ void mcde_dsi_te_request(struct mipi_dsi_device *mdsi) > static void mcde_dsi_setup_video_mode(struct mcde_dsi *d, > const struct drm_display_mode *mode) > { > - u8 bpp = mipi_dsi_pixel_format_to_bpp(d->mdsi->format); > + /* cpp, characters per pixel, number of bytes per pixel */ > + u8 cpp = mipi_dsi_pixel_format_to_bpp(d->mdsi->format) / 8; > u64 bpl; > - u32 hfp; > - u32 hbp; > - u32 hsa; > + int hfp; > + int hbp; > + int hsa; > u32 blkline_pck, line_duration; > u32 blkeol_pck, blkeol_duration; > u32 val; > @@ -420,13 +421,13 @@ static void mcde_dsi_setup_video_mode(struct mcde_dsi > *d, > writel(val, d->regs + DSI_VID_MAIN_CTL); > > /* Vertical frame parameters are pretty straight-forward */ > - val = mode->vdisplay << DSI_VID_VSIZE_VSA_LENGTH_SHIFT; > + val = mode->vdisplay << DSI_VID_VSIZE_VACT_LENGTH_SHIFT; > /* vertical front porch */ > val |= (mode->vsync_start - mode->vdisplay) > << DSI_VID_VSIZE_VFP_LENGTH_SHIFT; > /* vertical sync active */ > val |= (mode->vsync_end - mode->vsync_start) > - << DSI_VID_VSIZE_VACT_LENGTH_SHIFT; > + << DSI_VID_VSIZE_VSA_LENGTH_SHIFT; > /* vertical back porch */ > val |= (mode->vtotal - mode->vsync_end) > << DSI_VID_VSIZE_VBP_LENGTH_SHIFT; > @@ -437,21 +438,25 @@ static void mcde_dsi_setup_video_mode(struct mcde_dsi > *d, >* horizontal resolution is given in pixels and must be re-calculated >* into bytes since this is what the hardware expects. >* > + * hfp = horizontal front porch in bytes > + * hbp = horizontal back porch in bytes > + * hsa = horizontal sync active in bytes > + * >* 6 + 2 is HFP header + checksum >*/ > - hfp = (mode->hsync_start - mode->hdisplay) * bpp - 6 - 2; > + hfp = (mode->hsync_start - mode->hdisplay) * cpp - 6 - 2; > if (d->mdsi->mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE) { > /* >* 6 is HBP header + checksum >* 4 is RGB header + checksum >*/ > - hbp = (mode->htotal - mode->hsync_end) * bpp - 4 - 6; > + hbp = (mode->htotal - mode->hsync_end) * cpp - 4 - 6; > /* >* 6 is HBP header + checksum >* 4 is HSW packet bytes >* 4 is RGB header + checksum >*/ > - hsa = (mode->hsync_end - mode->hsync_start) * bpp - 4 - 4 - 6; > + hsa = (mode->hsync_end - mode->hsync_start) * cpp - 4 - 4 - 6; > } else { > /* >* HBP includes both back porch and sync > @@ -459,11 +464,23 @@ static void mcde_dsi_setup_video_mode(struct mcde_dsi > *d, >* 4 is HSW packet bytes >* 4 is RGB header + checksum >*/ > - hbp = (mode->htotal - mode->hsync_start) * bpp - 4 - 4 - 6; > - /* HSA is not considered in this mode and set to 0 */ > + hbp = (mode->htotal - mode->hsync_start) * cpp - 4 - 4 - 6; > + /* HSA is not present in this mode and set to 0 */ > + hsa = 0; > + } > + if (hfp < 0) { > + dev_info(d->dev, "hfp negative, set to 0\n"); > + hfp = 0; > + } > + if (hbp < 0) { > + dev_info(d->dev, "hbp negative, set to 0\n"); > + hbp = 0; > + } > + if (hsa < 0) { > + dev_info(d->dev, "hsa negative, set to 0\n"); > hsa = 0; > } > - dev_dbg(d->dev, "hfp: %u, hbp: %u, hsa: %u\n", > + dev_dbg(d->dev, "hfp: %u, hbp: %u, hsa: %u bytes\n", > hfp, hbp, hsa); > > /* Frame parameters: horizontal sync active */ > @@ -475,7 +492,7 @@ static void mcde_dsi_setup_video
Re: [PATCH 1/2] drm/panel: Add DT bindings for Sony ACX424AKP
On Mon, Sep 02, 2019 at 04:40:06PM +0200, Thierry Reding wrote: > On Mon, Sep 02, 2019 at 01:44:38PM +0200, Linus Walleij wrote: > > On Mon, Sep 2, 2019 at 11:35 AM Thierry Reding > > wrote: > > > > > > + dsi-command-mode: > > > > + type: boolean > > > > + description: > > > > + If this is specified, the panel will be used in command > > > > + mode instead of video mode. > > > > > > I'm not sure there's concensus on this one yet. I think so far the > > > driver decides which mode to use the panel in. Technically this falls > > > into the category of configuration, so it doesn't really belong in the > > > DT. > > > > The way we've used DT is for a bit of both hardware description > > and configuration I'd say, but I'm no authority on the subject. I'm okay with this if there's consensus, but it should be in a common doc. We probably need a dsi-commom schema with this, reg, ??. > > > > > I vaguely recall from discussions I've had on this subject that there's > > > usually no reason to do video mode if you can do command mode because > > > command mode is more power efficient. This was a long time ago, so I may > > > be misremembering. Perhaps you have different information on this? 30 or 60fps updates tend to be impossible because you have less b/w and it's async to the refresh. I think most panels that can do both, always need command mode too for initialization. > > No idea. I was under the impression that video mode was preferred > > but I have no idea why. > > Hm... my recollection is that command mode is only supported on "smart" > panels that have an internal framebuffer. So the commands actually > instruct the panel to update their internal framebuffer, which means you > can technically switch off the display engine when there are no updates. > > Under those circumstances I think it'd make sense to default to command > mode if both the panel and the host support it and stick with video mode > if for example the host can't do command mode. > > Or perhaps this is something that could be set from some userspace > policy maker via a connector property? A compositor for instance would > have a pretty good idea of what kind of activity is going on, so it > could at some point decide to switch between video mode and command mode > if one of them is more appropriate for the given workload. > > Command mode can also be used to do partial updates, if I remember > correctly, which again would make it possible for a compositor to send > only a subset of a screen update. All makes sense to me. Rob ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2] drm/mcde: Fix DSI transfers
On Sat, Aug 31, 2019 at 09:50:13AM +0200, Linus Walleij wrote: > There were bugs in the DSI transfer (read and write) function > as it was only tested with displays ever needing a single byte > to be written. Fixed it up and tested so we can now write > messages of up to 16 bytes and read up to 4 bytes from the > display. > > Tested with a Sony ACX424AKP display: this display now self- > identifies and can control backlight in command mode. > > Cc: Stephan Gerhold > Reported-by: kbuild test robot > Fixes: 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE") > Signed-off-by: Linus Walleij > --- > ChangeLog v1->v2: > - Fix a print modifier for dev_err() found by the build robot. > --- > drivers/gpu/drm/mcde/mcde_dsi.c | 70 ++--- > 1 file changed, 47 insertions(+), 23 deletions(-) > > diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c > index 07f7090d08b3..90659d190d78 100644 > --- a/drivers/gpu/drm/mcde/mcde_dsi.c > +++ b/drivers/gpu/drm/mcde/mcde_dsi.c > @@ -178,22 +178,26 @@ static ssize_t mcde_dsi_host_transfer(struct > mipi_dsi_host *host, > const u32 loop_delay_us = 10; /* us */ > const u8 *tx = msg->tx_buf; > u32 loop_counter; > - size_t txlen; > + size_t txlen = msg->tx_len; > + size_t rxlen = msg->rx_len; > u32 val; > int ret; > int i; > > - txlen = msg->tx_len; > - if (txlen > 12) { > + if (txlen > 16) { > dev_err(d->dev, > - "dunno how to write more than 12 bytes yet\n"); > + "dunno how to write more than 16 bytes yet\n"); > + return -EIO; > + } > + if (rxlen > 4) { > + dev_err(d->dev, > + "dunno how to read more than 4 bytes yet\n"); > return -EIO; > } > > dev_dbg(d->dev, > - "message to channel %d, %zd bytes", > - msg->channel, > - txlen); > + "message to channel %d, write %zd bytes read %zd bytes\n", > + msg->channel, txlen, rxlen); > > /* Command "nature" */ > if (MCDE_DSI_HOST_IS_READ(msg->type)) > @@ -210,9 +214,7 @@ static ssize_t mcde_dsi_host_transfer(struct > mipi_dsi_host *host, > if (mipi_dsi_packet_format_is_long(msg->type)) > val |= DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_LONGNOTSHORT; > val |= 0 << DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_ID_SHIFT; > - /* Add one to the length for the MIPI DCS command */ > - val |= txlen > - << DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_SIZE_SHIFT; > + val |= txlen << DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_SIZE_SHIFT; > val |= DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_LP_EN; > val |= msg->type << DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_HEAD_SHIFT; > writel(val, d->regs + DSI_DIRECT_CMD_MAIN_SETTINGS); > @@ -249,17 +251,36 @@ static ssize_t mcde_dsi_host_transfer(struct > mipi_dsi_host *host, > writel(1, d->regs + DSI_DIRECT_CMD_SEND); > > loop_counter = 1000 * 1000 / loop_delay_us; > - while (!(readl(d->regs + DSI_DIRECT_CMD_STS) & > - DSI_DIRECT_CMD_STS_WRITE_COMPLETED) > -&& --loop_counter) > - usleep_range(loop_delay_us, (loop_delay_us * 3) / 2); > - > - if (!loop_counter) { > - dev_err(d->dev, "DSI write timeout!\n"); > - return -ETIME; > + if (MCDE_DSI_HOST_IS_READ(msg->type)) { > + /* Read command */ > + while (!(readl(d->regs + DSI_DIRECT_CMD_STS) & > + (DSI_DIRECT_CMD_STS_READ_COMPLETED | > + DSI_DIRECT_CMD_STS_READ_COMPLETED_WITH_ERR)) > +&& --loop_counter) > + usleep_range(loop_delay_us, (loop_delay_us * 3) / 2); > + if (!loop_counter) { > + dev_err(d->dev, "DSI write timeout!\n"); "DSI read timeout!" might be more apppropriate here? > + return -ETIME; > + } > + } else { > + /* Writing only */ > + while (!(readl(d->regs + DSI_DIRECT_CMD_STS) & > + DSI_DIRECT_CMD_STS_WRITE_COMPLETED) > +&& --loop_counter) > + usleep_range(loop_delay_us, (loop_delay_us * 3) / 2); > + > + if (!loop_counter) { > + dev_err(d->dev, "DSI write timeout!\n"); > + return -ETIME; > + } > } > > val = readl(d->regs + DSI_DIRECT_CMD_STS); > + if (val & DSI_DIRECT_CMD_STS_READ_COMPLETED_WITH_ERR) { > + dev_err(d->dev, "read completed with error\n"); > + writel(1, d->regs + DSI_DIRECT_CMD_RD_INIT); > + return -EIO; > + } > if (val & DSI_DIRECT_CMD_STS_ACKNOWLEDGE_WITH_ERR_RECEIVED) { > val >>= DSI_DIRECT_CMD_STS_ACK_VAL_SHIFT; > dev_err(d->dev, "error during transmission: %04x\n", > @@ -269,10 +290,7 @@ static ssize_
Re: [PATCH v1] backlight: lm3630a: Switch to use fwnode_property_count_uXX()
On Mon, 02 Sep 2019, Andy Shevchenko wrote: > On Mon, Aug 12, 2019 at 09:04:44AM +0100, Lee Jones wrote: > > On Tue, 23 Jul 2019, Andy Shevchenko wrote: > > > > > Use use fwnode_property_count_uXX() directly, that makes code neater. > > > > > > Signed-off-by: Andy Shevchenko > > > --- > > > drivers/video/backlight/lm3630a_bl.c | 3 +-- > > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > Applied, thanks. > > Thanks. > However, I haven't still noticed a trace of it in Linux next. Just did a big push. It should be in there by tomorrow. -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: Adreno crash on i.MX53 running 5.3-rc6
On 02/09/2019 14:51, Fabio Estevam wrote: Hi, I am getting the following crash when booting the adreno driver on i.MX53 running a 5.3-rc6 kernel. Such error does not happen with 5.2 though. Before I start running a bisect, I am wondering if anyone has any ideas about this issue. Try 0036bc73ccbe - that looks like something that CONFIG_DMA_API_DEBUG should have been screaming about anyway. Robin. Thanks, Fabio Estevam [2.083249] 8<--- cut here --- [2.086460] Unable to handle kernel paging request at virtual address 50001000 [2.094174] pgd = (ptrval) [2.096911] [50001000] *pgd= [2.100606] Internal error: Oops: 805 [#1] SMP ARM [2.105412] Modules linked in: [2.108487] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.3.0-rc6-00271-g9f159ae07f07 #4 [2.116411] Hardware name: Freescale i.MX53 (Device Tree Support) [2.122538] PC is at v7_dma_clean_range+0x20/0x38 [2.127254] LR is at __dma_page_cpu_to_dev+0x28/0x90 [2.132226] pc : []lr : []psr: 2013 [2.138500] sp : d80b5a88 ip : de96c000 fp : d840ce6c [2.143732] r10: r9 : 0001 r8 : d843e010 [2.148964] r7 : r6 : 8000 r5 : ddb6c000 r4 : [2.155500] r3 : 003f r2 : 0040 r1 : 50008000 r0 : 50001000 [2.162037] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [2.169180] Control: 10c5387d Table: 70004019 DAC: 0051 [2.174934] Process swapper/0 (pid: 1, stack limit = 0x(ptrval)) [2.180949] Stack: (0xd80b5a88 to 0xd80b6000) [2.185319] 5a80: c011c7bc d8491780 d840ce6c d849b380 c011822c [2.193509] 5aa0: c0d01a18 c0118abc c0118a78 d84a0200 0008 c1308908 d838e800 d849a4a8 [2.201697] 5ac0: d8491780 c06699b4 d8491600 d80b5b20 d84a0200 [2.209886] 5ae0: d8491780 d8491600 d80b5b20 d8491600 d849a4a8 d84a0200 0003 d84a0358 [2.218077] 5b00: c1308908 d8491600 d849a4a8 d8491780 d840ce6c c066a55c c1308908 c066a104 [2.226266] 5b20: 01001000 d84a0200 10700ac6 d849a480 d84a0200 d8491600 [2.234455] 5b40: e0845000 c1308908 c066a72c d849a480 d840ce6c d840ce00 c1308908 [2.242643] 5b60: c066b584 d849a488 d849a4a8 c1308908 d840ce6c c066ff40 [2.250832] 5b80: d849a488 d849a4a8 c1308908 d81b4000 e0845000 [2.259021] 5ba0: d838e800 c1308908 d8491600 10700ac6 d80b5bc8 d840ce00 d840ce6c 0001 [2.267210] 5bc0: e0845000 d838e800 c066ece4 0100 10ff [2.275399] 5be0: c1308908 0001 d81b4000 0100 0001 10700ac6 [2.283587] 5c00: c0d6d564 d840ce00 d81b4010 0001 d81b4000 c0d6d564 c1308908 d80b5c48 [2.291777] 5c20: d838e800 c061f9cc c1029dec d80b5c48 d838e800 c13e8788 [2.299965] 5c40: c1308928 c102a234 0100 10ff [2.308154] 5c60: 0001 a013 10700ac6 c13b7658 d840ce00 d838e800 d81b4000 [2.316343] 5c80: d840ce00 c1308908 0002 d838f800 c0620514 0001 10700ac6 [2.324531] 5ca0: d8496440 d81b4010 c1aa1c00 d838e800 c061e070 [2.332720] 5cc0: c0d6c534 df56cf34 00c8 10700ac6 d81b4010 [2.340909] 5ce0: d8496440 d838e800 c103acd0 d8496280 c1380488 c06a3e10 [2.349097] 5d00: d838f800 d838e800 d843e010 d8496440 c1308908 [2.357286] 5d20: d83f9640 c1380488 c0668554 0006 0007 c13804d4 d83f9640 [2.365475] 5d40: c1380488 c017ec18 d80c c0c43e40 d843e010 d8496440 0001 c0182a94 [2.373665] 5d60: 6013 10700ac6 d843e010 d8496280 d8496400 0018 d8496440 0001 [2.381854] 5d80: c13804d4 d83f9640 c1380488 c06a4280 c1380488 c0d764f8 d8496440 [2.390044] 5da0: c1380488 d843e010 c0d764f8 c1308908 c13ef300 c06a44f0 [2.398232] 5dc0: c0d8a0dc dffcc6f0 d843e010 dffcc6f0 d843e010 c06680b8 [2.406421] 5de0: d84988c0 d83f9640 d84988c0 d84989a0 d8498230 10700ac6 0001 d843e010 [2.414610] 5e00: c137eec0 c137eec0 c13ef300 c06ac1a0 [2.422799] 5e20: d843e010 c1aa40dc c1aa40e0 c137eec0 c06aa014 d843e010 c137eec0 [2.430988] 5e40: c137eec0 c1308908 c13e9880 c13e85d4 c06aa368 c1308908 c13e9880 [2.439178] 5e60: c13e85d4 d843e010 c137eec0 c1308908 c13e9880 c13e85d4 c06aa618 [2.447367] 5e80: c137eec0 d843e010 c06aa6a4 c137eec0 c06aa620 c06a844c [2.46] 5ea0: d80888d4 d80888a4 d84914d0 10700ac6 d80888d4 c137eec0 d8494f00 c1380d28 [2.463745] 5ec0: c06a946c c105f3d4 c1308908 c137eec0 c1308908 [2.471934] 5ee0: c125fdd0 c06ab304 c1308928 c1308908 c0103178 0109 [2.480123] 5f00: dc6e dc00 c1126860 0109 0109 c014dc88 c11253ac c10607a0
Re: [Intel-gfx] [PATCH v2 3/6] drm: Add DisplayPort colorspace property
On Fri, Aug 23, 2019 at 12:52:29PM +0300, Gwan-gyeong Mun wrote: > In order to use colorspace property to Display Port connectors, it extends > DRM_MODE_CONNECTOR_DisplayPort connector_type on > drm_mode_create_colorspace_property function. > > Signed-off-by: Gwan-gyeong Mun > --- > drivers/gpu/drm/drm_connector.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c > index 4c766624b20d..655ada9d4c16 100644 > --- a/drivers/gpu/drm/drm_connector.c > +++ b/drivers/gpu/drm/drm_connector.c > @@ -1703,7 +1703,9 @@ int drm_mode_create_colorspace_property(struct > drm_connector *connector) > struct drm_property *prop; > > if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA || > - connector->connector_type == DRM_MODE_CONNECTOR_HDMIB) { > + connector->connector_type == DRM_MODE_CONNECTOR_HDMIB || > + connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort || > + connector->connector_type == DRM_MODE_CONNECTOR_eDP) { We don't need a separate set of enum values for DP? > prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, > "Colorspace", > hdmi_colorspaces, > -- > 2.22.0 > > ___ > Intel-gfx mailing list > intel-...@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Ville Syrjälä Intel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH v2 2/6] drm/i915/dp: Add support of BT.2020 Colorimetry to DP MSA
On Fri, Aug 23, 2019 at 12:52:28PM +0300, Gwan-gyeong Mun wrote: > When BT.2020 Colorimetry output is used for DP, we should program BT.2020 > Colorimetry to MSA and VSC SDP. It adds output_colorspace to > intel_crtc_state struct as a place holder of pipe's output colorspace. > In order to distinguish needed colorimetry for VSC SDP, it adds > intel_dp_needs_vsc_colorimetry function. > If the output colorspace requires vsc sdp or output format is YCbCr 4:2:0, > it uses MSA with VSC SDP. > > As per DP 1.4a spec section 2.2.4.3 [MSA Field for Indication of > Color Encoding Format and Content Color Gamut] while sending > BT.2020 Colorimetry signals we should program MSA MISC1 fields which > indicate VSC SDP for the Pixel Encoding/Colorimetry Format. > > v2: Remove useless parentheses > > Signed-off-by: Gwan-gyeong Mun > --- > drivers/gpu/drm/i915/display/intel_ddi.c | 8 +++--- > .../drm/i915/display/intel_display_types.h| 3 +++ > drivers/gpu/drm/i915/display/intel_dp.c | 25 ++- > drivers/gpu/drm/i915/display/intel_dp.h | 1 + > 4 files changed, 33 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c > b/drivers/gpu/drm/i915/display/intel_ddi.c > index 4f7ea0a35976..5c42b58c1c2f 100644 > --- a/drivers/gpu/drm/i915/display/intel_ddi.c > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c > @@ -1737,11 +1737,13 @@ void intel_ddi_set_pipe_settings(const struct > intel_crtc_state *crtc_state) > /* >* As per DP 1.4a spec section 2.2.4.3 [MSA Field for Indication >* of Color Encoding Format and Content Color Gamut] while sending > - * YCBCR 420 signals we should program MSA MISC1 fields which > - * indicate VSC SDP for the Pixel Encoding/Colorimetry Format. > + * YCBCR 420, HDR BT.2020 signals we should program MSA MISC1 fields > + * which indicate VSC SDP for the Pixel Encoding/Colorimetry Format. >*/ > - if (crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) > + if (crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR420 || > + intel_dp_needs_vsc_colorimetry(crtc_state->output_colorspace)) > temp |= TRANS_MSA_USE_VSC_SDP; > + > I915_WRITE(TRANS_MSA_MISC(cpu_transcoder), temp); > } > > diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h > b/drivers/gpu/drm/i915/display/intel_display_types.h > index 449abaea619f..9845abcf6f29 100644 > --- a/drivers/gpu/drm/i915/display/intel_display_types.h > +++ b/drivers/gpu/drm/i915/display/intel_display_types.h > @@ -964,6 +964,9 @@ struct intel_crtc_state { > /* Output format RGB/YCBCR etc */ > enum intel_output_format output_format; > > + /* Output colorspace sRGB/BT.2020 etc */ > + u32 output_colorspace; > + > /* Output down scaling is done in LSPCON device */ > bool lspcon_downsampling; > > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c > b/drivers/gpu/drm/i915/display/intel_dp.c > index 55d5ab97061c..295d5ed2be96 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp.c > +++ b/drivers/gpu/drm/i915/display/intel_dp.c > @@ -2164,6 +2164,8 @@ intel_dp_compute_config(struct intel_encoder *encoder, > pipe_config->has_pch_encoder = true; > > pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; > + pipe_config->output_colorspace = intel_conn_state->base.colorspace; > + > if (lspcon->active) > lspcon_ycbcr420_config(&intel_connector->base, pipe_config); > else > @@ -4408,6 +4410,26 @@ u8 intel_dp_dsc_get_slice_count(struct intel_dp > *intel_dp, > return 0; > } > > +bool > +intel_dp_needs_vsc_colorimetry(u32 colorspace) I would pass the entire crtc state here so you handle handle the 4:2:0 case here as well. > +{ > + bool ret = false; Pointless variable. > + > + switch (colorspace) { > + case DRM_MODE_COLORIMETRY_SYCC_601: > + case DRM_MODE_COLORIMETRY_OPYCC_601: > + case DRM_MODE_COLORIMETRY_BT2020_YCC: > + case DRM_MODE_COLORIMETRY_BT2020_RGB: > + case DRM_MODE_COLORIMETRY_BT2020_CYCC: > + ret = true; > + break; > + default: > + break; > + } > + > + return ret; > +} > + > static void > intel_dp_setup_vsc_sdp(struct intel_dp *intel_dp, > const struct intel_crtc_state *crtc_state, > @@ -4536,7 +4558,8 @@ void intel_dp_vsc_enable(struct intel_dp *intel_dp, >const struct intel_crtc_state *crtc_state, >const struct drm_connector_state *conn_state) > { > - if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_YCBCR420) > + if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_YCBCR420 && > + !intel_dp_needs_vsc_colorimetry(conn_state->colorspace)) > return; > > intel_dp_setup_vsc_sdp(intel_dp, crtc_state, conn_state); > diff --git a/drivers/gpu/drm/i915/display/intel_dp.h > b/drivers/gpu/drm/i915/display/intel_
Re: [PATCH 5/5] drm/qxl: use drm_gem_ttm_print_info
Acked-by: Thomas Zimmermann Am 02.09.19 um 14:41 schrieb Gerd Hoffmann: > Signed-off-by: Gerd Hoffmann > --- > drivers/gpu/drm/qxl/qxl_drv.h| 1 + > drivers/gpu/drm/qxl/qxl_object.c | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h > index 9e034c5fa87d..d4051409ce64 100644 > --- a/drivers/gpu/drm/qxl/qxl_drv.h > +++ b/drivers/gpu/drm/qxl/qxl_drv.h > @@ -38,6 +38,7 @@ > #include > #include > #include > +#include > #include > #include > #include > diff --git a/drivers/gpu/drm/qxl/qxl_object.c > b/drivers/gpu/drm/qxl/qxl_object.c > index 29aab7b14513..c013c516f561 100644 > --- a/drivers/gpu/drm/qxl/qxl_object.c > +++ b/drivers/gpu/drm/qxl/qxl_object.c > @@ -86,6 +86,7 @@ static const struct drm_gem_object_funcs qxl_object_funcs = > { > .get_sg_table = qxl_gem_prime_get_sg_table, > .vmap = qxl_gem_prime_vmap, > .vunmap = qxl_gem_prime_vunmap, > + .print_info = drm_gem_ttm_print_info, > }; > > int qxl_bo_create(struct qxl_device *qdev, > -- Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg) signature.asc Description: OpenPGP digital signature
Re: [PATCH 1/2] drm/panel: Add DT bindings for Sony ACX424AKP
On Mon, Sep 02, 2019 at 01:44:38PM +0200, Linus Walleij wrote: > On Mon, Sep 2, 2019 at 11:35 AM Thierry Reding > wrote: > > > > + dsi-command-mode: > > > + type: boolean > > > + description: > > > + If this is specified, the panel will be used in command > > > + mode instead of video mode. > > > > I'm not sure there's concensus on this one yet. I think so far the > > driver decides which mode to use the panel in. Technically this falls > > into the category of configuration, so it doesn't really belong in the > > DT. > > The way we've used DT is for a bit of both hardware description > and configuration I'd say, but I'm no authority on the subject. > > > I vaguely recall from discussions I've had on this subject that there's > > usually no reason to do video mode if you can do command mode because > > command mode is more power efficient. This was a long time ago, so I may > > be misremembering. Perhaps you have different information on this? > > No idea. I was under the impression that video mode was preferred > but I have no idea why. Hm... my recollection is that command mode is only supported on "smart" panels that have an internal framebuffer. So the commands actually instruct the panel to update their internal framebuffer, which means you can technically switch off the display engine when there are no updates. Under those circumstances I think it'd make sense to default to command mode if both the panel and the host support it and stick with video mode if for example the host can't do command mode. Or perhaps this is something that could be set from some userspace policy maker via a connector property? A compositor for instance would have a pretty good idea of what kind of activity is going on, so it could at some point decide to switch between video mode and command mode if one of them is more appropriate for the given workload. Command mode can also be used to do partial updates, if I remember correctly, which again would make it possible for a compositor to send only a subset of a screen update. Thierry signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 4/5] drm/qxl: use drm_gem_object_funcs callbacks
This patch seems unrelated. Am 02.09.19 um 14:41 schrieb Gerd Hoffmann: > Switch qxl to use drm_gem_object_funcs callbacks > instead of drm_driver callbacks. > > Signed-off-by: Gerd Hoffmann > --- > drivers/gpu/drm/qxl/qxl_drv.c| 8 > drivers/gpu/drm/qxl/qxl_object.c | 12 > 2 files changed, 12 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c > index 2b726a51a302..996d428fa7e6 100644 > --- a/drivers/gpu/drm/qxl/qxl_drv.c > +++ b/drivers/gpu/drm/qxl/qxl_drv.c > @@ -258,16 +258,8 @@ static struct drm_driver qxl_driver = { > #endif > .prime_handle_to_fd = drm_gem_prime_handle_to_fd, > .prime_fd_to_handle = drm_gem_prime_fd_to_handle, > - .gem_prime_pin = qxl_gem_prime_pin, > - .gem_prime_unpin = qxl_gem_prime_unpin, > - .gem_prime_get_sg_table = qxl_gem_prime_get_sg_table, > .gem_prime_import_sg_table = qxl_gem_prime_import_sg_table, > - .gem_prime_vmap = qxl_gem_prime_vmap, > - .gem_prime_vunmap = qxl_gem_prime_vunmap, > .gem_prime_mmap = qxl_gem_prime_mmap, > - .gem_free_object_unlocked = qxl_gem_object_free, > - .gem_open_object = qxl_gem_object_open, > - .gem_close_object = qxl_gem_object_close, > .fops = &qxl_fops, > .ioctls = qxl_ioctls, > .irq_handler = qxl_irq_handler, > diff --git a/drivers/gpu/drm/qxl/qxl_object.c > b/drivers/gpu/drm/qxl/qxl_object.c > index 548dfe6f3b26..29aab7b14513 100644 > --- a/drivers/gpu/drm/qxl/qxl_object.c > +++ b/drivers/gpu/drm/qxl/qxl_object.c > @@ -77,6 +77,17 @@ void qxl_ttm_placement_from_domain(struct qxl_bo *qbo, u32 > domain, bool pinned) > } > } > > +static const struct drm_gem_object_funcs qxl_object_funcs = { > + .free = qxl_gem_object_free, > + .open = qxl_gem_object_open, > + .close = qxl_gem_object_close, > + .pin = qxl_gem_prime_pin, > + .unpin = qxl_gem_prime_unpin, > + .get_sg_table = qxl_gem_prime_get_sg_table, > + .vmap = qxl_gem_prime_vmap, > + .vunmap = qxl_gem_prime_vunmap, > +}; > + > int qxl_bo_create(struct qxl_device *qdev, > unsigned long size, bool kernel, bool pinned, u32 domain, > struct qxl_surface *surf, > @@ -100,6 +111,7 @@ int qxl_bo_create(struct qxl_device *qdev, > kfree(bo); > return r; > } > + bo->tbo.base.funcs = &qxl_object_funcs; > bo->type = domain; > bo->pin_count = pinned ? 1 : 0; > bo->surface_id = 0; > -- Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg) signature.asc Description: OpenPGP digital signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/5] drm/vram: add vram-mm debugfs file
Hi Am 02.09.19 um 14:41 schrieb Gerd Hoffmann: > Wire up drm_mm_print() for vram helpers, using a new > debugfs file, so one can see how vram is used: > ># cat /sys/kernel/debug/dri/0/vram-mm >0x-0x0300: 768: used >0x0300-0x0600: 768: used >0x0600-0x0900: 768: used >0x0900-0x0c00: 768: used >0x0c00-0x4000: 13312: free >total: 16384, used 3072 free 13312 > > Signed-off-by: Gerd Hoffmann > --- > include/drm/drm_gem_vram_helper.h| 1 + > include/drm/drm_vram_mm_helper.h | 1 + > drivers/gpu/drm/drm_vram_mm_helper.c | 33 > 3 files changed, 35 insertions(+) > > diff --git a/include/drm/drm_gem_vram_helper.h > b/include/drm/drm_gem_vram_helper.h > index 17f160dd6e7d..d48fdf90b254 100644 > --- a/include/drm/drm_gem_vram_helper.h > +++ b/include/drm/drm_gem_vram_helper.h > @@ -123,6 +123,7 @@ int drm_gem_vram_driver_dumb_mmap_offset(struct drm_file > *file, > * &struct drm_driver with default functions. > */ > #define DRM_GEM_VRAM_DRIVER \ > + .debugfs_init = drm_vram_mm_debugfs_init, \ This line seems to be the reason for putting the include statement into the header in patch [2/5]. I suggest to merge both patches into one. > .dumb_create = drm_gem_vram_driver_dumb_create, \ > .dumb_map_offset = drm_gem_vram_driver_dumb_mmap_offset, \ > .gem_prime_mmap = drm_gem_prime_mmap > diff --git a/include/drm/drm_vram_mm_helper.h > b/include/drm/drm_vram_mm_helper.h > index 2aacfb1ccfae..9e0ac9aaac7d 100644 > --- a/include/drm/drm_vram_mm_helper.h > +++ b/include/drm/drm_vram_mm_helper.h > @@ -60,6 +60,7 @@ static inline struct drm_vram_mm *drm_vram_mm_of_bdev( > return container_of(bdev, struct drm_vram_mm, bdev); > } > > +int drm_vram_mm_debugfs_init(struct drm_minor *minor); I cannot find a caller of this function. Will this be called form drm_debugfs_init()? > int drm_vram_mm_init(struct drm_vram_mm *vmm, struct drm_device *dev, >uint64_t vram_base, size_t vram_size, >const struct drm_vram_mm_funcs *funcs); > diff --git a/drivers/gpu/drm/drm_vram_mm_helper.c > b/drivers/gpu/drm/drm_vram_mm_helper.c > index c911781d6728..486061b83a73 100644 > --- a/drivers/gpu/drm/drm_vram_mm_helper.c > +++ b/drivers/gpu/drm/drm_vram_mm_helper.c > @@ -1,7 +1,9 @@ > // SPDX-License-Identifier: GPL-2.0-or-later > > +#include > #include > #include > +#include > #include > > #include > @@ -148,6 +150,37 @@ static struct ttm_bo_driver bo_driver = { > * struct drm_vram_mm > */ > > +#if defined(CONFIG_DEBUG_FS) > +static int drm_vram_mm_debugfs(struct seq_file *m, void *data) > +{ > + struct drm_info_node *node = (struct drm_info_node *) m->private; > + struct drm_vram_mm *vmm = node->minor->dev->vram_mm; > + struct drm_mm *mm = vmm->bdev.man[TTM_PL_VRAM].priv; > + struct ttm_bo_global *glob = vmm->bdev.glob; > + struct drm_printer p = drm_seq_file_printer(m); > + > + spin_lock(&glob->lru_lock); > + drm_mm_print(mm, &p); > + spin_unlock(&glob->lru_lock); > + return 0; > +} > + > +static struct drm_info_list drm_vram_mm_debugfs_list[] = { Can this be made 'static const'? > + { "vram-mm", drm_vram_mm_debugfs, 0, NULL }, > +}; > +#endif > + > +int drm_vram_mm_debugfs_init(struct drm_minor *minor) Documentation is missing. With these points addressed Acked-by: Thomas Zimmermann Best regards Thomas > +{ > +#if defined(CONFIG_DEBUG_FS) > + drm_debugfs_create_files(drm_vram_mm_debugfs_list, > + ARRAY_SIZE(drm_vram_mm_debugfs_list), > + minor->debugfs_root, minor); > +#endif > + return 0; > +} > +EXPORT_SYMBOL(drm_vram_mm_debugfs_init); > + > /** > * drm_vram_mm_init() - Initialize an instance of VRAM MM. > * @vmm: the VRAM MM instance to initialize > -- Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg) signature.asc Description: OpenPGP digital signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/2] drm/panel: Add driver for Sony ACX424AKP panel
On Mon, Sep 02, 2019 at 02:57:25PM +0200, Linus Walleij wrote: > On Mon, Sep 2, 2019 at 12:32 PM Thierry Reding > wrote: > > On Mon, Sep 02, 2019 at 11:06:33AM +0200, Linus Walleij wrote: > > > > + /* > > > + * This depends on the clocking HS vs LP rate, this value > > > + * is calculated as: > > > + * vrefresh = (clock * 1000) / (htotal*vtotal) > > > + */ > > > + .vrefresh = 816, > > > > That's a bit odd. My understanding is that command mode can be done in > > continuous mode or in non-continuous mode. In continuous mode you would > > typically achieve a similar refresh rate as in video mode. For non- > > continuous mode you basically have a variable refresh rate. > > > > For continuous mode you probably want 60 Hz here and for VRR there's > > probably no sensible value to set this to. In the latter case, I don't > > think it makes sense to set anything arbitrary like you have above. > > Perhaps better to just set it to 0 as a way of signalling that this is > > actually dependent on when the display hardware sends a new frame? > > I guess I should set it to 60. Not sure, perhaps someone on the list has a good idea of what vrefresh is set for VRR monitors. I think that'd be a good example to follow. I'm also not sure your formula to compute the refresh rate is good for command mode. You're assuming one pixel per clock cycle. I don't think that's accurate. Shouldn't that at least depend also on the number of lanes and the pixel format? 816 frames per second also seems a bit much for any type of panel. > > Have you actually run this is command mode? > > Yes that is what I am primarily using. > > > If so, what's the actual > > refresh rate? Do you do on-demand updates or do you run in continuous > > mode? > > I run continuous mode, so the refresh rate is essentially dependent on > the HS frequency that the host uses. For command mode we use as > fast as it can go which is 420MHz, backwards calculated to ~816Hz > updates. > > I took some data from the system when running: > 175608 "vblank" interrupts in 25 minutes, yielding > 175608/(25*60) ~= 117 Hz so I guess that is the pace the > hardware actually recieves it and triggers new updates. That's a factor of almost 8, so I think there's something really wrong in your refresh rate calculation, or you have an issue somewhere in the code that computes the pixel clock and byte clock from the mode's clock rate. > > > > + ret = mipi_dsi_dcs_read(dsi, 0xda, &id1, len); > > > + if (ret < 0) { > > > + DRM_DEV_ERROR(acx->dev, "could not read device ID byte > > > 1\n"); > > > + return ret; > > > + } > > > + ret = mipi_dsi_dcs_read(dsi, 0xdb, &id2, len); > > > + if (ret < 0) { > > > + DRM_DEV_ERROR(acx->dev, "could not read device ID byte > > > 2\n"); > > > + return ret; > > > + } > > > + ret = mipi_dsi_dcs_read(dsi, 0xdc, &id3, len); > > > + if (ret < 0) { > > > + DRM_DEV_ERROR(acx->dev, "could not read device ID byte > > > 3\n"); > > > + return ret; > > > + } > > > + > > > + val = (id3 << 8) | id2; > > > > Don't you want to OR in id1 here as well? Seems a bit odd to read it but > > then not use it. > > The way I have understood these "MTP IDs" is that the first byte > should just be checked for not being 0 so I will add a check like that. > > The only other DSI panel doing this is panel-samsung-s6e8aa0.c function > s6e8aa0_read_mtp_id() which also reads three bytes and ignores the > first byte, also the second byte being version and the third ID matches > the data this display returns. > > I'll try to make it a bit clearer and inspect the individual bytes since they > seem to have individual meanings. I vaguely recall MTP IDs. It's a little funny that both S6E8AA0 and this new driver seem to be reading the same type of ID, but using different DCS register offsets. I had hoped that these would be somewhat standardized. Or perhaps these are standardized as part of a larger type of descriptor to which an offset is read from somewhere else? > > > + struct device *dev = &dsi->dev; > > > + struct acx424akp *acx; > > > + int ret; > > > + int i; > > > > unsigned int? > > Just following the common idiom for integer enumerator i to be a > plain int but sure, if you prefer :) The common idiom is wrong. =) Jokes aside, why worry about the sign if you know up front that your values are never going to be negative? If you consistently use unsigned types for values that can never be negative, the compiler will even be able to point out inconsistent usage, etc. Thierry > > > + /* Read device ID */ > > > + i = 0; > > > + do { > > > + ret = acx424akp_read_id(acx); > > > + if (ret) > > > + continue; > > > + } while (ret && i++ < 5); > > > > Seems rather redundant to have both an "if (ret) continue;" and the ret > > check in the while's condition. A mo
[PATCH v2] drm: Add high-precision time to vblank trace event
Store the timestamp of the current vblank in the new field 'time' of the vblank trace event. If the timestamp is calculated by a driver that supports high-precision vblank timing, set the field 'high-prec' to 'true'. User space can now access actual hardware vblank times via the tracing infrastructure. Tracing applications (such as GPUVis, see [0] for related discussion), can use the newly added information to conduct a more accurate analysis of display timing. v2 Fix author name (missing last name) [0] https://github.com/mikesart/gpuvis/issues/30 Reviewed-by: Daniel Vetter Signed-off-by: Heinrich Fink --- drivers/gpu/drm/drm_trace.h | 14 ++ drivers/gpu/drm/drm_vblank.c | 3 ++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/drm_trace.h b/drivers/gpu/drm/drm_trace.h index 471eb927474b..11c6dd577e8e 100644 --- a/drivers/gpu/drm/drm_trace.h +++ b/drivers/gpu/drm/drm_trace.h @@ -13,17 +13,23 @@ struct drm_file; #define TRACE_INCLUDE_FILE drm_trace TRACE_EVENT(drm_vblank_event, - TP_PROTO(int crtc, unsigned int seq), - TP_ARGS(crtc, seq), + TP_PROTO(int crtc, unsigned int seq, ktime_t time, bool high_prec), + TP_ARGS(crtc, seq, time, high_prec), TP_STRUCT__entry( __field(int, crtc) __field(unsigned int, seq) + __field(ktime_t, time) + __field(bool, high_prec) ), TP_fast_assign( __entry->crtc = crtc; __entry->seq = seq; - ), - TP_printk("crtc=%d, seq=%u", __entry->crtc, __entry->seq) + __entry->time = time; + __entry->high_prec = high_prec; + ), + TP_printk("crtc=%d, seq=%u, time=%lld, high-prec=%s", + __entry->crtc, __entry->seq, __entry->time, + __entry->high_prec ? "true" : "false") ); TRACE_EVENT(drm_vblank_event_queued, diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c index fd1fbc77871f..c99feda25dea 100644 --- a/drivers/gpu/drm/drm_vblank.c +++ b/drivers/gpu/drm/drm_vblank.c @@ -1731,7 +1731,8 @@ static void drm_handle_vblank_events(struct drm_device *dev, unsigned int pipe) send_vblank_event(dev, e, seq, now); } - trace_drm_vblank_event(pipe, seq); + trace_drm_vblank_event(pipe, seq, now, + dev->driver->get_vblank_timestamp != NULL); } /** -- 2.23.0.rc1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm: Add high-precision time to vblank trace event
Thanks for the review, Daniel. I noticed that my last name was missing in the initial revision (my git config was messed up). I am sending v2 of this patch to fix this, including your r/b tag. Cheers, Heinrich ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/5] drm/vram: use drm_gem_ttm_print_info
Hi Am 02.09.19 um 14:41 schrieb Gerd Hoffmann: > Signed-off-by: Gerd Hoffmann > --- > include/drm/drm_gem_vram_helper.h | 1 + > drivers/gpu/drm/drm_gem_vram_helper.c | 3 ++- > drivers/gpu/drm/Kconfig | 1 + > 3 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/include/drm/drm_gem_vram_helper.h > b/include/drm/drm_gem_vram_helper.h > index ac217d768456..17f160dd6e7d 100644 > --- a/include/drm/drm_gem_vram_helper.h > +++ b/include/drm/drm_gem_vram_helper.h > @@ -4,6 +4,7 @@ > #define DRM_GEM_VRAM_HELPER_H > > #include > +#include Why is this include statement in the header file instead of the source file? > #include > #include > #include /* for container_of() */ > diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c > b/drivers/gpu/drm/drm_gem_vram_helper.c > index fd751078bae1..b4929e1fb190 100644 > --- a/drivers/gpu/drm/drm_gem_vram_helper.c > +++ b/drivers/gpu/drm/drm_gem_vram_helper.c > @@ -633,5 +633,6 @@ static const struct drm_gem_object_funcs > drm_gem_vram_object_funcs = { > .pin= drm_gem_vram_object_pin, > .unpin = drm_gem_vram_object_unpin, > .vmap = drm_gem_vram_object_vmap, > - .vunmap = drm_gem_vram_object_vunmap > + .vunmap = drm_gem_vram_object_vunmap, > + .print_info = drm_gem_ttm_print_info, > }; > diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig > index f7b25519f95c..1be8ad30d8fe 100644 > --- a/drivers/gpu/drm/Kconfig > +++ b/drivers/gpu/drm/Kconfig > @@ -169,6 +169,7 @@ config DRM_VRAM_HELPER > tristate > depends on DRM > select DRM_TTM > + select DRM_TTM_HELPER I thought that VRAM helpers already depend on TTM helpers. If so, this line should rather be a separate patch with a Fixes tag to the patch that introduced the dependency. With these points addressed: Acked-by: Thomas Zimmermann Best regards Thomas > help > Helpers for VRAM memory management > > -- Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg) signature.asc Description: OpenPGP digital signature
Re: [PATCH 1/5] drm/ttm: add drm_gem_ttm_print_info()
Hi Acked-by: Thomas Zimmermann But please see below. Am 02.09.19 um 14:41 schrieb Gerd Hoffmann: > Now with ttm_buffer_object being a subclass of drm_gem_object we can > easily lookup ttm_buffer_object for a given drm_gem_object, which in > turm allows to create common helper functions. s/trum/trun > > This patch starts off with a drm_gem_ttm_print_info() helper function > which prints adds some ttm specific lines to the debug output. > > Signed-off-by: Gerd Hoffmann > --- > include/drm/drm_gem_ttm_helper.h | 19 > drivers/gpu/drm/drm_gem_ttm_helper.c | 67 > Documentation/gpu/drm-mm.rst | 12 + > drivers/gpu/drm/Kconfig | 7 +++ > drivers/gpu/drm/Makefile | 3 ++ > 5 files changed, 108 insertions(+) > create mode 100644 include/drm/drm_gem_ttm_helper.h > create mode 100644 drivers/gpu/drm/drm_gem_ttm_helper.c > > diff --git a/include/drm/drm_gem_ttm_helper.h > b/include/drm/drm_gem_ttm_helper.h > new file mode 100644 > index ..6268f89c5a48 > --- /dev/null > +++ b/include/drm/drm_gem_ttm_helper.h > @@ -0,0 +1,19 @@ > +/* SPDX-License-Identifier: GPL-2.0-or-later */ > + > +#ifndef DRM_GEM_TTM_HELPER_H > +#define DRM_GEM_TTM_HELPER_H > + > +#include > + > +#include > +#include > +#include > +#include > + > +#define drm_gem_ttm_of_gem(gem_obj) \ > + container_of(gem_obj, struct ttm_buffer_object, base) > + > +void drm_gem_ttm_print_info(struct drm_printer *p, unsigned int indent, > + const struct drm_gem_object *gem); > + > +#endif > diff --git a/drivers/gpu/drm/drm_gem_ttm_helper.c > b/drivers/gpu/drm/drm_gem_ttm_helper.c > new file mode 100644 > index ..cd6ac2cc8fdd > --- /dev/null > +++ b/drivers/gpu/drm/drm_gem_ttm_helper.c > @@ -0,0 +1,67 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > + > +#include > + > +#include > + > +/** > + * DOC: overview > + * > + * This library provides helper functions for gem objects backed by > + * ttm. > + */ > + > +/** > + * drm_gem_ttm_print_info() - Print &ttm_buffer_object info for debugfs > + * @p: DRM printer > + * @indent: Tab indentation level > + * @gem: GEM object > + * > + * This function can be used as the &drm_driver->gem_print_info callback. > + */ > +void drm_gem_ttm_print_info(struct drm_printer *p, unsigned int indent, > + const struct drm_gem_object *gem) > +{ > + static const char *plname[] = { The array and the strings should be declared const. IIRC something like static const char * const plname[] = { > + [ TTM_PL_SYSTEM ] = "system", > + [ TTM_PL_TT ] = "tt", > + [ TTM_PL_VRAM ] = "vram", > + [ TTM_PL_PRIV ] = "priv", > + This 'gap' in the array seems to be a problem for drivers that use these bits. Could the print logic be moved into s separate function that also takes the array as an argument? Best regards Thomas > + [ 16 ]= "cached", > + [ 17 ]= "uncached", > + [ 18 ]= "wc", > + [ 19 ]= "contig", > + > + [ 21 ]= "pinned", /* NO_EVICT */ > + [ 22 ]= "topdown", > + }; > + const struct ttm_buffer_object *bo = drm_gem_ttm_of_gem(gem); > + bool first = true; > + unsigned int i; > + > + for (i = 0; i < ARRAY_SIZE(plname); i++) { > + if (!(bo->mem.placement & (1 << i))) > + continue; > + if (!plname[i]) > + continue; > + if (first) { > + first = false; > + drm_printf_indent(p, indent, "placement=%s", plname[i]); > + } else > + drm_printf(p, ",%s", plname[i]); > + } > + if (!first) > + drm_printf(p, "\n"); > + > + if (bo->mem.bus.is_iomem) { > + drm_printf_indent(p, indent, "bus.base=%lx\n", > + (unsigned long)bo->mem.bus.base); > + drm_printf_indent(p, indent, "bus.offset=%lx\n", > + (unsigned long)bo->mem.bus.offset); > + } > +} > +EXPORT_SYMBOL(drm_gem_ttm_print_info); > + > +MODULE_DESCRIPTION("DRM gem ttm helpers"); > +MODULE_LICENSE("GPL"); > diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst > index b664f054c259..a70a1d9f30ec 100644 > --- a/Documentation/gpu/drm-mm.rst > +++ b/Documentation/gpu/drm-mm.rst > @@ -412,6 +412,18 @@ VRAM MM Helper Functions Reference > .. kernel-doc:: drivers/gpu/drm/drm_vram_mm_helper.c > :export: > > +GEM TTM Helper Functions Reference > +--- > + > +.. kernel-doc:: drivers/gpu/drm/drm_gem_ttm_helper.c > + :doc: overview > + > +.. kernel-doc:: include/drm/drm_gem_ttm_helper.h > + :internal: > + > +.. kernel-doc:: drivers/gpu/drm/drm_gem_ttm_helper.c > + :export: > + > VMA Offset Manager > ==
Adreno crash on i.MX53 running 5.3-rc6
Hi, I am getting the following crash when booting the adreno driver on i.MX53 running a 5.3-rc6 kernel. Such error does not happen with 5.2 though. Before I start running a bisect, I am wondering if anyone has any ideas about this issue. Thanks, Fabio Estevam [2.083249] 8<--- cut here --- [2.086460] Unable to handle kernel paging request at virtual address 50001000 [2.094174] pgd = (ptrval) [2.096911] [50001000] *pgd= [2.100606] Internal error: Oops: 805 [#1] SMP ARM [2.105412] Modules linked in: [2.108487] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.3.0-rc6-00271-g9f159ae07f07 #4 [2.116411] Hardware name: Freescale i.MX53 (Device Tree Support) [2.122538] PC is at v7_dma_clean_range+0x20/0x38 [2.127254] LR is at __dma_page_cpu_to_dev+0x28/0x90 [2.132226] pc : []lr : []psr: 2013 [2.138500] sp : d80b5a88 ip : de96c000 fp : d840ce6c [2.143732] r10: r9 : 0001 r8 : d843e010 [2.148964] r7 : r6 : 8000 r5 : ddb6c000 r4 : [2.155500] r3 : 003f r2 : 0040 r1 : 50008000 r0 : 50001000 [2.162037] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [2.169180] Control: 10c5387d Table: 70004019 DAC: 0051 [2.174934] Process swapper/0 (pid: 1, stack limit = 0x(ptrval)) [2.180949] Stack: (0xd80b5a88 to 0xd80b6000) [2.185319] 5a80: c011c7bc d8491780 d840ce6c d849b380 c011822c [2.193509] 5aa0: c0d01a18 c0118abc c0118a78 d84a0200 0008 c1308908 d838e800 d849a4a8 [2.201697] 5ac0: d8491780 c06699b4 d8491600 d80b5b20 d84a0200 [2.209886] 5ae0: d8491780 d8491600 d80b5b20 d8491600 d849a4a8 d84a0200 0003 d84a0358 [2.218077] 5b00: c1308908 d8491600 d849a4a8 d8491780 d840ce6c c066a55c c1308908 c066a104 [2.226266] 5b20: 01001000 d84a0200 10700ac6 d849a480 d84a0200 d8491600 [2.234455] 5b40: e0845000 c1308908 c066a72c d849a480 d840ce6c d840ce00 c1308908 [2.242643] 5b60: c066b584 d849a488 d849a4a8 c1308908 d840ce6c c066ff40 [2.250832] 5b80: d849a488 d849a4a8 c1308908 d81b4000 e0845000 [2.259021] 5ba0: d838e800 c1308908 d8491600 10700ac6 d80b5bc8 d840ce00 d840ce6c 0001 [2.267210] 5bc0: e0845000 d838e800 c066ece4 0100 10ff [2.275399] 5be0: c1308908 0001 d81b4000 0100 0001 10700ac6 [2.283587] 5c00: c0d6d564 d840ce00 d81b4010 0001 d81b4000 c0d6d564 c1308908 d80b5c48 [2.291777] 5c20: d838e800 c061f9cc c1029dec d80b5c48 d838e800 c13e8788 [2.299965] 5c40: c1308928 c102a234 0100 10ff [2.308154] 5c60: 0001 a013 10700ac6 c13b7658 d840ce00 d838e800 d81b4000 [2.316343] 5c80: d840ce00 c1308908 0002 d838f800 c0620514 0001 10700ac6 [2.324531] 5ca0: d8496440 d81b4010 c1aa1c00 d838e800 c061e070 [2.332720] 5cc0: c0d6c534 df56cf34 00c8 10700ac6 d81b4010 [2.340909] 5ce0: d8496440 d838e800 c103acd0 d8496280 c1380488 c06a3e10 [2.349097] 5d00: d838f800 d838e800 d843e010 d8496440 c1308908 [2.357286] 5d20: d83f9640 c1380488 c0668554 0006 0007 c13804d4 d83f9640 [2.365475] 5d40: c1380488 c017ec18 d80c c0c43e40 d843e010 d8496440 0001 c0182a94 [2.373665] 5d60: 6013 10700ac6 d843e010 d8496280 d8496400 0018 d8496440 0001 [2.381854] 5d80: c13804d4 d83f9640 c1380488 c06a4280 c1380488 c0d764f8 d8496440 [2.390044] 5da0: c1380488 d843e010 c0d764f8 c1308908 c13ef300 c06a44f0 [2.398232] 5dc0: c0d8a0dc dffcc6f0 d843e010 dffcc6f0 d843e010 c06680b8 [2.406421] 5de0: d84988c0 d83f9640 d84988c0 d84989a0 d8498230 10700ac6 0001 d843e010 [2.414610] 5e00: c137eec0 c137eec0 c13ef300 c06ac1a0 [2.422799] 5e20: d843e010 c1aa40dc c1aa40e0 c137eec0 c06aa014 d843e010 c137eec0 [2.430988] 5e40: c137eec0 c1308908 c13e9880 c13e85d4 c06aa368 c1308908 c13e9880 [2.439178] 5e60: c13e85d4 d843e010 c137eec0 c1308908 c13e9880 c13e85d4 c06aa618 [2.447367] 5e80: c137eec0 d843e010 c06aa6a4 c137eec0 c06aa620 c06a844c [2.46] 5ea0: d80888d4 d80888a4 d84914d0 10700ac6 d80888d4 c137eec0 d8494f00 c1380d28 [2.463745] 5ec0: c06a946c c105f3d4 c1308908 c137eec0 c1308908 [2.471934] 5ee0: c125fdd0 c06ab304 c1308928 c1308908 c0103178 0109 [2.480123] 5f00: dc6e dc00 c1126860 0109 0109 c014dc88 c11253ac c10607a0 [2.488312] 5f20: 0006 0006 c12adeec dc6e 10700ac6 [2.496501] 5f40: c1308f18 10700ac6 0007 c13e9880 c13ef300 c1294850 c1
[Bug 110659] pageflipping seems to cause jittering on mouse input when running Hitman 2 in Wine/DXVK with amdgpu.dc=1
https://bugs.freedesktop.org/show_bug.cgi?id=110659 --- Comment #62 from tempel.jul...@gmail.com --- I could reproduce the issue on a system with a Radeon RX 5700 XT Navi 10 GPU + drm-next kernel in Hitman 2. Really devastating. -- 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 1/2] dt-bindings: display/bridge: Add binding for NWL mipi dsi host controller
On Fri, 30 Aug 2019 14:58:21 +0200, =?UTF-8?q?Guido=20G=C3=BCnther?= wrote: > The Northwest Logic MIPI DSI IP core can be found in NXPs i.MX8 SoCs. > > Signed-off-by: Guido Günther > Tested-by: Robert Chiras > --- > .../bindings/display/bridge/nwl-dsi.yaml | 176 ++ > 1 file changed, 176 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/display/bridge/nwl-dsi.yaml > Reviewed-by: Rob Herring ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v5, 05/32] dt-bindings: mediatek: add mutex description for mt8183 display
On Thu, 29 Aug 2019 22:50:27 +0800, wrote: > From: Yongqiang Niu > > This patch add mutex description for mt8183 display > > Signed-off-by: Yongqiang Niu > --- > Documentation/devicetree/bindings/display/mediatek/mediatek,disp.txt | 1 + > 1 file changed, 1 insertion(+) > Acked-by: Rob Herring ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC][PATCH] drm: kirin: Fix dsi probe/attach logic
On 30.08.2019 19:00, Rob Clark wrote: > On Thu, Aug 29, 2019 at 11:52 PM Andrzej Hajda wrote: >> On 29.08.2019 19:39, Rob Clark wrote: >>> On Wed, Aug 28, 2019 at 11:06 PM John Stultz wrote: Since commit 83f35bc3a852 ("drm/bridge: adv7511: Attach to DSI host at probe time") landed in -next the HiKey board would fail to boot, looping: >>> No, please revert 83f35bc3a852.. that is going in the *complete* wrong >>> direction. We actually should be moving panels to not require dsi >>> host until attach time, similar to how bridges work, not the other way >>> around. >> >> Devices of panels and bridges controlled via DSI will not appear at all >> if DSI host is not created. >> >> So this is the only direction!!! >> > I disagree, there is really no harm in the bridge probing if there is no dsi. > > Furthermore, it seems that this change broke a few other drivers. If the bridge/panel is controlled via dsi, it will not be probed at all if DSI host/bus is not created, so it will not work at all. Upstream device will wait forever for downstream drm_(panel|bridge). So IMO we just do not have choice here. If you know better alternative let us know, otherwise we should proceed with "drm: kirin: Fix dsi probe/attach logic" patch. > >>> The problem is that, when dealing with bootloader enabled display, we >>> need to be really careful not to touch the hardware until the display >>> driver knows the bridge/panel is present. If the bridge/panel probes >>> after the display driver, we could end up killing scanout >>> (efifb/simplefb).. if the bridge/panel is missing some dependency and >>> never probes, it is rather unpleasant to be stuck trying to debug what >>> went wrong with no display. >> >> It has nothing to do with touching hardware, you can always (I hope) >> postpone it till all components are present. > Unfortunately this is harder than it sounds, since we need to read hw > revision registers for display and dsi blocks to know which hw > revision we are dealing with. > > (Also, we need to avoid > drm_fb_helper_remove_conflicting_framebuffers() until we know we are > ready to go.) > > We could possibly put more information in dt. But the less we depend > on dt, the easier time we'll have adding support for ACPI boot on the > windows arm laptops. > >> But it is just requirement of device/driver model in Linux Kernel. > yes and no.. the way the existing bridges work with a bridge->attach() > step seems fairly pragmatic to me. > >>> Sorry I didn't notice that adv7511 patch before it landed, but the >>> right thing to do now is to revert it. >> >> The 1st version of the patch was posted at the end of April and final >> version was queued 1st July, so it was quite long time for discussions >> and tests. > sorry I didn't notice the patch sooner, most of my bandwidth goes to mesa. > >> Reverting it now seems quite late, especially if the patch does right >> thing and there is already proper fix for one encoder (kirin), moreover >> revert will break another platforms. > kirin isn't the only other user of adv75xx.. at least it is my > understanding that this broke db410c as well. > >> Of course it seems you have different opinion what is the right thing in >> this case, so if you convince us that your approach is better one can >> revert the patch. > I guess my strongest / most immediate opinion is to not break other > existing adv75xx bridge users. It is pity that breakage happened, and next time we should be more strict about testing other platforms, before patch acceptance. But reverting it now will break also platform which depend on it. Anyway the old order was incorrect and prevented other users from adv* driver usage, so it should be fixed anyway. > Beyond that, I found doing mipi_dsi_attach() in bridge->attach() was > quite convenient to get display handover from efifb work. And that > was (previously) the way most of the bridges worked. > > But maybe there is another way.. perhaps somehow the bridges/panels > could be added as sub-components using the component framework, to > prevent the toplevel drm device from probing until they are ready? If you mean 'probe' as in initialization from component_master::bind callback with this patch it still works, DSI-HOST calls component_add after drm_bridge is found. > We'd still have the problem that the dsi component wants to be able to > read hw revision before registering dsi host.. but I suppose if CCF > exported a way that we could query whether the interface clk was > already enabled, we could have the clk enable/disable cycle that would > break efifb. I am not familiar with efifb, if you describe the issue you have in more detail we can try to find some solution together. Regards Andrzej > > BR, > -R > > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/3] drm/edid: no CEA extension is not an error
On Mon, Sep 02, 2019 at 01:55:21PM +0200, Jean Delvare wrote: > On Mon, 2 Sep 2019 14:46:51 +0300, Ville Syrjälä wrote: > > On Fri, Aug 30, 2019 at 06:16:52PM +0200, Jean Delvare wrote: > > > It is fine for displays without audio functionality to not implement > > > CEA extension in their EDID. Do not return an error in that case, > > > instead return 0 as if there was a CEA extension with no audio or > > > speaker block. > > > > > > This fixes half of bug fdo#107825: > > > https://bugs.freedesktop.org/show_bug.cgi?id=107825 > > > > > > Signed-off-by: Jean Delvare > > > Cc: Maarten Lankhorst > > > Cc: Maxime Ripard > > > Cc: Sean Paul > > > Cc: David Airlie > > > Cc: Daniel Vetter > > > --- > > > drivers/gpu/drm/drm_edid.c |4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > --- linux-5.2.orig/drivers/gpu/drm/drm_edid.c 2019-08-30 > > > 17:57:38.10995 +0200 > > > +++ linux-5.2/drivers/gpu/drm/drm_edid.c 2019-08-30 18:04:36.840333834 > > > +0200 > > > @@ -4130,7 +4130,7 @@ int drm_edid_to_sad(struct edid *edid, s > > > cea = drm_find_cea_extension(edid); > > > if (!cea) { > > > DRM_DEBUG_KMS("SAD: no CEA Extension found\n"); > > > - return -ENOENT; > > > + return 0; > > > } > > > > Seems reasonable. Maybe the cea_revision<3 branches should alse return 0? > > I wasn't sure about that one, as I'm not familiar with this CEA > extension thing. > > If revision < 3 means the data is invalid then returning an error is > fine. If on the other hand revision < 3 simply means that the block > types we are looking for were not defined back then yes returning 0 > instead would be better. That is indeed the case. A quick read through the code showed that we're not 100% consistent in checing for that though. I just send a few patches to fix that up. -- Ville Syrjälä Intel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 1/2] drm/edid: Don't look for CEA data blocks in CEA ext block rev < 3
From: Ville Syrjälä CEA ext block revisions 1 and 2 do not contain the data block collection. Instead that section of the extension block is marked as reserved for 8 byte timing descriptors. Revision 3 changed it to contain the CEA data block collection instead. Most places that iterate the data blocks already check for revision >= 3, but drm_detect_hdmi_monitor() and drm_detect_monitor_audio() do not. So in theory when encountering rev 1 or 2 CEA extension block they could end up misinterpreting whatever data is in the reserved section as CEA data blocks. Let's have cea_db_offsets() do the revision check so that the callers don't even have worry about it. Cc: Jean Delvare Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_edid.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 82a4ceed3fcf..7b3072fc550b 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3690,6 +3690,9 @@ cea_revision(const u8 *cea) static int cea_db_offsets(const u8 *cea, int *start, int *end) { + if (cea_revision(cea) < 3) + return -ENOTSUPP; + /* DisplayID CTA extension blocks and top-level CEA EDID * block header definitions differ in the following bytes: * 1) Byte 2 of the header specifies length differently, -- 2.21.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/2] drm/edid: Have cea_db_offsets() zero start/end when the data block collection isn't found
From: Ville Syrjälä Let's make cea_db_offsets() a bit more convenient to use by setting the start/end offsets to zero whenever the data block collection isn't present. This makes it safe for the caller to blindly iterate the data blocks even if there are none. Cc: Jean Delvare Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_edid.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 7b3072fc550b..e5905dc764c1 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3690,6 +3690,9 @@ cea_revision(const u8 *cea) static int cea_db_offsets(const u8 *cea, int *start, int *end) { + *start = 0; + *end = 0; + if (cea_revision(cea) < 3) return -ENOTSUPP; @@ -4116,10 +4119,7 @@ static void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) if (cea_revision(cea) >= 3) { int i, start, end; - if (cea_db_offsets(cea, &start, &end)) { - start = 0; - end = 0; - } + cea_db_offsets(cea, &start, &end); for_each_cea_db(cea, i, start, end) { db = &cea[i]; -- 2.21.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/sti: Include the right header
Le ven. 23 août 2019 à 09:14, Linus Walleij a écrit : > > The sti_hdmi.c file include despite not even > using any GPIOs. > > What it does use is devm_ioremap_nocache() which comes from > implicitly by including that header. > > Fix this up by including the right header instead. Applied on drm-misc-next, Thanks Benjamin > > Cc: Benjamin Gaignard > Cc: Vincent Abriou > Signed-off-by: Linus Walleij > --- > drivers/gpu/drm/sti/sti_hdmi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c > index f03d617edc4c..4f1aaf222cb0 100644 > --- a/drivers/gpu/drm/sti/sti_hdmi.c > +++ b/drivers/gpu/drm/sti/sti_hdmi.c > @@ -9,7 +9,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > > -- > 2.21.0 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v7 6/9] drm: sti: use cec_notifier_conn_(un)register
Le jeu. 22 août 2019 à 10:11, Hans Verkuil a écrit : > > Adding Benjamin Gaignard. > > Benjamin, can you take a look at this and Ack it (or merge it if you prefer) > and > ideally test it as well. This is the only patch in this series that I could > not > test since I don't have any hardware. Looks good for me. Applied on drm-misc-next, Thanks, Benjamin > > Regards, > > Hans > > On 8/14/19 12:45 PM, Dariusz Marcinkiewicz wrote: > > Use the new cec_notifier_conn_(un)register() functions to > > (un)register the notifier for the HDMI connector, and fill > > in the cec_connector_info. > > > > Changes since v2: > > Don't invalidate physical address before unregistering the > > notifier. > > > > Signed-off-by: Dariusz Marcinkiewicz > > --- > > drivers/gpu/drm/sti/sti_hdmi.c | 19 --- > > 1 file changed, 12 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c > > index 9862c322f0c4a..bd15902b825ad 100644 > > --- a/drivers/gpu/drm/sti/sti_hdmi.c > > +++ b/drivers/gpu/drm/sti/sti_hdmi.c > > @@ -1256,6 +1256,7 @@ static int sti_hdmi_bind(struct device *dev, struct > > device *master, void *data) > > struct drm_device *drm_dev = data; > > struct drm_encoder *encoder; > > struct sti_hdmi_connector *connector; > > + struct cec_connector_info conn_info; > > struct drm_connector *drm_connector; > > struct drm_bridge *bridge; > > int err; > > @@ -1318,6 +1319,14 @@ static int sti_hdmi_bind(struct device *dev, struct > > device *master, void *data) > > goto err_sysfs; > > } > > > > + cec_fill_conn_info_from_drm(&conn_info, drm_connector); > > + hdmi->notifier = cec_notifier_conn_register(&hdmi->dev, NULL, > > + &conn_info); > > + if (!hdmi->notifier) { > > + hdmi->drm_connector = NULL; > > + return -ENOMEM; > > + } > > + > > /* Enable default interrupts */ > > hdmi_write(hdmi, HDMI_DEFAULT_INT, HDMI_INT_EN); > > > > @@ -1331,6 +1340,9 @@ static int sti_hdmi_bind(struct device *dev, struct > > device *master, void *data) > > static void sti_hdmi_unbind(struct device *dev, > > struct device *master, void *data) > > { > > + struct sti_hdmi *hdmi = dev_get_drvdata(dev); > > + > > + cec_notifier_conn_unregister(hdmi->notifier); > > } > > > > static const struct component_ops sti_hdmi_ops = { > > @@ -1436,10 +1448,6 @@ static int sti_hdmi_probe(struct platform_device > > *pdev) > > goto release_adapter; > > } > > > > - hdmi->notifier = cec_notifier_get(&pdev->dev); > > - if (!hdmi->notifier) > > - goto release_adapter; > > - > > hdmi->reset = devm_reset_control_get(dev, "hdmi"); > > /* Take hdmi out of reset */ > > if (!IS_ERR(hdmi->reset)) > > @@ -1459,14 +1467,11 @@ static int sti_hdmi_remove(struct platform_device > > *pdev) > > { > > struct sti_hdmi *hdmi = dev_get_drvdata(&pdev->dev); > > > > - cec_notifier_set_phys_addr(hdmi->notifier, CEC_PHYS_ADDR_INVALID); > > - > > i2c_put_adapter(hdmi->ddc_adapt); > > if (hdmi->audio_pdev) > > platform_device_unregister(hdmi->audio_pdev); > > component_del(&pdev->dev, &sti_hdmi_ops); > > > > - cec_notifier_put(hdmi->notifier); > > return 0; > > } > > > > >
Re: [PATCH 5/6 v2] drm/msm/hdmi: Bring up HDMI connector OFF
On Sun, Sep 1, 2019 at 6:28 PM Rob Clark wrote: > I'm picking up the earlier patches in this series.. Thanks a lot :) > although I won't > have a good way to test on devices which use the hdmi block for a few > weeks (when I complete my move, and get back a bunch of boards that > are in boxes right now) so I'm going to wait on the last two I think. That's fine. It is just occasional drive-by coding anyway. Yours, Linus Walleij ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/2] drm/panel: Add driver for Sony ACX424AKP panel
On Mon, Sep 2, 2019 at 12:32 PM Thierry Reding wrote: > On Mon, Sep 02, 2019 at 11:06:33AM +0200, Linus Walleij wrote: > > + /* > > + * This depends on the clocking HS vs LP rate, this value > > + * is calculated as: > > + * vrefresh = (clock * 1000) / (htotal*vtotal) > > + */ > > + .vrefresh = 816, > > That's a bit odd. My understanding is that command mode can be done in > continuous mode or in non-continuous mode. In continuous mode you would > typically achieve a similar refresh rate as in video mode. For non- > continuous mode you basically have a variable refresh rate. > > For continuous mode you probably want 60 Hz here and for VRR there's > probably no sensible value to set this to. In the latter case, I don't > think it makes sense to set anything arbitrary like you have above. > Perhaps better to just set it to 0 as a way of signalling that this is > actually dependent on when the display hardware sends a new frame? I guess I should set it to 60. > Have you actually run this is command mode? Yes that is what I am primarily using. > If so, what's the actual > refresh rate? Do you do on-demand updates or do you run in continuous > mode? I run continuous mode, so the refresh rate is essentially dependent on the HS frequency that the host uses. For command mode we use as fast as it can go which is 420MHz, backwards calculated to ~816Hz updates. I took some data from the system when running: 175608 "vblank" interrupts in 25 minutes, yielding 175608/(25*60) ~= 117 Hz so I guess that is the pace the hardware actually recieves it and triggers new updates. > > + ret = mipi_dsi_dcs_read(dsi, 0xda, &id1, len); > > + if (ret < 0) { > > + DRM_DEV_ERROR(acx->dev, "could not read device ID byte 1\n"); > > + return ret; > > + } > > + ret = mipi_dsi_dcs_read(dsi, 0xdb, &id2, len); > > + if (ret < 0) { > > + DRM_DEV_ERROR(acx->dev, "could not read device ID byte 2\n"); > > + return ret; > > + } > > + ret = mipi_dsi_dcs_read(dsi, 0xdc, &id3, len); > > + if (ret < 0) { > > + DRM_DEV_ERROR(acx->dev, "could not read device ID byte 3\n"); > > + return ret; > > + } > > + > > + val = (id3 << 8) | id2; > > Don't you want to OR in id1 here as well? Seems a bit odd to read it but > then not use it. The way I have understood these "MTP IDs" is that the first byte should just be checked for not being 0 so I will add a check like that. The only other DSI panel doing this is panel-samsung-s6e8aa0.c function s6e8aa0_read_mtp_id() which also reads three bytes and ignores the first byte, also the second byte being version and the third ID matches the data this display returns. I'll try to make it a bit clearer and inspect the individual bytes since they seem to have individual meanings. > > + struct device *dev = &dsi->dev; > > + struct acx424akp *acx; > > + int ret; > > + int i; > > unsigned int? Just following the common idiom for integer enumerator i to be a plain int but sure, if you prefer :) > > + /* Read device ID */ > > + i = 0; > > + do { > > + ret = acx424akp_read_id(acx); > > + if (ret) > > + continue; > > + } while (ret && i++ < 5); > > Seems rather redundant to have both an "if (ret) continue;" and the ret > check in the while's condition. A more idiomatic way to write this would > be: > > for (i = 0; i < 5; i++) { > ret = acx424akp_read_id(acx); > if (!ret) > break; > } OK! I fix. Yours, Linus Walleij ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 7/7] drm/omap: hdmi5: automatically choose limited/full range output
Currently the HDMI driver uses always limited range RGB output. This patch improves the behavior by using limited range only if the output is identified as a HDMI display, and VIC > 1. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/hdmi5_core.c | 121 --- 1 file changed, 65 insertions(+), 56 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c b/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c index 4c588ec7634a..96f5cd17768c 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c @@ -23,18 +23,6 @@ #include "hdmi5_core.h" -/* only 24 bit color depth used for now */ -static const struct csc_table csc_table_deepcolor[] = { - /* HDMI_DEEP_COLOR_24BIT */ - [0] = { 7036, 0, 0, 32, 0, 7036, 0, 32, 0, 0, 7036, 32, }, - /* HDMI_DEEP_COLOR_30BIT */ - [1] = { 7015, 0, 0, 128, 0, 7015, 0, 128, 0, 0, 7015, 128, }, - /* HDMI_DEEP_COLOR_36BIT */ - [2] = { 7010, 0, 0, 512, 0, 7010, 0, 512, 0, 0, 7010, 512, }, - /* FULL RANGE */ - [3] = { 8192, 0, 0, 0, 0, 8192, 0, 0, 0, 0, 8192, 0, }, -}; - static void hdmi_core_ddc_init(struct hdmi_core_data *core) { void __iomem *base = core->base; @@ -397,14 +385,6 @@ static void hdmi_core_config_video_packetizer(struct hdmi_core_data *core) REG_FLD_MOD(base, HDMI_CORE_VP_CONF, clr_depth ? 0 : 2, 1, 0); } -static void hdmi_core_config_csc(struct hdmi_core_data *core) -{ - int clr_depth = 0; /* 24 bit color depth */ - - /* CSC_COLORDEPTH */ - REG_FLD_MOD(core->base, HDMI_CORE_CSC_SCALE, clr_depth, 7, 4); -} - static void hdmi_core_config_video_sampler(struct hdmi_core_data *core) { int video_mapping = 1; /* for 24 bit color depth */ @@ -469,47 +449,67 @@ static void hdmi_core_write_avi_infoframe(struct hdmi_core_data *core, REG_FLD_MOD(base, HDMI_CORE_FC_PRCONF, pr, 3, 0); } -static void hdmi_core_csc_config(struct hdmi_core_data *core, - struct csc_table csc_coeff) +static void hdmi_core_write_csc(struct hdmi_core_data *core, + const struct csc_table *csc_coeff) { void __iomem *base = core->base; - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A1_MSB, csc_coeff.a1 >> 8 , 6, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A1_LSB, csc_coeff.a1, 7, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A2_MSB, csc_coeff.a2 >> 8, 6, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A2_LSB, csc_coeff.a2, 7, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A3_MSB, csc_coeff.a3 >> 8, 6, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A3_LSB, csc_coeff.a3, 7, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A4_MSB, csc_coeff.a4 >> 8, 6, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A4_LSB, csc_coeff.a4, 7, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_B1_MSB, csc_coeff.b1 >> 8, 6, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_B1_LSB, csc_coeff.b1, 7, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_B2_MSB, csc_coeff.b2 >> 8, 6, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_B2_LSB, csc_coeff.b2, 7, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_B3_MSB, csc_coeff.b3 >> 8, 6, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_B3_LSB, csc_coeff.b3, 7, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_B4_MSB, csc_coeff.b4 >> 8, 6, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_B4_LSB, csc_coeff.b4, 7, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_C1_MSB, csc_coeff.c1 >> 8, 6, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_C1_LSB, csc_coeff.c1, 7, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_C2_MSB, csc_coeff.c2 >> 8, 6, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_C2_LSB, csc_coeff.c2, 7, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_C3_MSB, csc_coeff.c3 >> 8, 6, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_C3_LSB, csc_coeff.c3, 7, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_C4_MSB, csc_coeff.c4 >> 8, 6, 0); - REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_C4_LSB, csc_coeff.c4, 7, 0); - + REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A1_MSB, csc_coeff->a1 >> 8, 6, 0); + REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A1_LSB, csc_coeff->a1, 7, 0); + REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A2_MSB, csc_coeff->a2 >> 8, 6, 0); + REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A2_LSB, csc_coeff->a2, 7, 0); + REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A3_MSB, csc_coeff->a3 >> 8, 6, 0); + REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A3_LSB, csc_coeff->a3, 7, 0); + REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A4_MSB, csc_coeff->a4 >> 8, 6, 0); + REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_A4_LSB, csc_coeff->a4, 7, 0); + REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_B1_MSB, csc_coeff->b1 >> 8, 6, 0); + REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_B1_LSB, csc_coeff->b1, 7, 0); + REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_B2_MSB, csc_coeff->b2 >> 8, 6, 0); + REG_FLD_MOD(base, HDMI_CORE_CSC_COEF_B2_LSB, csc_coeff->b2, 7, 0); + REG_FLD_MOD(base,
[PATCH 4/7] drm/omap: Implement CTM property for CRTC using OVL managers CPR matrix
From: Jyri Sarha Implement CTM color management property for OMAP CRTC using DSS overlay manager's Color Phase Rotation matrix. The CPR matrix does not exactly match the CTM property documentation. On DSS the CPR matrix is applied after gamma table look up. However, it seems stupid to add a custom property just for that. Signed-off-by: Jyri Sarha Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_crtc.c | 39 +++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c index 3c5ddbf30e97..d63213dd7d83 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c @@ -391,6 +391,32 @@ static void omap_crtc_manual_display_update(struct work_struct *data) } } +static s16 omap_crtc_S31_32_to_s2_8(s64 coef) +{ + uint64_t sign_bit = 1ULL << 63; + uint64_t cbits = (uint64_t) coef; + s16 ret = clamp_val(((cbits & ~sign_bit) >> 24), 0, 0x1FF); + + if (cbits & sign_bit) + ret = -ret; + + return ret; +} + +static void omap_crtc_cpr_coefs_from_ctm(const struct drm_color_ctm *ctm, +struct omap_dss_cpr_coefs *cpr) +{ + cpr->rr = omap_crtc_S31_32_to_s2_8(ctm->matrix[0]); + cpr->rg = omap_crtc_S31_32_to_s2_8(ctm->matrix[1]); + cpr->rb = omap_crtc_S31_32_to_s2_8(ctm->matrix[2]); + cpr->gr = omap_crtc_S31_32_to_s2_8(ctm->matrix[3]); + cpr->gg = omap_crtc_S31_32_to_s2_8(ctm->matrix[4]); + cpr->gb = omap_crtc_S31_32_to_s2_8(ctm->matrix[5]); + cpr->br = omap_crtc_S31_32_to_s2_8(ctm->matrix[6]); + cpr->bg = omap_crtc_S31_32_to_s2_8(ctm->matrix[7]); + cpr->bb = omap_crtc_S31_32_to_s2_8(ctm->matrix[8]); +} + static void omap_crtc_write_crtc_properties(struct drm_crtc *crtc) { struct omap_drm_private *priv = crtc->dev->dev_private; @@ -402,7 +428,16 @@ static void omap_crtc_write_crtc_properties(struct drm_crtc *crtc) info.default_color = 0x00; info.trans_enabled = false; info.partial_alpha_enabled = false; - info.cpr_enable = false; + + if (crtc->state->ctm) { + struct drm_color_ctm *ctm = + (struct drm_color_ctm *) crtc->state->ctm->data; + + info.cpr_enable = true; + omap_crtc_cpr_coefs_from_ctm(ctm, &info.cpr_coefs); + } else { + info.cpr_enable = false; + } priv->dispc_ops->mgr_setup(priv->dispc, omap_crtc->channel, &info); } @@ -836,7 +871,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev, if (priv->dispc_ops->mgr_gamma_size(priv->dispc, channel)) { unsigned int gamma_lut_size = 256; - drm_crtc_enable_color_mgmt(crtc, 0, false, gamma_lut_size); + drm_crtc_enable_color_mgmt(crtc, 0, true, gamma_lut_size); drm_mode_crtc_set_gamma_size(crtc, gamma_lut_size); } -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 1/7] drm/omap: drop unneeded locking from mgr_fld_write()
Commit d49cd15550d9d4495f6187425318c245d58cb63f ("OMAPDSS: DISPC: lock access to DISPC_CONTROL & DISPC_CONFIG") added locking to mgr_fld_write(). This was needed in omapfb times due to lack of good locking, especially in the case of both V4L2 and fbdev layers using the DSS driver. This is not needed for omapdrm, so we can remove the locking. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/dispc.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 785c5546067a..c6da33e7014f 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -184,9 +184,6 @@ struct dispc_device { struct regmap *syscon_pol; u32 syscon_pol_offset; - - /* DISPC_CONTROL & DISPC_CONFIG lock*/ - spinlock_t control_lock; }; enum omap_color_component { @@ -377,16 +374,7 @@ static void mgr_fld_write(struct dispc_device *dispc, enum omap_channel channel, enum mgr_reg_fields regfld, int val) { const struct dispc_reg_field rfld = mgr_desc[channel].reg_desc[regfld]; - const bool need_lock = rfld.reg == DISPC_CONTROL || rfld.reg == DISPC_CONFIG; - unsigned long flags; - - if (need_lock) { - spin_lock_irqsave(&dispc->control_lock, flags); - REG_FLD_MOD(dispc, rfld.reg, val, rfld.high, rfld.low); - spin_unlock_irqrestore(&dispc->control_lock, flags); - } else { - REG_FLD_MOD(dispc, rfld.reg, val, rfld.high, rfld.low); - } + REG_FLD_MOD(dispc, rfld.reg, val, rfld.high, rfld.low); } static int dispc_get_num_ovls(struct dispc_device *dispc) @@ -4769,8 +4757,6 @@ static int dispc_bind(struct device *dev, struct device *master, void *data) platform_set_drvdata(pdev, dispc); dispc->dss = dss; - spin_lock_init(&dispc->control_lock); - /* * The OMAP3-based models can't be told apart using the compatible * string, use SoC device matching. -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 5/7] drm/omap: Enable COLOR_ENCODING and COLOR_RANGE properties for planes
From: Jyri Sarha Adds support for COLOR_ENCODING and COLOR_RANGE properties to omap_plane.c and dispc.c. The supported encodings and ranges are: For COLOR_ENCODING: - YCbCt BT.601 (default) - YCbCt BT.709 For COLOR_RANGE: - YCbCt limited range - YCbCt full range (default) Signed-off-by: Jyri Sarha Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/dispc.c | 119 -- drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 + drivers/gpu/drm/omapdrm/omap_plane.c | 30 +++ 3 files changed, 127 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 7d87d60edb80..40ddb28ee7aa 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -892,32 +892,91 @@ static void dispc_wb_write_color_conv_coef(struct dispc_device *dispc, #undef CVAL } -static void dispc_setup_color_conv_coef(struct dispc_device *dispc) +/* YUV -> RGB, ITU-R BT.601, full range */ +const static struct csc_coef_yuv2rgb coefs_yuv2rgb_bt601_full = { + 256, 0, 358, /* ry, rcb, rcr |1.000 0.000 1.402|*/ + 256, -88, -182, /* gy, gcb, gcr |1.000 -0.344 -0.714|*/ + 256, 452,0, /* by, bcb, bcr |1.000 1.772 0.000|*/ + true, /* full range */ +}; + +/* YUV -> RGB, ITU-R BT.601, limited range */ +const static struct csc_coef_yuv2rgb coefs_yuv2rgb_bt601_lim = { + 298,0, 409,/* ry, rcb, rcr |1.164 0.000 1.596|*/ + 298, -100, -208,/* gy, gcb, gcr |1.164 -0.392 -0.813|*/ + 298, 516,0,/* by, bcb, bcr |1.164 2.017 0.000|*/ + false, /* limited range */ +}; + +/* YUV -> RGB, ITU-R BT.709, full range */ +const static struct csc_coef_yuv2rgb coefs_yuv2rgb_bt709_full = { + 256,0, 402,/* ry, rcb, rcr |1.000 0.000 1.570|*/ + 256, -48, -120,/* gy, gcb, gcr |1.000 -0.187 -0.467|*/ + 256, 475,0,/* by, bcb, bcr |1.000 1.856 0.000|*/ + true, /* full range */ +}; + +/* YUV -> RGB, ITU-R BT.709, limited range */ +const static struct csc_coef_yuv2rgb coefs_yuv2rgb_bt709_lim = { + 298,0, 459,/* ry, rcb, rcr |1.164 0.000 1.793|*/ + 298, -55, -136,/* gy, gcb, gcr |1.164 -0.213 -0.533|*/ + 298, 541,0,/* by, bcb, bcr |1.164 2.112 0.000|*/ + false, /* limited range */ +}; + +/* RGB -> YUV, ITU-R BT.601, limited range */ +const static struct csc_coef_rgb2yuv coefs_rgb2yuv_bt601_lim = { +66, 129, 25, /* yr, yg, yb | 0.257 0.504 0.098|*/ + -38, -74, 112, /* cbr, cbg, cbb |-0.148 -0.291 0.439|*/ + 112, -94, -18, /* crr, crg, crb | 0.439 -0.368 -0.071|*/ + false, /* limited range */ +}; + +/* RGB -> YUV, ITU-R BT.601, full range */ +const static struct csc_coef_rgb2yuv coefs_rgb2yuv_bt601_full = { +77, 150, 29, /* yr, yg, yb | 0.299 0.587 0.114|*/ + -43, -85, 128, /* cbr, cbg, cbb |-0.173 -0.339 0.511|*/ + 128, -107, -21, /* crr, crg, crb | 0.511 -0.428 -0.083|*/ + true, /* full range */ +}; + +/* RGB -> YUV, ITU-R BT.709, limited range */ +const static struct csc_coef_rgb2yuv coefs_rgb2yuv_bt701_lim = { +47, 157, 16,/* yr, yg, yb | 0.1826 0.6142 0.0620|*/ + -26, -87, 112,/* cbr, cbg, cbb |-0.1006 -0.3386 0.4392|*/ + 112, -102, -10,/* crr, crg, crb | 0.4392 -0.3989 -0.0403|*/ + false, /* limited range */ +}; + +static int dispc_ovl_set_csc(struct dispc_device *dispc, +enum omap_plane_id plane, +enum drm_color_encoding color_encoding, +enum drm_color_range color_range) { - int i; - int num_ovl = dispc_get_num_ovls(dispc); - - /* YUV -> RGB, ITU-R BT.601, limited range */ - const struct csc_coef_yuv2rgb coefs_yuv2rgb_bt601_lim = { - 298,0, 409,/* ry, rcb, rcr */ - 298, -100, -208,/* gy, gcb, gcr */ - 298, 516,0,/* by, bcb, bcr */ - false, /* limited range */ - }; + const struct csc_coef_yuv2rgb *csc; - /* RGB -> YUV, ITU-R BT.601, limited range */ - const struct csc_coef_rgb2yuv coefs_rgb2yuv_bt601_lim = { -66, 129, 25, /* yr, yg, yb */ - -38, -74, 112, /* cbr, cbg, cbb */ - 112, -94, -18, /* crr, crg, crb */ - false, /* limited range */ - }; + switch (color_encoding) { + case DRM_COLOR_YCBCR_BT601: + if (color_range == DRM_COLOR_YCBCR_FULL_RANGE) + csc = &coefs_yuv2rgb_bt601_full; + else +
[PATCH 6/7] drm/omap: dss: platform_register_drivers() to dss.c and remove core.c
From: Jyri Sarha The core.c just for registering the drivers is kind of useless. Let's get rid of it and register the dss drivers in dss.c. Signed-off-by: Jyri Sarha Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/Makefile | 2 +- drivers/gpu/drm/omapdrm/dss/core.c | 55 drivers/gpu/drm/omapdrm/dss/dss.c| 37 +++ 3 files changed, 38 insertions(+), 56 deletions(-) delete mode 100644 drivers/gpu/drm/omapdrm/dss/core.c diff --git a/drivers/gpu/drm/omapdrm/dss/Makefile b/drivers/gpu/drm/omapdrm/dss/Makefile index 904101c5e79d..5950c3f52c2e 100644 --- a/drivers/gpu/drm/omapdrm/dss/Makefile +++ b/drivers/gpu/drm/omapdrm/dss/Makefile @@ -6,7 +6,7 @@ omapdss-base-y := base.o display.o dss-of.o output.o obj-$(CONFIG_OMAP2_DSS) += omapdss.o # Core DSS files -omapdss-y := core.o dss.o dispc.o dispc_coefs.o \ +omapdss-y := dss.o dispc.o dispc_coefs.o \ pll.o video-pll.o omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o diff --git a/drivers/gpu/drm/omapdrm/dss/core.c b/drivers/gpu/drm/omapdrm/dss/core.c deleted file mode 100644 index 6ac497b63711.. --- a/drivers/gpu/drm/omapdrm/dss/core.c +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (C) 2009 Nokia Corporation - * Author: Tomi Valkeinen - * - * Some code and ideas taken from drivers/video/omap/ driver - * by Imre Deak. - */ - -#define DSS_SUBSYS_NAME "CORE" - -#include -#include -#include - -#include "omapdss.h" -#include "dss.h" - -/* INIT */ -static struct platform_driver * const omap_dss_drivers[] = { - &omap_dsshw_driver, - &omap_dispchw_driver, -#ifdef CONFIG_OMAP2_DSS_DSI - &omap_dsihw_driver, -#endif -#ifdef CONFIG_OMAP2_DSS_VENC - &omap_venchw_driver, -#endif -#ifdef CONFIG_OMAP4_DSS_HDMI - &omapdss_hdmi4hw_driver, -#endif -#ifdef CONFIG_OMAP5_DSS_HDMI - &omapdss_hdmi5hw_driver, -#endif -}; - -static int __init omap_dss_init(void) -{ - return platform_register_drivers(omap_dss_drivers, -ARRAY_SIZE(omap_dss_drivers)); -} - -static void __exit omap_dss_exit(void) -{ - platform_unregister_drivers(omap_dss_drivers, - ARRAY_SIZE(omap_dss_drivers)); -} - -module_init(omap_dss_init); -module_exit(omap_dss_exit); - -MODULE_AUTHOR("Tomi Valkeinen "); -MODULE_DESCRIPTION("OMAP2/3 Display Subsystem"); -MODULE_LICENSE("GPL v2"); - diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index e226324adb69..41d495a360d8 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -1598,3 +1598,40 @@ struct platform_driver omap_dsshw_driver = { .suppress_bind_attrs = true, }, }; + +/* INIT */ +static struct platform_driver * const omap_dss_drivers[] = { + &omap_dsshw_driver, + &omap_dispchw_driver, +#ifdef CONFIG_OMAP2_DSS_DSI + &omap_dsihw_driver, +#endif +#ifdef CONFIG_OMAP2_DSS_VENC + &omap_venchw_driver, +#endif +#ifdef CONFIG_OMAP4_DSS_HDMI + &omapdss_hdmi4hw_driver, +#endif +#ifdef CONFIG_OMAP5_DSS_HDMI + &omapdss_hdmi5hw_driver, +#endif +}; + +static int __init omap_dss_init(void) +{ + return platform_register_drivers(omap_dss_drivers, +ARRAY_SIZE(omap_dss_drivers)); +} + +static void __exit omap_dss_exit(void) +{ + platform_unregister_drivers(omap_dss_drivers, + ARRAY_SIZE(omap_dss_drivers)); +} + +module_init(omap_dss_init); +module_exit(omap_dss_exit); + +MODULE_AUTHOR("Tomi Valkeinen "); +MODULE_DESCRIPTION("OMAP2/3/4/5 Display Subsystem"); +MODULE_LICENSE("GPL v2"); -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/7] drm/omap: tweak HDMI DDC timings
From: Alejandro Hernandez A "HDMI I2C Master Error" is sometimes reported with the current DDC SCL timings. The current settings for a 10us SCL period (100 KHz) causes the error with some displays. This patch increases the SCL signal period from 10us to 10.2us, with the new settings the error is not observed Signed-off-by: Alejandro Hernandez Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/hdmi5_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c b/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c index 7400fb99d453..4c588ec7634a 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c @@ -39,8 +39,8 @@ static void hdmi_core_ddc_init(struct hdmi_core_data *core) { void __iomem *base = core->base; const unsigned long long iclk = 26600; /* DSS L3 ICLK */ - const unsigned int ss_scl_high = 4600; /* ns */ - const unsigned int ss_scl_low = 5400; /* ns */ + const unsigned int ss_scl_high = 4700; /* ns */ + const unsigned int ss_scl_low = 5500; /* ns */ const unsigned int fs_scl_high = 600; /* ns */ const unsigned int fs_scl_low = 1300; /* ns */ const unsigned int sda_hold = 1000; /* ns */ -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 3/7] drm/omap: fix missing scaler pixel fmt limitations
OMAP2 and OMAP3/AM4 have limitations with the scaler: - OMAP2 can only scale XRGB - OMAP3/AM4 can only scale XRGB, RGB565, YUYV and UYVY The driver doesn't check these limitations, which leads to sync-lost floods. This patch adds a check for the pixel formats when scaling. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/dispc.c | 25 + 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index c6da33e7014f..7d87d60edb80 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -114,6 +114,7 @@ struct dispc_features { const unsigned int num_reg_fields; const enum omap_overlay_caps *overlay_caps; const u32 **supported_color_modes; + const u32 *supported_scaler_color_modes; unsigned int num_mgrs; unsigned int num_ovls; unsigned int buffer_size_unit; @@ -2498,6 +2499,19 @@ static int dispc_ovl_calc_scaling(struct dispc_device *dispc, if (width == out_width && height == out_height) return 0; + if (dispc->feat->supported_scaler_color_modes) { + const u32 *modes = dispc->feat->supported_scaler_color_modes; + int i; + + for (i = 0; modes[i]; ++i) { + if (modes[i] == fourcc) + break; + } + + if (modes[i] == 0) + return -EINVAL; + } + if (plane == OMAP_DSS_WB) { switch (fourcc) { case DRM_FORMAT_NV12: @@ -4213,6 +4227,12 @@ static const u32 *omap4_dispc_supported_color_modes[] = { DRM_FORMAT_RGBX), }; +static const u32 omap3_dispc_supported_scaler_color_modes[] = { + DRM_FORMAT_XRGB, DRM_FORMAT_RGB565, DRM_FORMAT_YUYV, + DRM_FORMAT_UYVY, + 0, +}; + static const struct dispc_features omap24xx_dispc_feats = { .sw_start = 5, .fp_start = 15, @@ -4241,6 +4261,7 @@ static const struct dispc_features omap24xx_dispc_feats = { .num_reg_fields = ARRAY_SIZE(omap2_dispc_reg_fields), .overlay_caps = omap2_dispc_overlay_caps, .supported_color_modes = omap2_dispc_supported_color_modes, + .supported_scaler_color_modes = COLOR_ARRAY(DRM_FORMAT_XRGB), .num_mgrs = 2, .num_ovls = 3, .buffer_size_unit = 1, @@ -4275,6 +4296,7 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats = { .num_reg_fields = ARRAY_SIZE(omap3_dispc_reg_fields), .overlay_caps = omap3430_dispc_overlay_caps, .supported_color_modes = omap3_dispc_supported_color_modes, + .supported_scaler_color_modes = omap3_dispc_supported_scaler_color_modes, .num_mgrs = 2, .num_ovls = 3, .buffer_size_unit = 1, @@ -4309,6 +4331,7 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats = { .num_reg_fields = ARRAY_SIZE(omap3_dispc_reg_fields), .overlay_caps = omap3430_dispc_overlay_caps, .supported_color_modes = omap3_dispc_supported_color_modes, + .supported_scaler_color_modes = omap3_dispc_supported_scaler_color_modes, .num_mgrs = 2, .num_ovls = 3, .buffer_size_unit = 1, @@ -4343,6 +4366,7 @@ static const struct dispc_features omap36xx_dispc_feats = { .num_reg_fields = ARRAY_SIZE(omap3_dispc_reg_fields), .overlay_caps = omap3630_dispc_overlay_caps, .supported_color_modes = omap3_dispc_supported_color_modes, + .supported_scaler_color_modes = omap3_dispc_supported_scaler_color_modes, .num_mgrs = 2, .num_ovls = 3, .buffer_size_unit = 1, @@ -4377,6 +4401,7 @@ static const struct dispc_features am43xx_dispc_feats = { .num_reg_fields = ARRAY_SIZE(omap3_dispc_reg_fields), .overlay_caps = omap3430_dispc_overlay_caps, .supported_color_modes = omap3_dispc_supported_color_modes, + .supported_scaler_color_modes = omap3_dispc_supported_scaler_color_modes, .num_mgrs = 1, .num_ovls = 3, .buffer_size_unit = 1, -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 0/7] drm/omap: misc improvements
Hi, Misc improvements to omapdrm which have been lying around for a long time, and I've missed upstreaming them. And one new one, which makes the DSS5 HDMI pick up the color range automatically. Tomi Alejandro Hernandez (1): drm/omap: tweak HDMI DDC timings Jyri Sarha (3): drm/omap: Implement CTM property for CRTC using OVL managers CPR matrix drm/omap: Enable COLOR_ENCODING and COLOR_RANGE properties for planes drm/omap: dss: platform_register_drivers() to dss.c and remove core.c Tomi Valkeinen (3): drm/omap: drop unneeded locking from mgr_fld_write() drm/omap: fix missing scaler pixel fmt limitations drm/omap: hdmi5: automatically choose limited/full range output drivers/gpu/drm/omapdrm/dss/Makefile | 2 +- drivers/gpu/drm/omapdrm/dss/core.c | 55 drivers/gpu/drm/omapdrm/dss/dispc.c | 160 +-- drivers/gpu/drm/omapdrm/dss/dss.c| 37 ++ drivers/gpu/drm/omapdrm/dss/hdmi5_core.c | 125 ++ drivers/gpu/drm/omapdrm/dss/omapdss.h| 4 + drivers/gpu/drm/omapdrm/omap_crtc.c | 39 +- drivers/gpu/drm/omapdrm/omap_plane.c | 30 + 8 files changed, 295 insertions(+), 157 deletions(-) delete mode 100644 drivers/gpu/drm/omapdrm/dss/core.c -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 1/5] drm/ttm: add drm_gem_ttm_print_info()
Now with ttm_buffer_object being a subclass of drm_gem_object we can easily lookup ttm_buffer_object for a given drm_gem_object, which in turm allows to create common helper functions. This patch starts off with a drm_gem_ttm_print_info() helper function which prints adds some ttm specific lines to the debug output. Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_ttm_helper.h | 19 drivers/gpu/drm/drm_gem_ttm_helper.c | 67 Documentation/gpu/drm-mm.rst | 12 + drivers/gpu/drm/Kconfig | 7 +++ drivers/gpu/drm/Makefile | 3 ++ 5 files changed, 108 insertions(+) create mode 100644 include/drm/drm_gem_ttm_helper.h create mode 100644 drivers/gpu/drm/drm_gem_ttm_helper.c diff --git a/include/drm/drm_gem_ttm_helper.h b/include/drm/drm_gem_ttm_helper.h new file mode 100644 index ..6268f89c5a48 --- /dev/null +++ b/include/drm/drm_gem_ttm_helper.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef DRM_GEM_TTM_HELPER_H +#define DRM_GEM_TTM_HELPER_H + +#include + +#include +#include +#include +#include + +#define drm_gem_ttm_of_gem(gem_obj) \ + container_of(gem_obj, struct ttm_buffer_object, base) + +void drm_gem_ttm_print_info(struct drm_printer *p, unsigned int indent, + const struct drm_gem_object *gem); + +#endif diff --git a/drivers/gpu/drm/drm_gem_ttm_helper.c b/drivers/gpu/drm/drm_gem_ttm_helper.c new file mode 100644 index ..cd6ac2cc8fdd --- /dev/null +++ b/drivers/gpu/drm/drm_gem_ttm_helper.c @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include + +#include + +/** + * DOC: overview + * + * This library provides helper functions for gem objects backed by + * ttm. + */ + +/** + * drm_gem_ttm_print_info() - Print &ttm_buffer_object info for debugfs + * @p: DRM printer + * @indent: Tab indentation level + * @gem: GEM object + * + * This function can be used as the &drm_driver->gem_print_info callback. + */ +void drm_gem_ttm_print_info(struct drm_printer *p, unsigned int indent, + const struct drm_gem_object *gem) +{ + static const char *plname[] = { + [ TTM_PL_SYSTEM ] = "system", + [ TTM_PL_TT ] = "tt", + [ TTM_PL_VRAM ] = "vram", + [ TTM_PL_PRIV ] = "priv", + + [ 16 ]= "cached", + [ 17 ]= "uncached", + [ 18 ]= "wc", + [ 19 ]= "contig", + + [ 21 ]= "pinned", /* NO_EVICT */ + [ 22 ]= "topdown", + }; + const struct ttm_buffer_object *bo = drm_gem_ttm_of_gem(gem); + bool first = true; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(plname); i++) { + if (!(bo->mem.placement & (1 << i))) + continue; + if (!plname[i]) + continue; + if (first) { + first = false; + drm_printf_indent(p, indent, "placement=%s", plname[i]); + } else + drm_printf(p, ",%s", plname[i]); + } + if (!first) + drm_printf(p, "\n"); + + if (bo->mem.bus.is_iomem) { + drm_printf_indent(p, indent, "bus.base=%lx\n", + (unsigned long)bo->mem.bus.base); + drm_printf_indent(p, indent, "bus.offset=%lx\n", + (unsigned long)bo->mem.bus.offset); + } +} +EXPORT_SYMBOL(drm_gem_ttm_print_info); + +MODULE_DESCRIPTION("DRM gem ttm helpers"); +MODULE_LICENSE("GPL"); diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst index b664f054c259..a70a1d9f30ec 100644 --- a/Documentation/gpu/drm-mm.rst +++ b/Documentation/gpu/drm-mm.rst @@ -412,6 +412,18 @@ VRAM MM Helper Functions Reference .. kernel-doc:: drivers/gpu/drm/drm_vram_mm_helper.c :export: +GEM TTM Helper Functions Reference +--- + +.. kernel-doc:: drivers/gpu/drm/drm_gem_ttm_helper.c + :doc: overview + +.. kernel-doc:: include/drm/drm_gem_ttm_helper.h + :internal: + +.. kernel-doc:: drivers/gpu/drm/drm_gem_ttm_helper.c + :export: + VMA Offset Manager == diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index e6f40fb54c9a..f7b25519f95c 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -172,6 +172,13 @@ config DRM_VRAM_HELPER help Helpers for VRAM memory management +config DRM_TTM_HELPER + tristate + depends on DRM + select DRM_TTM + help + Helpers for ttm-based gem objects + config DRM_GEM_CMA_HELPER bool depends on DRM diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 10f8329a8b71..545c61d6528b 100644 --- a/drivers/gpu/drm/Makefile +++ b/dr
[PATCH 2/5] drm/vram: use drm_gem_ttm_print_info
Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_vram_helper.h | 1 + drivers/gpu/drm/drm_gem_vram_helper.c | 3 ++- drivers/gpu/drm/Kconfig | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h index ac217d768456..17f160dd6e7d 100644 --- a/include/drm/drm_gem_vram_helper.h +++ b/include/drm/drm_gem_vram_helper.h @@ -4,6 +4,7 @@ #define DRM_GEM_VRAM_HELPER_H #include +#include #include #include #include /* for container_of() */ diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index fd751078bae1..b4929e1fb190 100644 --- a/drivers/gpu/drm/drm_gem_vram_helper.c +++ b/drivers/gpu/drm/drm_gem_vram_helper.c @@ -633,5 +633,6 @@ static const struct drm_gem_object_funcs drm_gem_vram_object_funcs = { .pin= drm_gem_vram_object_pin, .unpin = drm_gem_vram_object_unpin, .vmap = drm_gem_vram_object_vmap, - .vunmap = drm_gem_vram_object_vunmap + .vunmap = drm_gem_vram_object_vunmap, + .print_info = drm_gem_ttm_print_info, }; diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index f7b25519f95c..1be8ad30d8fe 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -169,6 +169,7 @@ config DRM_VRAM_HELPER tristate depends on DRM select DRM_TTM + select DRM_TTM_HELPER help Helpers for VRAM memory management -- 2.18.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 5/5] drm/qxl: use drm_gem_ttm_print_info
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h| 1 + drivers/gpu/drm/qxl/qxl_object.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h index 9e034c5fa87d..d4051409ce64 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.h +++ b/drivers/gpu/drm/qxl/qxl_drv.h @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c index 29aab7b14513..c013c516f561 100644 --- a/drivers/gpu/drm/qxl/qxl_object.c +++ b/drivers/gpu/drm/qxl/qxl_object.c @@ -86,6 +86,7 @@ static const struct drm_gem_object_funcs qxl_object_funcs = { .get_sg_table = qxl_gem_prime_get_sg_table, .vmap = qxl_gem_prime_vmap, .vunmap = qxl_gem_prime_vunmap, + .print_info = drm_gem_ttm_print_info, }; int qxl_bo_create(struct qxl_device *qdev, -- 2.18.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 4/5] drm/qxl: use drm_gem_object_funcs callbacks
Switch qxl to use drm_gem_object_funcs callbacks instead of drm_driver callbacks. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.c| 8 drivers/gpu/drm/qxl/qxl_object.c | 12 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index 2b726a51a302..996d428fa7e6 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.c +++ b/drivers/gpu/drm/qxl/qxl_drv.c @@ -258,16 +258,8 @@ static struct drm_driver qxl_driver = { #endif .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_pin = qxl_gem_prime_pin, - .gem_prime_unpin = qxl_gem_prime_unpin, - .gem_prime_get_sg_table = qxl_gem_prime_get_sg_table, .gem_prime_import_sg_table = qxl_gem_prime_import_sg_table, - .gem_prime_vmap = qxl_gem_prime_vmap, - .gem_prime_vunmap = qxl_gem_prime_vunmap, .gem_prime_mmap = qxl_gem_prime_mmap, - .gem_free_object_unlocked = qxl_gem_object_free, - .gem_open_object = qxl_gem_object_open, - .gem_close_object = qxl_gem_object_close, .fops = &qxl_fops, .ioctls = qxl_ioctls, .irq_handler = qxl_irq_handler, diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c index 548dfe6f3b26..29aab7b14513 100644 --- a/drivers/gpu/drm/qxl/qxl_object.c +++ b/drivers/gpu/drm/qxl/qxl_object.c @@ -77,6 +77,17 @@ void qxl_ttm_placement_from_domain(struct qxl_bo *qbo, u32 domain, bool pinned) } } +static const struct drm_gem_object_funcs qxl_object_funcs = { + .free = qxl_gem_object_free, + .open = qxl_gem_object_open, + .close = qxl_gem_object_close, + .pin = qxl_gem_prime_pin, + .unpin = qxl_gem_prime_unpin, + .get_sg_table = qxl_gem_prime_get_sg_table, + .vmap = qxl_gem_prime_vmap, + .vunmap = qxl_gem_prime_vunmap, +}; + int qxl_bo_create(struct qxl_device *qdev, unsigned long size, bool kernel, bool pinned, u32 domain, struct qxl_surface *surf, @@ -100,6 +111,7 @@ int qxl_bo_create(struct qxl_device *qdev, kfree(bo); return r; } + bo->tbo.base.funcs = &qxl_object_funcs; bo->type = domain; bo->pin_count = pinned ? 1 : 0; bo->surface_id = 0; -- 2.18.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 0/5] drm: add some ttm/vram info to debugfs
Gerd Hoffmann (5): drm/ttm: add drm_gem_ttm_print_info() drm/vram: use drm_gem_ttm_print_info drm/vram: add vram-mm debugfs file drm/qxl: use drm_gem_object_funcs callbacks drm/qxl: use drm_gem_ttm_print_info drivers/gpu/drm/qxl/qxl_drv.h | 1 + include/drm/drm_gem_ttm_helper.h | 19 include/drm/drm_gem_vram_helper.h | 2 + include/drm/drm_vram_mm_helper.h | 1 + drivers/gpu/drm/drm_gem_ttm_helper.c | 67 +++ drivers/gpu/drm/drm_gem_vram_helper.c | 3 +- drivers/gpu/drm/drm_vram_mm_helper.c | 33 + drivers/gpu/drm/qxl/qxl_drv.c | 8 drivers/gpu/drm/qxl/qxl_object.c | 13 ++ Documentation/gpu/drm-mm.rst | 12 + drivers/gpu/drm/Kconfig | 8 drivers/gpu/drm/Makefile | 3 ++ 12 files changed, 161 insertions(+), 9 deletions(-) create mode 100644 include/drm/drm_gem_ttm_helper.h create mode 100644 drivers/gpu/drm/drm_gem_ttm_helper.c -- 2.18.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 3/5] drm/vram: add vram-mm debugfs file
Wire up drm_mm_print() for vram helpers, using a new debugfs file, so one can see how vram is used: # cat /sys/kernel/debug/dri/0/vram-mm 0x-0x0300: 768: used 0x0300-0x0600: 768: used 0x0600-0x0900: 768: used 0x0900-0x0c00: 768: used 0x0c00-0x4000: 13312: free total: 16384, used 3072 free 13312 Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_vram_helper.h| 1 + include/drm/drm_vram_mm_helper.h | 1 + drivers/gpu/drm/drm_vram_mm_helper.c | 33 3 files changed, 35 insertions(+) diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h index 17f160dd6e7d..d48fdf90b254 100644 --- a/include/drm/drm_gem_vram_helper.h +++ b/include/drm/drm_gem_vram_helper.h @@ -123,6 +123,7 @@ int drm_gem_vram_driver_dumb_mmap_offset(struct drm_file *file, * &struct drm_driver with default functions. */ #define DRM_GEM_VRAM_DRIVER \ + .debugfs_init = drm_vram_mm_debugfs_init, \ .dumb_create = drm_gem_vram_driver_dumb_create, \ .dumb_map_offset = drm_gem_vram_driver_dumb_mmap_offset, \ .gem_prime_mmap = drm_gem_prime_mmap diff --git a/include/drm/drm_vram_mm_helper.h b/include/drm/drm_vram_mm_helper.h index 2aacfb1ccfae..9e0ac9aaac7d 100644 --- a/include/drm/drm_vram_mm_helper.h +++ b/include/drm/drm_vram_mm_helper.h @@ -60,6 +60,7 @@ static inline struct drm_vram_mm *drm_vram_mm_of_bdev( return container_of(bdev, struct drm_vram_mm, bdev); } +int drm_vram_mm_debugfs_init(struct drm_minor *minor); int drm_vram_mm_init(struct drm_vram_mm *vmm, struct drm_device *dev, uint64_t vram_base, size_t vram_size, const struct drm_vram_mm_funcs *funcs); diff --git a/drivers/gpu/drm/drm_vram_mm_helper.c b/drivers/gpu/drm/drm_vram_mm_helper.c index c911781d6728..486061b83a73 100644 --- a/drivers/gpu/drm/drm_vram_mm_helper.c +++ b/drivers/gpu/drm/drm_vram_mm_helper.c @@ -1,7 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-or-later +#include #include #include +#include #include #include @@ -148,6 +150,37 @@ static struct ttm_bo_driver bo_driver = { * struct drm_vram_mm */ +#if defined(CONFIG_DEBUG_FS) +static int drm_vram_mm_debugfs(struct seq_file *m, void *data) +{ + struct drm_info_node *node = (struct drm_info_node *) m->private; + struct drm_vram_mm *vmm = node->minor->dev->vram_mm; + struct drm_mm *mm = vmm->bdev.man[TTM_PL_VRAM].priv; + struct ttm_bo_global *glob = vmm->bdev.glob; + struct drm_printer p = drm_seq_file_printer(m); + + spin_lock(&glob->lru_lock); + drm_mm_print(mm, &p); + spin_unlock(&glob->lru_lock); + return 0; +} + +static struct drm_info_list drm_vram_mm_debugfs_list[] = { + { "vram-mm", drm_vram_mm_debugfs, 0, NULL }, +}; +#endif + +int drm_vram_mm_debugfs_init(struct drm_minor *minor) +{ +#if defined(CONFIG_DEBUG_FS) + drm_debugfs_create_files(drm_vram_mm_debugfs_list, +ARRAY_SIZE(drm_vram_mm_debugfs_list), +minor->debugfs_root, minor); +#endif + return 0; +} +EXPORT_SYMBOL(drm_vram_mm_debugfs_init); + /** * drm_vram_mm_init() - Initialize an instance of VRAM MM. * @vmm: the VRAM MM instance to initialize -- 2.18.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 0/7] backlight: gpio: simplify the driver
pon., 2 wrz 2019 o 11:31 Lee Jones napisał(a): > > On Wed, 24 Jul 2019, Bartosz Golaszewski wrote: > > > From: Bartosz Golaszewski > > > > While working on my other series related to gpio-backlight[1] I noticed > > that we could simplify the driver if we made the only user of platform > > data use GPIO lookups and device properties. This series tries to do > > that. > > > > The first patch adds all necessary data structures to ecovec24. Patch > > 2/7 unifies much of the code for both pdata and non-pdata cases. Patches > > 3-4/7 remove unused platform data fields. Last three patches contain > > additional improvements for the GPIO backlight driver while we're already > > modifying it. > > > > I don't have access to this HW but hopefully this works. Only compile > > tested. > > > > [1] https://lkml.org/lkml/2019/6/25/900 > > > > v1 -> v2: > > - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy > > - added additional two patches with minor improvements > > > > v2 -> v3: > > - in patch 7/7: used initializers to set values for pdata and dev local vars > > > > Bartosz Golaszewski (7): > > sh: ecovec24: add additional properties to the backlight device > > backlight: gpio: simplify the platform data handling > > sh: ecovec24: don't set unused fields in platform data > > backlight: gpio: remove unused fields from platform data > > backlight: gpio: remove dev from struct gpio_backlight > > backlight: gpio: remove def_value from struct gpio_backlight > > backlight: gpio: use a helper variable for &pdev->dev > > > > arch/sh/boards/mach-ecovec24/setup.c | 33 ++-- > > drivers/video/backlight/gpio_backlight.c | 82 +--- > > include/linux/platform_data/gpio_backlight.h | 3 - > > 3 files changed, 44 insertions(+), 74 deletions(-) > > Can you collect all your Acks and re-submit please? > Done. Bart > -- > Lee Jones [李琼斯] > Linaro Services Technical Lead > Linaro.org │ Open source software for ARM SoCs > Follow Linaro: Facebook | Twitter | Blog
[RESEND PATCH v3 1/7] sh: ecovec24: add additional properties to the backlight device
From: Bartosz Golaszewski Add a GPIO lookup entry and a device property for GPIO backlight to the board file. Tie them to the platform device which is now registered using platform_device_register_full() because of the properties. These changes are inactive now but will be used once the gpio backlight driver is modified. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij --- arch/sh/boards/mach-ecovec24/setup.c | 30 +++- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index f402aa741bf3..6926bb3865b9 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c @@ -371,6 +371,19 @@ static struct platform_device lcdc_device = { }, }; +static struct gpiod_lookup_table gpio_backlight_lookup = { + .dev_id = "gpio-backlight.0", + .table = { + GPIO_LOOKUP("sh7724_pfc", GPIO_PTR1, NULL, GPIO_ACTIVE_HIGH), + { } + }, +}; + +static struct property_entry gpio_backlight_props[] = { + PROPERTY_ENTRY_BOOL("default-on"), + { } +}; + static struct gpio_backlight_platform_data gpio_backlight_data = { .fbdev = &lcdc_device.dev, .gpio = GPIO_PTR1, @@ -378,13 +391,15 @@ static struct gpio_backlight_platform_data gpio_backlight_data = { .name = "backlight", }; -static struct platform_device gpio_backlight_device = { +static const struct platform_device_info gpio_backlight_device_info = { .name = "gpio-backlight", - .dev = { - .platform_data = &gpio_backlight_data, - }, + .data = &gpio_backlight_data, + .size_data = sizeof(gpio_backlight_data), + .properties = gpio_backlight_props, }; +static struct platform_device *gpio_backlight_device; + /* CEU0 */ static struct ceu_platform_data ceu0_pdata = { .num_subdevs= 2, @@ -1006,7 +1021,6 @@ static struct platform_device *ecovec_devices[] __initdata = { &usb1_common_device, &usbhs_device, &lcdc_device, - &gpio_backlight_device, &keysc_device, &cn12_power, #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) @@ -1464,6 +1478,12 @@ static int __init arch_setup(void) #endif #endif + gpiod_add_lookup_table(&gpio_backlight_lookup); + gpio_backlight_device = platform_device_register_full( + &gpio_backlight_device_info); + if (IS_ERR(gpio_backlight_device)) + return PTR_ERR(gpio_backlight_device); + return platform_add_devices(ecovec_devices, ARRAY_SIZE(ecovec_devices)); } -- 2.21.0
[RESEND PATCH v3 4/7] backlight: gpio: remove unused fields from platform data
From: Bartosz Golaszewski Remove the platform data fields that nobody uses. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Reviewed-by: Daniel Thompson --- include/linux/platform_data/gpio_backlight.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/linux/platform_data/gpio_backlight.h b/include/linux/platform_data/gpio_backlight.h index 34179d600360..1a8b5b1946fe 100644 --- a/include/linux/platform_data/gpio_backlight.h +++ b/include/linux/platform_data/gpio_backlight.h @@ -9,9 +9,6 @@ struct device; struct gpio_backlight_platform_data { struct device *fbdev; - int gpio; - int def_value; - const char *name; }; #endif -- 2.21.0
[RESEND PATCH v3 0/7] backlight: gpio: simplify the driver
From: Bartosz Golaszewski While working on my other series related to gpio-backlight[1] I noticed that we could simplify the driver if we made the only user of platform data use GPIO lookups and device properties. This series tries to do that. The first patch adds all necessary data structures to ecovec24. Patch 2/7 unifies much of the code for both pdata and non-pdata cases. Patches 3-4/7 remove unused platform data fields. Last three patches contain additional improvements for the GPIO backlight driver while we're already modifying it. I don't have access to this HW but hopefully this works. Only compile tested. [1] https://lkml.org/lkml/2019/6/25/900 v1 -> v2: - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy - added additional two patches with minor improvements v2 -> v3: - in patch 7/7: used initializers to set values for pdata and dev local vars Bartosz Golaszewski (7): sh: ecovec24: add additional properties to the backlight device backlight: gpio: simplify the platform data handling sh: ecovec24: don't set unused fields in platform data backlight: gpio: remove unused fields from platform data backlight: gpio: remove dev from struct gpio_backlight backlight: gpio: remove def_value from struct gpio_backlight backlight: gpio: use a helper variable for &pdev->dev arch/sh/boards/mach-ecovec24/setup.c | 33 ++-- drivers/video/backlight/gpio_backlight.c | 82 +--- include/linux/platform_data/gpio_backlight.h | 3 - 3 files changed, 44 insertions(+), 74 deletions(-) -- 2.21.0
[RESEND PATCH v3 3/7] sh: ecovec24: don't set unused fields in platform data
From: Bartosz Golaszewski Platform data fields other than fbdev are no longer used by the backlight driver. Remove them. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij --- arch/sh/boards/mach-ecovec24/setup.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 6926bb3865b9..64a5a1662b6d 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c @@ -386,9 +386,6 @@ static struct property_entry gpio_backlight_props[] = { static struct gpio_backlight_platform_data gpio_backlight_data = { .fbdev = &lcdc_device.dev, - .gpio = GPIO_PTR1, - .def_value = 1, - .name = "backlight", }; static const struct platform_device_info gpio_backlight_device_info = { -- 2.21.0
dri-devel@lists.freedesktop.org
From: Bartosz Golaszewski Instead of dereferencing pdev each time, use a helper variable for the associated device pointer. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Reviewed-by: Daniel Thompson Reviewed-by: Andy Shevchenko --- drivers/video/backlight/gpio_backlight.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index cd6a75bca9cc..7dc4f90d926b 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -54,29 +54,29 @@ static const struct backlight_ops gpio_backlight_ops = { static int gpio_backlight_probe(struct platform_device *pdev) { - struct gpio_backlight_platform_data *pdata = - dev_get_platdata(&pdev->dev); + struct device *dev = &pdev->dev; + struct gpio_backlight_platform_data *pdata = dev_get_platdata(dev); struct backlight_properties props; struct backlight_device *bl; struct gpio_backlight *gbl; enum gpiod_flags flags; int ret, def_value; - gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL); + gbl = devm_kzalloc(dev, sizeof(*gbl), GFP_KERNEL); if (gbl == NULL) return -ENOMEM; if (pdata) gbl->fbdev = pdata->fbdev; - def_value = device_property_read_bool(&pdev->dev, "default-on"); + def_value = device_property_read_bool(dev, "default-on"); flags = def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; - gbl->gpiod = devm_gpiod_get(&pdev->dev, NULL, flags); + gbl->gpiod = devm_gpiod_get(dev, NULL, flags); if (IS_ERR(gbl->gpiod)) { ret = PTR_ERR(gbl->gpiod); if (ret != -EPROBE_DEFER) { - dev_err(&pdev->dev, + dev_err(dev, "Error: The gpios parameter is missing or invalid.\n"); } return ret; @@ -85,11 +85,10 @@ static int gpio_backlight_probe(struct platform_device *pdev) memset(&props, 0, sizeof(props)); props.type = BACKLIGHT_RAW; props.max_brightness = 1; - bl = devm_backlight_device_register(&pdev->dev, dev_name(&pdev->dev), - &pdev->dev, gbl, &gpio_backlight_ops, - &props); + bl = devm_backlight_device_register(dev, dev_name(dev), dev, gbl, + &gpio_backlight_ops, &props); if (IS_ERR(bl)) { - dev_err(&pdev->dev, "failed to register backlight\n"); + dev_err(dev, "failed to register backlight\n"); return PTR_ERR(bl); } -- 2.21.0
[RESEND PATCH v3 2/7] backlight: gpio: simplify the platform data handling
From: Bartosz Golaszewski Now that the last user of platform data (sh ecovec24) defines a proper GPIO lookup and sets the 'default-on' device property, we can drop the platform_data-specific GPIO handling and unify a big chunk of code. The only field used from the platform data is now the fbdev pointer. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Reviewed-by: Daniel Thompson Reviewed-by: Andy Shevchenko --- drivers/video/backlight/gpio_backlight.c | 64 +--- 1 file changed, 13 insertions(+), 51 deletions(-) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index e84f3087e29f..01262186fa1e 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -55,30 +55,6 @@ static const struct backlight_ops gpio_backlight_ops = { .check_fb = gpio_backlight_check_fb, }; -static int gpio_backlight_probe_dt(struct platform_device *pdev, - struct gpio_backlight *gbl) -{ - struct device *dev = &pdev->dev; - enum gpiod_flags flags; - int ret; - - gbl->def_value = device_property_read_bool(dev, "default-on"); - flags = gbl->def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; - - gbl->gpiod = devm_gpiod_get(dev, NULL, flags); - if (IS_ERR(gbl->gpiod)) { - ret = PTR_ERR(gbl->gpiod); - - if (ret != -EPROBE_DEFER) { - dev_err(dev, - "Error: The gpios parameter is missing or invalid.\n"); - } - return ret; - } - - return 0; -} - static int gpio_backlight_probe(struct platform_device *pdev) { struct gpio_backlight_platform_data *pdata = @@ -86,6 +62,7 @@ static int gpio_backlight_probe(struct platform_device *pdev) struct backlight_properties props; struct backlight_device *bl; struct gpio_backlight *gbl; + enum gpiod_flags flags; int ret; gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL); @@ -94,35 +71,20 @@ static int gpio_backlight_probe(struct platform_device *pdev) gbl->dev = &pdev->dev; - if (pdev->dev.fwnode) { - ret = gpio_backlight_probe_dt(pdev, gbl); - if (ret) - return ret; - } else if (pdata) { - /* -* Legacy platform data GPIO retrieveal. Do not expand -* the use of this code path, currently only used by one -* SH board. -*/ - unsigned long flags = GPIOF_DIR_OUT; - + if (pdata) gbl->fbdev = pdata->fbdev; - gbl->def_value = pdata->def_value; - flags |= gbl->def_value ? GPIOF_INIT_HIGH : GPIOF_INIT_LOW; - - ret = devm_gpio_request_one(gbl->dev, pdata->gpio, flags, - pdata ? pdata->name : "backlight"); - if (ret < 0) { - dev_err(&pdev->dev, "unable to request GPIO\n"); - return ret; + + gbl->def_value = device_property_read_bool(&pdev->dev, "default-on"); + flags = gbl->def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; + + gbl->gpiod = devm_gpiod_get(&pdev->dev, NULL, flags); + if (IS_ERR(gbl->gpiod)) { + ret = PTR_ERR(gbl->gpiod); + if (ret != -EPROBE_DEFER) { + dev_err(&pdev->dev, + "Error: The gpios parameter is missing or invalid.\n"); } - gbl->gpiod = gpio_to_desc(pdata->gpio); - if (!gbl->gpiod) - return -EINVAL; - } else { - dev_err(&pdev->dev, - "failed to find platform data or device tree node.\n"); - return -ENODEV; + return ret; } memset(&props, 0, sizeof(props)); -- 2.21.0
[RESEND PATCH v3 5/7] backlight: gpio: remove dev from struct gpio_backlight
From: Bartosz Golaszewski This field is unused. Remove it. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Reviewed-by: Daniel Thompson --- drivers/video/backlight/gpio_backlight.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index 01262186fa1e..70882556f047 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -19,9 +19,7 @@ #include struct gpio_backlight { - struct device *dev; struct device *fbdev; - struct gpio_desc *gpiod; int def_value; }; @@ -69,8 +67,6 @@ static int gpio_backlight_probe(struct platform_device *pdev) if (gbl == NULL) return -ENOMEM; - gbl->dev = &pdev->dev; - if (pdata) gbl->fbdev = pdata->fbdev; -- 2.21.0
Re: [PATCH] drm/vkms: Use alpha value to blend values.
On Sat, Aug 31, 2019 at 06:25:46PM +0100, Sidong Yang wrote: > Use alpha value to blend source value and destination value Instead of > just overwrite with source value. > > Signed-off-by: Sidong Yang > --- > drivers/gpu/drm/vkms/vkms_composer.c | 13 +++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/vkms/vkms_composer.c > b/drivers/gpu/drm/vkms/vkms_composer.c > index d5585695c64d..b776185e5cb5 100644 > --- a/drivers/gpu/drm/vkms/vkms_composer.c > +++ b/drivers/gpu/drm/vkms/vkms_composer.c > @@ -75,6 +75,9 @@ static void blend(void *vaddr_dst, void *vaddr_src, > int y_limit = y_src + h_dst; > int x_limit = x_src + w_dst; > > + u8 *src, *dst; > + u32 alpha, inv_alpha; These could all live in a tighter scope. Apart from that lgtm Reviewed-by: Ville Syrjälä > + > for (i = y_src, i_dst = y_dst; i < y_limit; ++i) { > for (j = x_src, j_dst = x_dst; j < x_limit; ++j) { > offset_dst = dest_composer->offset > @@ -84,8 +87,14 @@ static void blend(void *vaddr_dst, void *vaddr_src, >+ (i * src_composer->pitch) >+ (j * src_composer->cpp); > > - memcpy(vaddr_dst + offset_dst, > -vaddr_src + offset_src, sizeof(u32)); > + src = vaddr_src + offset_src; > + dst = vaddr_dst + offset_dst; > + alpha = src[3] + 1; > + inv_alpha = 256 - src[3]; > + dst[0] = (alpha * src[0] + inv_alpha * dst[0]) >> 8; > + dst[1] = (alpha * src[1] + inv_alpha * dst[1]) >> 8; > + dst[2] = (alpha * src[2] + inv_alpha * dst[2]) >> 8; > + dst[3] = 0xff; > } > i_dst++; > } > -- > 2.20.1 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrjälä Intel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 111481] AMD Navi GPU frequent freezes on both Manjaro/Ubuntu with kernel 5.3 and mesa 19.2 -git/llvm9
https://bugs.freedesktop.org/show_bug.cgi?id=111481 --- Comment #20 from Marko Popovic --- (In reply to Pierre-Eric Pelloux-Prayer from comment #19) > Thanks for the trace! > > Replaying the trace a few times is enough to reliably to reproduce the hang. > > Using AMD_DEBUG=nongg seems to prevent it so it could be a temporary > workaround until a proper fix is found. > Could you confirm this on your system? > > > > > > I am adding Rocket League crash output from apitrace. > > This trace file is very small (only one frame) and doesn't hang here. Thanks for the workaround! Here are my results: -AMD_DEBUG=nongg works to fix the Citra-related crash - It doesn't work to fix Rocket League related hang, that seems to be a completely different beast... the GPU hang happens as well but I don't know why, apparently apitrace doesn't provide any useful information as to why it happens. Now I will continue testing to see whether citra-related crash workaround also works for my desktop random freezes and hangs and will report back. I added AMD_DEBUG=nongg to my /etc/environment so it should be applied to desktop as well. -- 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 v2] drm: dw-hdmi-i2s: enable audio clock in audio_startup
On 02/09/2019 12:32, Jonas Karlman wrote: > On 2019-09-02 11:42, Neil Armstrong wrote: >> Hi, >> >> On 02/09/2019 05:54, Cheng-Yi Chiang wrote: >>> In the designware databook, the sequence of enabling audio clock and >>> setting format is not clearly specified. >>> Currently, audio clock is enabled in the end of hw_param ops after >>> setting format. >>> >>> On some monitors, there is a possibility that audio does not come out. >>> Fix this by enabling audio clock in audio_startup ops >>> before hw_param ops setting format. >>> >>> Signed-off-by: Cheng-Yi Chiang >>> Reviewed-by: Douglas Anderson >>> Reviewed-by: Jonas Karlman >>> Tested-by: Douglas Anderson >>> --- >>> Changes from v1: >>> 1. Move audio_startup to the front of audio_shutdown. >>> 2. Fix the indentation of audio_startup equal sign using tab. >>> 3. Rebase the patch on linux-next/master. >>> 4. Add Reviewed-by and Tested-by fields from diand...@chromium.org. >>> 5. Add Reviewed-by field from jo...@kwiboo.se. >>> >>> drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 9 + >>> 1 file changed, 9 insertions(+) >>> >>> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c >>> b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c >>> index 1d15cf9b6821..34d8e837555f 100644 >>> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c >>> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c >>> @@ -109,6 +109,14 @@ static int dw_hdmi_i2s_hw_params(struct device *dev, >>> void *data, >>> hdmi_write(audio, conf0, HDMI_AUD_CONF0); >>> hdmi_write(audio, conf1, HDMI_AUD_CONF1); >>> >>> + return 0; >>> +} >>> + >>> +static int dw_hdmi_i2s_audio_startup(struct device *dev, void *data) >>> +{ >>> + struct dw_hdmi_i2s_audio_data *audio = data; >>> + struct dw_hdmi *hdmi = audio->hdmi; >>> + >>> dw_hdmi_audio_enable(hdmi); >>> >>> return 0; >>> @@ -153,6 +161,7 @@ static int dw_hdmi_i2s_get_dai_id(struct >>> snd_soc_component *component, >>> >>> static struct hdmi_codec_ops dw_hdmi_i2s_ops = { >>> .hw_params = dw_hdmi_i2s_hw_params, >>> + .audio_startup = dw_hdmi_i2s_audio_startup, >>> .audio_shutdown = dw_hdmi_i2s_audio_shutdown, >>> .get_eld= dw_hdmi_i2s_get_eld, >>> .get_dai_id = dw_hdmi_i2s_get_dai_id, >>> >> Looks sane, Jonas should I apply it now it's rebased ? > > Sure, looks sane and compiles without warnings on my build host. Thx, Applied to drm-misc-next Neil > > Regards, > Jonas > >> >> Neil >
[PATCH] habanalabs: fix semicolon.cocci warnings
From: kbuild test robot drivers/misc/habanalabs/device.c:552:2-3: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Fixes: 127d20c1da61 ("habanalabs: add uapi to retrieve device utilization") Signed-off-by: kbuild test robot --- tree: git://people.freedesktop.org/~gabbayo/linux habanalabs-next head: f3d40ffeb89564d31295fb01bc04929661e2bbcf commit: 127d20c1da61045a7903c5d76afe14b3a3a097c2 [25/29] habanalabs: add uapi to retrieve device utilization device.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/misc/habanalabs/device.c +++ b/drivers/misc/habanalabs/device.c @@ -549,7 +549,7 @@ uint32_t hl_device_utilization(struct hl ts = &hdev->idle_busy_ts_arr[last_index]; overlap_cnt++; - }; + } return DIV_ROUND_UP(((total_busy_time_us / USEC_PER_MSEC) * 100), period_ms); ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[gabbayo:habanalabs-next 25/29] drivers/misc/habanalabs/device.c:552:2-3: Unneeded semicolon
tree: git://people.freedesktop.org/~gabbayo/linux habanalabs-next head: f3d40ffeb89564d31295fb01bc04929661e2bbcf commit: 127d20c1da61045a7903c5d76afe14b3a3a097c2 [25/29] habanalabs: add uapi to retrieve device utilization If you fix the issue, kindly add following tag Reported-by: kbuild test robot coccinelle warnings: (new ones prefixed by >>) >> drivers/misc/habanalabs/device.c:552:2-3: Unneeded semicolon Please review and possibly fold the followup patch. --- 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 111481] AMD Navi GPU frequent freezes on both Manjaro/Ubuntu with kernel 5.3 and mesa 19.2 -git/llvm9
https://bugs.freedesktop.org/show_bug.cgi?id=111481 --- Comment #19 from Pierre-Eric Pelloux-Prayer --- (In reply to Marko Popovic from comment #17) > (In reply to Pierre-Eric Pelloux-Prayer from comment #15) > > (In reply to Marko Popovic from comment #14) > > > > > > Yes, always happens at the same place with Citra emulator > > > > Could you capture a trace of the problem (using Apitrace or Renderdoc)? > > > > This would be very helpful to fix it. > > I added reproduced Citra crash recorded by using command: > apitrace trace ./citra-qt > > I hope this is correct, if you need anything else or done differently please > just let me know! Thanks for the trace! Replaying the trace a few times is enough to reliably to reproduce the hang. Using AMD_DEBUG=nongg seems to prevent it so it could be a temporary workaround until a proper fix is found. Could you confirm this on your system? > > I am adding Rocket League crash output from apitrace. This trace file is very small (only one frame) and doesn't hang here. -- 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 3/3] drm/edid: no CEA extension is not an error
On Fri, Aug 30, 2019 at 06:16:52PM +0200, Jean Delvare wrote: > It is fine for displays without audio functionality to not implement > CEA extension in their EDID. Do not return an error in that case, > instead return 0 as if there was a CEA extension with no audio or > speaker block. > > This fixes half of bug fdo#107825: > https://bugs.freedesktop.org/show_bug.cgi?id=107825 > > Signed-off-by: Jean Delvare > Cc: Maarten Lankhorst > Cc: Maxime Ripard > Cc: Sean Paul > Cc: David Airlie > Cc: Daniel Vetter > --- > drivers/gpu/drm/drm_edid.c |4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > --- linux-5.2.orig/drivers/gpu/drm/drm_edid.c 2019-08-30 17:57:38.10995 > +0200 > +++ linux-5.2/drivers/gpu/drm/drm_edid.c 2019-08-30 18:04:36.840333834 > +0200 > @@ -4130,7 +4130,7 @@ int drm_edid_to_sad(struct edid *edid, s > cea = drm_find_cea_extension(edid); > if (!cea) { > DRM_DEBUG_KMS("SAD: no CEA Extension found\n"); > - return -ENOENT; > + return 0; > } Seems reasonable. Maybe the cea_revision<3 branches should alse return 0? Either way Reviewed-by: Ville Syrjälä > > if (cea_revision(cea) < 3) { > @@ -4191,7 +4191,7 @@ int drm_edid_to_speaker_allocation(struc > cea = drm_find_cea_extension(edid); > if (!cea) { > DRM_DEBUG_KMS("SAD: no CEA Extension found\n"); > - return -ENOENT; > + return 0; > } > > if (cea_revision(cea) < 3) { > > -- > Jean Delvare > SUSE L3 Support > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrjälä Intel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/2] drm/panel: Add DT bindings for Sony ACX424AKP
On Mon, Sep 2, 2019 at 11:35 AM Thierry Reding wrote: > > + dsi-command-mode: > > + type: boolean > > + description: > > + If this is specified, the panel will be used in command > > + mode instead of video mode. > > I'm not sure there's concensus on this one yet. I think so far the > driver decides which mode to use the panel in. Technically this falls > into the category of configuration, so it doesn't really belong in the > DT. The way we've used DT is for a bit of both hardware description and configuration I'd say, but I'm no authority on the subject. > I vaguely recall from discussions I've had on this subject that there's > usually no reason to do video mode if you can do command mode because > command mode is more power efficient. This was a long time ago, so I may > be misremembering. Perhaps you have different information on this? No idea. I was under the impression that video mode was preferred but I have no idea why. Yours, Linus Walleij ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel