[PATCH 4/5] drm/intel/dp: Try harder to get bpc of a DP sink if EDID doesn't tell.
Mario Kleiner
mario.kleiner.de at gmail.com
Sun Aug 7 16:10:39 UTC 2016
On 08/03/2016 02:03 PM, Mario Kleiner wrote:
> On 08/03/2016 08:09 AM, Daniel Vetter wrote:
>> On Wed, Aug 03, 2016 at 01:07:12PM +1000, Dave Airlie wrote:
>>> On 6 July 2016 at 20:05, Mario Kleiner <mario.kleiner.de at gmail.com>
>>> wrote:
>>>> For DP sinks which don't expose color depth via EDID, use
>>>> the drm_dp_sink_bpc() helper to derive the bpc of the sink.
>>>>
>>>> This should handle DP native sinks with the "Assume 6 bpc if EDID
>>>> doesn't tell us" as mandated by DP spec. It gives more accurate
>>>> values for DP->legacy converters for HDMI, DVI and VGA.
>>>
>>> Haswell says no.
>>
>> Yup indeed, sorry for missing that. Tomeu and Mika Kahola are working on
>> some fancy new dp helper to probe all that, and as part of that suitably
>> fill out connector->display_info, too. That would allow both the
>> inversion, and the dpcd transaction from within atomic_check (which is
>> kinda not that cool either).
>> -Daniel
>>
>
> Ups, sorry. They were only successfully tested with Ironlake and
> Ivybridge, non-MST, all the Intel hw i have here.
>
> Anyway, patches 1+2 and 5 are independent of those and will fix existing
> bugs and regressions in stable kernels. Patch 1 fixes what the commit
> reverted in patch 2 was fixing. Patch 2 fixes the DP->legacy regressions
> which affect my users, patch 5 adds robustness for DVI sinks in general,
> making full use of EDID 1.3 info.
>
> Maybe the logic in patch 3 can be somehow useful for Tomeu and Mika, as
> it was tested with different dp -> xx adapters. Happy to review or test
> once they have stuff ready.
>
So, how to proceed? Will the good ones be merged for 4.8? I could also
add a NULL-Ptr check to patch 4 and let it fall back to reporting 8 bpc
in case of dp-mst trouble if that is preferred for the time being?
I'd really like to get at least the regression fixes in before Tomeu or
Mika, as i assume once their work gets merged, touching the same code in
intel-kms, it will be impossible to back port my fixes or their work to
stable kernels.
Thanks,
-mario
> thanks,
> -mario
>
>>>
>>> ug 03 12:58:46 tyrion-bne-redhat-com kernel: fbcon: inteldrmfb (fb0)
>>> is primary device
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: BUG: unable to handle
>>> kernel NULL pointer dereference at 000000000000011b
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: IP: [<ffffffffa00e6cf5>]
>>> drm_dp_sink_bpc+0x5/0xb0 [drm_kms_helper]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: PGD 0
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: Oops: 0000 [#1] SMP
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: Modules linked in: i915
>>> ccm xt_CHECKSUM ipt_MASQUERADE nf_nat_masquerade_ipv4 tun
>>> ip6t_rpfilter ip6t_
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: videobuf2_core
>>> snd_hda_codec videodev mei_me mei snd_hwdep snd_seq snd_hda_core
>>> rtsx_pci media i2c_i
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: CPU: 1 PID: 752 Comm:
>>> kworker/1:3 Not tainted 4.7.0+ #12
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: Hardware name: LENOVO
>>> 20ARS25701/20ARS25701, BIOS GJET72WW (2.22 ) 02/21/2014
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: Workqueue: events_long
>>> drm_dp_mst_link_probe_work [drm_kms_helper]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: task: ffff880308583a80
>>> task.stack: ffff880309f20000
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: RIP:
>>> 0010:[<ffffffffa00e6cf5>] [<ffffffffa00e6cf5>]
>>> drm_dp_sink_bpc+0x5/0xb0 [drm_kms_helper]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: RSP:
>>> 0018:ffff880309f23b48 EFLAGS: 00010202
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: RAX: 000000000000000a
>>> RBX: 0000000000000006 RCX: 0000000000000000
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: RDX: 0000000000000000
>>> RSI: 0000000000000127 RDI: 0000000000000116
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: RBP: ffff880309f23b50
>>> R08: ffff880309734800 R09: 0000000000000024
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: R10: 0000000000000000
>>> R11: 0000000000000000 R12: ffff880309737800
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: R13: ffff88030a334000
>>> R14: ffff880309737000 R15: ffff880309737800
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: FS:
>>> 0000000000000000(0000) GS:ffff88031e240000(0000)
>>> knlGS:0000000000000000
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: CS: 0010 DS: 0000 ES:
>>> 0000 CR0: 0000000080050033
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: CR2: 000000000000011b
>>> CR3: 0000000001c06000 CR4: 00000000001406e0
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: Stack:
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: ffffffffa09d4295
>>> ffff880309f23bd8 ffffffffa09a7c1f ffffffff8122544d
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: ffff880306660258
>>> ffff880306660000 0000000009737800 ffff88030a331000
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: 0100880300000024
>>> ffff880309f23bb8 ffffffff00000024 ffff880309737800
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: Call Trace:
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffffa09d4295>] ?
>>> intel_dp_sink_bpc+0x25/0x30 [i915]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffffa09a7c1f>]
>>> intel_atomic_check+0xacf/0x1250 [i915]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffff8122544d>] ?
>>> __kmalloc_track_caller+0x12d/0x210
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffffa0097ea7>]
>>> drm_atomic_check_only+0x187/0x610 [drm]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffffa0098857>] ?
>>> drm_atomic_add_affected_connectors+0x27/0xf0 [drm]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffffa0098347>]
>>> drm_atomic_commit+0x17/0x60 [drm]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffffa00f4e0c>]
>>> restore_fbdev_mode+0x14c/0x260 [drm_kms_helper]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffffa00f6a23>]
>>> drm_fb_helper_restore_fbdev_mode_unlocked+0x33/0x80 [drm_kms_helper]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffffa00f6a9d>]
>>> drm_fb_helper_set_par+0x2d/0x50 [drm_kms_helper]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffffa00f69b8>]
>>> drm_fb_helper_hotplug_event+0x148/0x180 [drm_kms_helper]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffffa09c238a>]
>>> intel_fbdev_output_poll_changed+0x1a/0x20 [i915]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffffa00e79c7>]
>>> drm_kms_helper_hotplug_event+0x27/0x30 [drm_kms_helper]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffffa09cafa5>]
>>> intel_dp_mst_hotplug+0x15/0x20 [i915]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffffa00ee31a>]
>>> drm_dp_send_link_address+0x19a/0x220 [drm_kms_helper]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffff810df553>] ?
>>> put_prev_entity+0x33/0x410
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffff8111280b>] ?
>>> add_timer_on+0xdb/0x1b0
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffff8102c766>] ?
>>> __switch_to+0x2b6/0x600
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffff810e361e>] ?
>>> pick_next_task_fair+0x10e/0x4d0
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffffa00ee44d>]
>>> drm_dp_check_and_send_link_address+0xad/0xc0 [drm_kms_helper]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffffa00ee4b7>]
>>> drm_dp_mst_link_probe_work+0x57/0xb0 [drm_kms_helper]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffff810c086f>]
>>> process_one_work+0x15f/0x410
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffff810c0b6e>]
>>> worker_thread+0x4e/0x480
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffff810c0b20>] ?
>>> process_one_work+0x410/0x410
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffff810c0b20>] ?
>>> process_one_work+0x410/0x410
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffff810c64c8>]
>>> kthread+0xd8/0xf0
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffff817d527f>]
>>> ret_from_fork+0x1f/0x40
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: [<ffffffff810c63f0>] ?
>>> kthread_worker_fn+0x170/0x170
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: Code: b8 b0 1e 04 00 48
>>> 89 e5 74 11 40 80 ff 14 ba d0 78 02 00 b8 60 3d 08 00 0f 45 c2 5d c3
>>> 66 0f 1f
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: RIP
>>> [<ffffffffa00e6cf5>] drm_dp_sink_bpc+0x5/0xb0 [drm_kms_helper]
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: RSP <ffff880309f23b48>
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: CR2: 000000000000011b
>>> Aug 03 12:58:46 tyrion-bne-redhat-com kernel: ---[ end trace
>>> d3270996301ba013 ]---
>>>
>>> Possibly MST related.
>>>
>>> Dave.
>>
More information about the dri-devel
mailing list