Code Monkey home page Code Monkey logo

fl2000_drm's Introduction

Gitter Build Status Quality Gate Status

Linux kernel FL2000DX/IT66121FN dongle DRM driver

Clean re-implementation of FrescoLogic FL2000DX DRM driver and ITE Tech IT66121F driver, allowing to enable full display controller capabilities for USB-to-HDMI dongles based on such chips in Linux

Building driver

Check out the code and type

make

Use

insmod fl2000.ko && insmod it66121.ko

with sudo or in root shell to start the driver. If you are running on a system with secure boot enabled, you may need to sign kernel modules. Try using provided script for this:

./scritps/sign.sh

ensure that DRM components are loaded in your system, if not - please use

modprobe drm
modprobe drm_kms_helper

NOTE: proper kernel headers and build tools (e.g. "build-essential" package) must be installed on the system. Driver is developed and tested on Ubuntu 22.04 with Linux kernel 6.5.0, so better to test it this way. Please use gcc-8 or newer to build the driver

For more information check project's Wiki

fl2000_drm's People

Contributors

klogg avatar marcelwaldvogel avatar zeldin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fl2000_drm's Issues

Enable color management

Using IT66121 capabilities we can enable color conversion and gamma corrections. Something like this needed for start, then LUTs configuration etc.

   /* TODO: Setup color management and probably LUTs */
    drm_crtc_enable_color_mgmt(&drm_if->pipe.crtc, 0, false, 0);

   /* xxx->sRGB translation */
   drm_plane_create_color_properties(&drm_if->pipe.plane,
                   BIT(DRM_COLOR_YCBCR_BT601),
                   BIT(DRM_COLOR_YCBCR_LIMITED_RANGE),
                   DRM_COLOR_YCBCR_BT601,
                   DRM_COLOR_YCBCR_LIMITED_RANGE);

HDMI display blinking

When connecting my small HD display it sometimes blinks
OTOH latest version of FL2K Windows driver works smoothly so probably it is worth to dump USB and compare configuration

Optimize framebuffer device

  1. Maybe create emulated framebuffer device on monitor connect?
  2. Maybe instead of generic dumb buffers use GEM objects?

not working on Gentoo with kernel 5.10.27

I am trying the driver on Gentoo with kernel 5.10.27. The building was successful. quirks=1D5C:2000:USB_QUIRK_NO_LPM is added to boot params. However, it didn't work. There were errors in the dmesg

[   30.420909] usb 3-2: new high-speed USB device number 3 using xhci_hcd
[   30.549232] usb 3-2: New USB device found, idVendor=14cd, idProduct=8601, bcdDevice= 0.00
[   30.549237] usb 3-2: New USB device strings: Mfr=1, Product=3, SerialNumber=0
[   30.549240] usb 3-2: Product: USB 2.0 Hub
[   30.549242] usb 3-2: Manufacturer: USB Device
[   30.600764] hub 3-2:1.0: USB hub found
[   30.601042] hub 3-2:1.0: 4 ports detected
[   30.661055] usb 4-2: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[   30.674145] usb 4-2: config 1 interface 1 altsetting 0 has a duplicate endpoint with address 0x81, skipping
[   30.674150] usb 4-2: config 1 interface 1 altsetting 0 has a duplicate endpoint with address 0x1, skipping
[   30.674152] usb 4-2: config 1 interface 1 altsetting 1 has a duplicate endpoint with address 0x81, skipping
[   30.674154] usb 4-2: config 1 interface 1 altsetting 1 has a duplicate endpoint with address 0x1, skipping
[   30.674157] usb 4-2: config 1 interface 1 altsetting 2 has a duplicate endpoint with address 0x81, skipping
[   30.674159] usb 4-2: config 1 interface 1 altsetting 2 has a duplicate endpoint with address 0x1, skipping
[   30.674161] usb 4-2: config 1 interface 1 altsetting 3 has a duplicate endpoint with address 0x81, skipping
[   30.674163] usb 4-2: config 1 interface 1 altsetting 3 has a duplicate endpoint with address 0x1, skipping
[   30.674165] usb 4-2: config 1 interface 1 altsetting 4 has a duplicate endpoint with address 0x81, skipping
[   30.674167] usb 4-2: config 1 interface 1 altsetting 4 has a duplicate endpoint with address 0x1, skipping
[   30.674169] usb 4-2: config 1 interface 1 altsetting 5 has a duplicate endpoint with address 0x81, skipping
[   30.674171] usb 4-2: config 1 interface 1 altsetting 5 has a duplicate endpoint with address 0x1, skipping
[   30.674173] usb 4-2: config 1 interface 1 altsetting 6 has a duplicate endpoint with address 0x81, skipping
[   30.674175] usb 4-2: config 1 interface 1 altsetting 6 has a duplicate endpoint with address 0x1, skipping
[   30.674181] usb 4-2: New USB device found, idVendor=1d5c, idProduct=2000, bcdDevice= 2.00
[   30.674183] usb 4-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[   30.680952] usb-storage 4-2:1.3: USB Mass Storage device detected
[   30.681178] scsi host2: usb-storage 4-2:1.3
[   30.887874] usb 3-2.1: new full-speed USB device number 4 using xhci_hcd
[   30.996568] usb 3-2.1: New USB device found, idVendor=2000, idProduct=dd00, bcdDevice=11.16
[   30.996572] usb 3-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   30.996573] usb 3-2.1: Product: HZD100
[   30.996575] usb 3-2.1: Manufacturer: C&T
[   30.996576] usb 3-2.1: SerialNumber: U2dc0z7ws53a79rn
[   31.057962] input: C&T HZD100 as /devices/pci0000:00/0000:00:08.1/0000:04:00.4/usb3/3-2/3-2.1/3-2.1:1.3/0003:2000:DD00.0003/input/input28
[   31.110216] hid-generic 0003:2000:DD00.0003: input,hidraw2: USB HID v1.00 Device [C&T HZD100] on usb-0000:04:00.4-2.1/input3
[   31.236662] mc: Linux media interface: v0.10
[   31.437959] usbcore: registered new interface driver snd-usb-audio
[   31.512210] usbcore: registered new interface driver uas
[   31.708198] scsi 2:0:0:0: Direct-Access                               A001 PQ: 0 ANSI: 4
[   31.708651] sd 2:0:0:0: Attached scsi generic sg0 type 0
[   31.708882] sd 2:0:0:0: [sda] 2047 4096-byte logical blocks: (8.38 MB/8.00 MiB)
[   31.709035] sd 2:0:0:0: [sda] Write Protect is off
[   31.709037] sd 2:0:0:0: [sda] Mode Sense: 03 00 00 00
[   31.709155] sd 2:0:0:0: [sda] No Caching mode page found
[   31.709157] sd 2:0:0:0: [sda] Assuming drive cache: write through
[   31.721323]  sda:
[   31.722453] sd 2:0:0:0: [sda] Attached SCSI disk
[   47.325102] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[   62.685101] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[   73.445169] usbcore: registered new interface driver fl2000_usb
[   78.044969] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[   79.814204] i2c i2c-0: I2C transfer failed (-121)
[   79.814394] i2c i2c-10: Binding FL2000 master
[   79.814968] i2c 0-004c: Binding IT66121 component
[   79.922577] i2c i2c-10: Bridge attached
[   79.922600] i2c i2c-10: bound 0-004c (ops it66121_component_ops [it66121])
[   79.923308] [drm] Initialized fl2000_drm 0.0.1 20181001 for i2c-10 on minor 1
[   79.935645] i2c i2c-10: Cannot get monitor status (-121)
[   79.935793] i2c i2c-10: [drm] Cannot find any crtc or sizes
[   79.956820] i2c i2c-10: Cannot get monitor status (-121)
[   79.956927] i2c i2c-10: [drm] Cannot find any crtc or sizes
[   80.028391] i2c i2c-10: Cannot read interrupt status (-121)
[   91.970773] udevd[2434]: worker [4956] /devices/pci0000:00/0000:00:08.1/0000:04:00.4/usb4/4-2/4-2:1.2 is taking a long time
[   92.521076] udevd[4956]: slow: 'lmt-udev force' [6379]
[   93.287887] usb 4-2: Stopping interrupts
[   93.405234] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[   93.421269] i2c i2c-10: Binding FL2000 master
[   93.422121] i2c 0-004c: Binding IT66121 component
[   93.422126] i2c 0-004c: Cannot attach IT66121 bridge (-16)
[   93.422144] i2c i2c-10: failed to bind 0-004c (ops it66121_component_ops [it66121]): -16
[   93.422146] i2c i2c-10: Cannot attach bridge (-16)
[   93.422271] ------------[ cut here ]------------
[   93.422303] WARNING: CPU: 1 PID: 4962 at drivers/gpu/drm/drm_atomic_state_helper.c:172 drm_atomic_helper_crtc_duplicate_state+0x47/0x50 [drm_kms_helper]
[   93.422304] Modules linked in: it66121(OE) fl2000(OE) uas snd_usb_audio snd_usbmidi_lib snd_rawmidi snd_seq_device mc ccm rfcomm cmac tun 8021q garp mrp stp llc bnep joydev snd_soc_dmic snd_acp3x_pdm_dma snd_acp3x_rn snd_soc_core rtsx_pci_sdmmc snd_compress ac97_bus mmc_core snd_pcm_dmaengine hp_wmi sparse_keymap wmi_bmof hid_multitouch edac_mce_amd kvm_amd kvm irqbypass crct10dif_pclmul crc32_pclmul btusb iwlmvm crc32c_intel btrtl btbcm btintel ghash_clmulni_intel rapl bluetooth mac80211 ecdh_generic amdgpu pcspkr serio_raw ecc libarc4 snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi gpu_sched iwlwifi ttm snd_hda_intel snd_intel_dspcfg k10temp sp5100_tco binfmt_misc i2c_piix4 snd_hda_codec drm_kms_helper snd_hda_core snd_rn_pci_acp3x snd_pci_acp3x snd_hwdep cec snd_pcm cfg80211 ccp drm snd_timer snd soundcore rtsx_pci rfkill ucsi_acpi typec_ucsi typec wmi vboxnetadp(OE) vboxnetflt(OE) vboxdrv(OE) video i2c_hid pinctrl_amd acpi_cpufreq acpi_tad virtio_scsi
[   93.422390]  virtio_blk virtio_console virtio_balloon iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ixgb ixgbe tulip cxgb3 cxgb mdio cxgb4 tls vxge bonding vxlan ip6_udp_tunnel udp_tunnel macvlan vmxnet3 virtio_net net_failover failover tg3 sky2 r8169 pcnet32 mii igb i2c_algo_bit dca e1000 bnx2 atl1c fuse overlay xfs nfs lockd grace sunrpc nfs_ssc fscache jfs reiserfs multipath linear raid10 raid1 raid0 dm_raid raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx dm_crypt firewire_core crc_itu_t hid_sunplus hid_sony hid_samsung hid_pl hid_petalynx hid_monterey hid_microsoft hid_logitech ff_memless hid_gyration hid_ezkey hid_cypress hid_chicony hid_cherry hid_belkin hid_apple hid_a4tech sl811_hcd xhci_plat_hcd usb_storage lpfc nvmet_fc nvmet qla2xxx nvme_fc nvme_fabrics megaraid_sas megaraid_mbox megaraid_mm megaraid aacraid sx8 hpsa 3w_9xxx 3w_xxxx mptsas scsi_transport_sas mptfc scsi_transport_fc mptspi mptscsih mptbase atp870u dc395x qla1280 dmx3191d sym53c8xx gdth
[   93.422502]  fdomain initio BusLogic arcmsr aic7xxx aic79xx scsi_transport_spi pdc_adma sata_inic162x sata_mv sata_qstor sata_vsc sata_uli sata_sis sata_sx4 sata_nv sata_via sata_svw sata_
sil24 sata_sil sata_promise pata_sl82c105 pata_via pata_jmicron pata_marvell pata_sis pata_netcell pata_pdc202xx_old pata_triflex pata_atiixp pata_opti pata_amd pata_ali pata_it8213 pata_pcmcia pata_ns87415 pata_ns87410 pata_serverworks pata_oldpiix pata_artop pata_it821x pata_optidma pata_hpt3x2n pata_hpt3x3 pata_hpt37x pata_hpt366 pata_cmd64x pata_efar pata_sil680 pata_pdc2027x pata_mpiix
[   93.422558] CPU: 1 PID: 4962 Comm: usb-storage Tainted: G           OE     5.10.27-gentoo #1
[   93.422560] Hardware name: HP HP ENVY x360 Convertible 13-ay0xxx/876E, BIOS F.13 09/09/2020
[   93.422574] RIP: 0010:drm_atomic_helper_crtc_duplicate_state+0x47/0x50 [drm_kms_helper]
[   93.422577] Code: d4 ba 48 01 00 00 be c0 0c 00 00 e8 93 33 c1 d3 49 89 c4 48 85 c0 74 0b 48 89 c6 48 89 ef e8 f0 fe ff ff 4c 89 e0 5d 41 5c c3 <0f> 0b 4c 89 e0 5d 41 5c c3 0f 1f 44 00 00 48 89 f7 e9 a3 12 c1 d3
[   93.422579] RSP: 0018:ffffa248c1fd7ac0 EFLAGS: 00010246
[   93.422582] RAX: ffffffffc16cdd30 RBX: ffff91dd96289d80 RCX: 0000000000000000
[   93.422583] RDX: ffffa248c1fd7b30 RSI: 0000000000000002 RDI: ffff91ddf3583638
[   93.422585] RBP: ffff91ddf3583638 R08: 00000000ffffff8e R09: ffff91ddb34a2e20
[   93.422586] R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000000
[   93.422587] R13: ffff91ddb52c2800 R14: ffff91ddf3766808 R15: ffff91dd885e9b40
[   93.422590] FS:  0000000000000000(0000) GS:ffff91e07f640000(0000) knlGS:0000000000000000
[   93.422591] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   93.422593] CR2: 00001483b7122010 CR3: 0000000354610000 CR4: 0000000000350ee0
[   93.422594] Call Trace:
[   93.422632]  drm_atomic_get_crtc_state+0x73/0x110 [drm]
[   93.422648]  drm_atomic_helper_disable_all+0x8a/0x190 [drm_kms_helper]
[   93.422660]  drm_atomic_helper_shutdown+0x63/0x100 [drm_kms_helper]
[   93.422669]  ? _dev_err+0x5c/0x5e
[   93.422674]  fl2000_drm_release+0xe/0x20 [fl2000]
[   93.422696]  drm_dev_release+0x23/0x40 [drm]
[   93.422704]  release_nodes+0x22a/0x260
[   93.422711]  try_to_bring_up_master+0x25c/0x280
[   93.422716]  component_master_add_with_match+0xd1/0x110
[   93.422719]  fl2000_probe+0x7f/0x120 [fl2000]
[   93.422726]  usb_probe_interface+0xe0/0x280
[   93.422731]  really_probe+0xf0/0x400
[   93.422735]  driver_probe_device+0xe1/0x150
[   93.422738]  ? driver_allows_async_probing+0x50/0x50
[   93.422741]  bus_for_each_drv+0x6a/0xa0
[   93.422744]  __device_attach+0xc7/0x140
[   93.422748]  rebind_marked_interfaces.isra.0+0x62/0x90
[   93.422753]  usb_reset_device+0x1af/0x250
[   93.422761]  usb_stor_port_reset+0x52/0x70 [usb_storage]
[   93.422767]  usb_stor_invoke_transport+0x20a/0x510 [usb_storage]
[   93.422773]  ? try_to_wake_up+0x1ad/0x4d0
[   93.422777]  ? __prepare_to_swait+0x4b/0x70
[   93.422782]  ? wait_for_completion_interruptible+0xb1/0x120
[   93.422787]  usb_stor_control_thread+0x185/0x280 [usb_storage]
[   93.422791]  ? storage_probe+0x280/0x280 [usb_storage]
[   93.422796]  kthread+0xfe/0x140
[   93.422799]  ? kthread_park+0x90/0x90
[   93.422804]  ret_from_fork+0x22/0x30
[   93.422808] ---[ end trace 8d4c50ab56873abf ]---
[   93.422823] [drm:drm_atomic_helper_shutdown [drm_kms_helper]] *ERROR* Disabling all crtc's during unload failed with -12
[   93.422891] i2c i2c-10: master bind failed: -16
[   93.422905] usb 4-2: Cannot register component master (-16)
[   93.422919] fl2000_usb: probe of 4-2:1.2 failed with error -16
[   93.460110] i2c i2c-10: Cannot get monitor status (-121)
[   93.460364] i2c i2c-10: Cannot get monitor status (-121)

component bind crash

  1. insmod both drivers
  2. rmmod it66121.ko
  3. insmod it66121.ko ---> crash
[   37.933763] i2c i2c-1: Detecting IT66121 at address 0x4C on usb-0000:00:05.0-1
[   38.008557] i2c i2c-1: IT66121 found, revision 1
[   38.009515] it66121 1-004c: Probing IT66121 client
[   38.010453] it66121 1-004c: Found bridge it66121
[   38.011403] usb 2-1: Binding FL2000 master component
[   38.014640] BUG: unable to handle kernel NULL pointer dereference at 0000000000000179
[   38.016248] PGD 0 P4D 0 
[   38.016778] Oops: 0000 [#1] SMP PTI
[   38.017492] CPU: 0 PID: 309 Comm: insmod Tainted: G           OE     4.18.0-13-generic #14-Ubuntu
[   38.019272] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.1-1ubuntu1 04/01/2014
[   38.020760] RIP: 0010:drm_dev_init+0x163/0x2f0 [drm]
[   38.021134] Code: 00 00 00 48 8b 05 85 f4 04 00 48 8b 78 08 e8 94 89 2f d7 49 89 c4 48 3d 00 f0 ff ff 0f 87 9b 00 00 00 48 89 43 58 48 8b 43 20 <f6> 80 79 01 00 00 80 74 14 be 02 00 00 00 48 89 df e8 57 fd ff ff 
[   38.022543] RSP: 0018:ffffa52c001ff7f0 EFLAGS: 00010283
[   38.022939] RAX: 0000000000000000 RBX: ffff9247c3dfd018 RCX: 0000000000000000
[   38.023473] RDX: 000000000e111300 RSI: 000000000e111300 RDI: 000000005c1ffe30
[   38.024005] RBP: ffffa52c001ff818 R08: 0000000000000000 R09: 0000000000000001
[   38.024538] R10: 00000000001fffff R11: 00000000ffffffff R12: ffff9247c469c980
[   38.025073] R13: ffff9247c405f0a0 R14: ffffffffc05851a0 R15: 0000000000000001
[   38.025606] FS:  00007feaee505b80(0000) GS:ffff9247c7a00000(0000) knlGS:0000000000000000
[   38.026210] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   38.026642] CR2: 0000000000000179 CR3: 0000000003cc8006 CR4: 0000000000360ef0
[   38.027178] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   38.027713] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[   38.028246] Call Trace:
[   38.028437]  fl2000_bind+0x54/0x2b0 [fl2000]
[   38.028761]  try_to_bring_up_master+0x1d4/0x280
[   38.029103]  ? fl2000_bind+0x2b0/0x2b0 [fl2000]
[   38.029445]  component_add+0xa4/0x180
[   38.029725]  it66121_probe+0xb6/0xf0 [it66121]
[   38.030062]  i2c_device_probe+0x97/0x290
[   38.030361]  driver_probe_device+0x2e3/0x460
[   38.030684]  __device_attach_driver+0x97/0x100
[   38.031022]  ? __driver_attach+0x110/0x110
[   38.031334]  bus_for_each_drv+0x7b/0xc0
[   38.031626]  __device_attach+0xdd/0x160
[   38.031918]  device_initial_probe+0x13/0x20
[   38.032235]  bus_probe_device+0x95/0xa0
[   38.032527]  device_add+0x3a4/0x650
[   38.032793]  device_register+0x1a/0x20
[   38.033077]  i2c_new_device+0x168/0x360
[   38.033368]  i2c_detect+0x181/0x310
[   38.033635]  __process_new_driver+0x28/0x50
[   38.033951]  ? i2c_detect+0x310/0x310
[   38.034229]  bus_for_each_dev+0x74/0xb0
[   38.034519]  ? i2c_detect+0x310/0x310
[   38.034797]  i2c_for_each_dev+0x32/0x50
[   38.035090]  i2c_register_driver+0x5d/0x90
[   38.035400]  ? 0xffffffffc03e9000
[   38.035652]  it66121_driver_init+0x1c/0x1000 [it66121]
[   38.036040]  do_one_initcall+0x4a/0x1c4
[   38.036332]  ? free_pcp_prepare+0x4f/0xd0
[   38.036637]  ? _cond_resched+0x19/0x30
[   38.037002]  ? kmem_cache_alloc_trace+0xb8/0x1d0
[   38.037443]  ? do_init_module+0x27/0x220
[   38.037822]  do_init_module+0x60/0x220
[   38.038184]  load_module+0x14f4/0x1890
[   38.038547]  __do_sys_finit_module+0xbd/0x120
[   38.038967]  ? __do_sys_finit_module+0xbd/0x120
[   38.039401]  __x64_sys_finit_module+0x1a/0x20
[   38.039819]  do_syscall_64+0x5a/0x110
[   38.040173]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[   38.040657] RIP: 0033:0x7feaee642219
[   38.041002] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 47 fc 0c 00 f7 d8 64 89 01 48 
[   38.042785] RSP: 002b:00007ffc9650f528 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[   38.043510] RAX: ffffffffffffffda RBX: 0000555b537a07a0 RCX: 00007feaee642219
[   38.044189] RDX: 0000000000000000 RSI: 0000555b526b0338 RDI: 0000000000000003
[   38.044734] RBP: 0000555b526b0338 R08: 0000000000000000 R09: 00007feaee715000
[   38.045266] R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000
[   38.045810] R13: 0000555b537a0760 R14: 0000000000000000 R15: 0000000000000000
[   38.046333] Modules linked in: it66121(OE+) fl2000(OE) drm_kms_helper fb_sys_fops syscopyarea sysfillrect sysimgblt drm kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc aesni_intel aes_x86_64 crypto_simd cryptd glue_helper input_leds psmouse serio_raw i2c_piix4 pata_acpi mac_hid floppy qemu_fw_cfg 9pnet_virtio 9p 9pnet fscache [last unloaded: it66121]
[   38.048822] CR2: 0000000000000179
[   38.049075] ---[ end trace ca551b1c9b83ed08 ]---
[   38.049429] RIP: 0010:drm_dev_init+0x163/0x2f0 [drm]
[   38.049802] Code: 00 00 00 48 8b 05 85 f4 04 00 48 8b 78 08 e8 94 89 2f d7 49 89 c4 48 3d 00 f0 ff ff 0f 87 9b 00 00 00 48 89 43 58 48 8b 43 20 <f6> 80 79 01 00 00 80 74 14 be 02 00 00 00 48 89 df e8 57 fd ff ff 
[   38.051201] RSP: 0018:ffffa52c001ff7f0 EFLAGS: 00010283
[   38.051593] RAX: 0000000000000000 RBX: ffff9247c3dfd018 RCX: 0000000000000000
[   38.052124] RDX: 000000000e111300 RSI: 000000000e111300 RDI: 000000005c1ffe30
[   38.052655] RBP: ffffa52c001ff818 R08: 0000000000000000 R09: 0000000000000001
[   38.053186] R10: 00000000001fffff R11: 00000000ffffffff R12: ffff9247c469c980
[   38.053717] R13: ffff9247c405f0a0 R14: ffffffffc05851a0 R15: 0000000000000001
[   38.054247] FS:  00007feaee505b80(0000) GS:ffff9247c7a00000(0000) knlGS:0000000000000000
[   38.054848] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   38.055279] CR2: 0000000000000179 CR3: 0000000003cc8006 CR4: 0000000000360ef0
[   38.055811] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   38.056343] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Mint 20.2 install, does not seem to work.

N34 Fanless Mini PC + Linux Mint 20.2 Uma + 5.11.0-27-generic
Install seems ok, but no output on screen or selection within displays.

lshw shows:-
*-usbhost:1
product: xHCI Host Controller
vendor: Linux 5.11.0-27-generic xhci-hcd
physical id: 1
bus info: usb@2
logical name: usb2
version: 5.11
capabilities: usb-3.00
configuration: driver=hub slots=7 speed=5000Mbit/s
*-usb
description: Mass storage device
product: FL2000/FL2000DX VGA/DVI/HDMI Adapter
vendor: Fresco Logic
physical id: 3
bus info: usb@2:3
version: 2.00
capabilities: usb-3.00 scsi
configuration: driver=usb-storage maxpower=496mA speed=5000Mbit/s

attached dmseg output.
dmseg-out.txt

Problems with the IT66121 driver

The problems that are occurring are as follows.

  1. When you insert the driver, it completely locks the system and it is necessary to shut down the computer by means of brute force.
    I think the third time this happened to me, my system became corrupted and it was necessary to do a restoration.

  2. If the module is inserted and does not lock, when I put the computer in sleep mode and come back, the system is all locked too, having to shut down via brute force.

More checks maybe

clang-format -i *.[ch]
make C=1 CHECK="/usr/bin/sparse"
make C=1 CHECK="scripts/coccicheck"
make C=1 CHECK="smatch -p=kernel"
make W=123

No Display, Sound and Network stops working

Hi,

Firstly, I want to say that I really appreciate this project. Cheers to the developer!
Secondly, I want to point out that there really isn't clear instructions on how to install and use the driver (the section How to use in the README is not helpful) for someone who isn't knowledge about drivers, like myself. If that information could be extended that will be appreciated.
Thirdly, I tried installing the drivers but the display is not picked up in the display settings and the screen is blank. However, now I have two new options in the Sound settings - usb extscreen Digital and Analogue. Also, my network breaks and the internet is not accessible (I presume it thinks of it as an ethernet connection perhaps?)

I am using Ubuntu 20.04. To install I used these steps:

  1. make all
  2. sudo ./startup.sh in the scripts folder. This did not work - after some digging, I changed the tcpdump line to tcpdump -Z root -i usbmon2 -nn -w /tmp/usb.pcap -c 20000 & and moved the file to the main folder. Following this, it worked and have the response : listening on usbmon2, link-type USB_LINUX_MMAPPED (USB with padded Linux header), capture size 262144 bytes . But the problems I stated above still remains.

Any help would be really appreciated. Thanks

i2c detect crash

Steps to reproduce

  1. insmod both drivers
  2. rmmod both drivers
  3. insmod fl2000.ko
  4. insmod it66121.ko ---> crash
[  145.533231] usb 2-1: Failed to create 2-1 debugfs directory
[  145.540140] i2c i2c-2: Connected FL2000 I2C adapter
[  145.542596] usb 2-1: Probing Streaming interface (1)
[  145.545080] usb 2-1: Probing Interrupt interface (2)
[  145.547537] fl2000_usb 2-1:1.2: Setting interrupt interface 2: altsetting 0, endpoint 3
[  145.555110] usb 2-1:  *** 0x48000020
[  145.556973] usbcore: registered new interface driver fl2000_usb
[  145.599042] BUG: unable to handle kernel paging request at ffffffffc05ac310
[  145.600015] PGD 560e067 P4D 560e067 PUD 5610067 PMD 3d68067 PTE 0
[  145.600861] Oops: 0000 [#1] SMP PTI
[  145.601352] CPU: 0 PID: 321 Comm: insmod Tainted: G           OE     4.18.0-13-generic #14-Ubuntu
[  145.602576] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.1-1ubuntu1 04/01/2014
[  145.603826] RIP: 0010:i2c_default_probe+0x26/0x140
[  145.604407] Code: 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 41 54 53 48 89 fb 48 83 ec 30 65 48 8b 04 25 28 00 00 00 48 89 45 e8 31 c0 48 8b 47 10 <48> 8b 40 10 66 83 fe 73 0f 84 86 00 00 00 44 0f b7 e6 44 89 e2 83 
[  145.606676] RSP: 0018:ffffb10680217ac8 EFLAGS: 00010246
[  145.607309] RAX: ffffffffc05ac300 RBX: ffff99f383a8d018 RCX: 0000000000000000
[  145.608169] RDX: ffff99f383b35480 RSI: 000000000000004c RDI: ffff99f383a8d018
[  145.609012] RBP: ffffb10680217b08 R08: 000000000000004c R09: ffff99f383e81400
[  145.609783] R10: fffff429800e9c00 R11: 0000000000000000 R12: ffff99f383e81400
[  145.610546] R13: 0000000000000000 R14: ffffffffc05a6000 R15: 000000000000004c
[  145.611311] FS:  00007f6c5b4eeb80(0000) GS:ffff99f387a00000(0000) knlGS:0000000000000000
[  145.612175] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  145.612793] CR2: ffffffffc05ac310 CR3: 00000000038bc002 CR4: 0000000000360ef0
[  145.613564] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  145.614273] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  145.614962] Call Trace:
[  145.615213]  i2c_detect+0x126/0x310
[  145.615562]  ? kfree_skbmem+0x52/0x70
[  145.615922]  __process_new_driver+0x28/0x50
[  145.616331]  ? i2c_detect+0x310/0x310
[  145.616694]  bus_for_each_dev+0x74/0xb0
[  145.617070]  ? i2c_detect+0x310/0x310
[  145.617433]  i2c_for_each_dev+0x32/0x50
[  145.617810]  i2c_register_driver+0x5d/0x90
[  145.618212]  ? 0xffffffffc0419000
[  145.618539]  it66121_driver_init+0x1c/0x1000 [it66121]
[  145.619031]  do_one_initcall+0x4a/0x1c4
[  145.619377]  ? kvfree+0x33/0x40
[  145.619664]  ? _cond_resched+0x19/0x30
[  145.620000]  ? kmem_cache_alloc_trace+0xb8/0x1d0
[  145.620413]  ? do_init_module+0x27/0x220
[  145.620762]  do_init_module+0x60/0x220
[  145.621096]  load_module+0x14f4/0x1890
[  145.621437]  __do_sys_finit_module+0xbd/0x120
[  145.621828]  ? __do_sys_finit_module+0xbd/0x120
[  145.622236]  __x64_sys_finit_module+0x1a/0x20
[  145.622627]  do_syscall_64+0x5a/0x110
[  145.622958]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[  145.623410] RIP: 0033:0x7f6c5b62b219
[  145.623730] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 47 fc 0c 00 f7 d8 64 89 01 48 
[  145.625300] RSP: 002b:00007ffd76b6b7c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[  145.625903] RAX: ffffffffffffffda RBX: 000055bb3b97b7a0 RCX: 00007f6c5b62b219
[  145.626511] RDX: 0000000000000000 RSI: 000055bb3b6fb338 RDI: 0000000000000003
[  145.627167] RBP: 000055bb3b6fb338 R08: 0000000000000000 R09: 00007f6c5b6fe000
[  145.627773] R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000
[  145.628380] R13: 000055bb3b97b760 R14: 0000000000000000 R15: 0000000000000000
[  145.628971] Modules linked in: it66121(OE+) fl2000(OE) drm_kms_helper fb_sys_fops syscopyarea sysfillrect sysimgblt drm kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc aesni_intel aes_x86_64 crypto_simd cryptd glue_helper input_leds psmouse serio_raw i2c_piix4 mac_hid floppy qemu_fw_cfg pata_acpi 9pnet_virtio 9p 9pnet fscache [last unloaded: fl2000]
[  145.631479] CR2: ffffffffc05ac310
[  145.631736] ---[ end trace 30235f710e094dac ]---
[  145.632087] RIP: 0010:i2c_default_probe+0x26/0x140
[  145.632449] Code: 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 41 54 53 48 89 fb 48 83 ec 30 65 48 8b 04 25 28 00 00 00 48 89 45 e8 31 c0 48 8b 47 10 <48> 8b 40 10 66 83 fe 73 0f 84 86 00 00 00 44 0f b7 e6 44 89 e2 83 
[  145.633865] RSP: 0018:ffffb10680217ac8 EFLAGS: 00010246
[  145.634262] RAX: ffffffffc05ac300 RBX: ffff99f383a8d018 RCX: 0000000000000000
[  145.634799] RDX: ffff99f383b35480 RSI: 000000000000004c RDI: ffff99f383a8d018
[  145.635336] RBP: ffffb10680217b08 R08: 000000000000004c R09: ffff99f383e81400
[  145.635874] R10: fffff429800e9c00 R11: 0000000000000000 R12: ffff99f383e81400
[  145.636410] R13: 0000000000000000 R14: ffffffffc05a6000 R15: 000000000000004c
[  145.636945] FS:  00007f6c5b4eeb80(0000) GS:ffff99f387a00000(0000) knlGS:0000000000000000
[  145.637555] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  145.637985] CR2: ffffffffc05ac310 CR3: 00000000038bc002 CR4: 0000000000360ef0
[  145.638517] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  145.639050] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Killed

kernel 5.16

Apply petereon patch

But when compiling it gives the following error:

LD [M] /usr/src/fl2000_drm-master/fl2000.o
MODPOST /usr/src/fl2000_drm-master/Module.symvers
ERROR: modpost: module fl2000 uses symbol dma_buf_begin_cpu_access from namespace DMA_BUF, but does not import it.
ERROR: modpost: module fl2000 uses symbol dma_buf_end_cpu_access from namespace DMA_BUF, but does not import it.
make[2]: *** [scripts/Makefile.modpost:134: /usr/src/fl2000_drm-master/Module.symvers] Error 1
make[2]: *** Se borra el archivo '/usr/src/fl2000_drm-master/Module.symvers'
make[1]: *** [Makefile:1767: modules] Error 2
make[1]: se sale del directorio '/usr/src/linux-headers-5.16.15-051615-generic'
make: *** [Makefile:21: modules] Error 2

kernel crash on device removal

qemu-system-x86_64: libusb_release_interface: -4 [NO_DEVICE]
qemu-system-x86_64: libusb_release_interface: -4 [NO_DEVICE]
libusb: error [_open_sysfs_attr] open /sys/bus/usb/devices/1-8/bConfigurationValue failed ret=-1 errno=2
libusb: error [_get_usbfs_fd] File doesn't exist, wait 10 ms and try again
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/001/003: No such file or directory
[  337.460816] xhci_hcd 0000:00:05.0: WARN Set TR Deq Ptr cmd failed due to incorrect slot or ep state.
[  337.462753] i2c i2c-1: FL2000_VGA_I2C_SC_REG write failed!
[  337.463872] usb 1-1: Cannot read interrupt status (-71)
[  337.464992] usb 1-1: USB disconnect, device number 2
[  337.466134] usb 1-1: Disconnecting interface: 0
[  337.467652] usb 1-1: Disconnecting interface: 1
[  337.469363] usb 1-1: Disconnecting interface: 2
[  337.470728] usb 1-1: Cannot read interrupt register (-19)
[  337.472349] usb 1-1: URB submission failed (-19)
[  337.474370] usb 1-1: Unbinding FL2000 master component
[  337.475852] ------------[ cut here ]------------
[  337.477302] WARNING: CPU: 0 PID: 13 at drivers/base/devres.c:680 devres_release_group+0xaf/0xd0
[  337.479664] Modules linked in: it66121(OE) fl2000(OE) drm_kms_helper fb_sys_fops syscopyarea sysfillrect sysimgblt drm kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel aes_x86_64 crypto_simd cryptd glue_helper input_leds psmouse serio_raw floppy mac_hid pata_acpi qemu_fw_cfg i2c_piix4 9pnet_virtio 9p 9pnet fscache
[  337.486484] CPU: 0 PID: 13 Comm: kworker/0:1 Tainted: G           OE     5.0.0-31-generic #33-Ubuntu
[  337.488220] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
[  337.489752] Workqueue: usb_hub_wq hub_event
[  337.490374] RIP: 0010:devres_release_group+0xaf/0xd0
[  337.491140] Code: 41 5d 5d c3 48 8b 78 18 4c 8d 40 18 49 39 f8 74 c7 48 8b 40 08 48 39 d0 75 a9 48 c7 c7 68 4c 8e b7 48 89 4d e0 e8 94 10 a5 ff <0f> 0b 48 8b 4d e0 4c 89 e7 48 89 ce e8 d0 ac 38 00 31 c0 eb ba 66
[  337.493871] RSP: 0018:ffffbca6c00a3ae8 EFLAGS: 00010046
[  337.494546] RAX: 0000000000000024 RBX: 0000000000000000 RCX: ffffffffb7c680e8
[  337.495416] RDX: 0000000000000000 RSI: 0000000000000082 RDI: 0000000000000046
[  337.496303] RBP: ffffbca6c00a3b08 R08: 0000000000000033 R09: 0000000000000ede
[  337.497190] R10: 0000000000000034 R11: ffffbca6c00a3950 R12: ffff9b544613d330
[  337.498089] R13: ffff9b544613d0a0 R14: ffffbca6c00a3b90 R15: 000000000000000f
[  337.498980] FS:  0000000000000000(0000) GS:ffff9b5447a00000(0000) knlGS:0000000000000000
[  337.499946] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  337.500591] CR2: 000055c812dcb0d8 CR3: 00000000061c8002 CR4: 0000000000360ef0
[  337.501386] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  337.502216] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  337.503008] Call Trace:
[  337.503306]  take_down_master.part.10+0x29/0x30
[  337.503847]  component_master_del+0x7d/0x80
[  337.504322]  fl2000_match_release+0x15/0x20 [fl2000]
[  337.504822]  devm_component_match_release+0x40/0x60
[  337.505343]  release_nodes+0x19e/0x1f0
[  337.505801]  devres_release_all+0x40/0x43
[  337.506221]  device_release_driver_internal+0x1ac/0x260
[  337.506801]  device_release_driver+0x12/0x20
[  337.507300]  bus_remove_device+0xec/0x160
[  337.507764]  device_del+0x167/0x370
[  337.508183]  usb_disconnect+0x16c/0x260
[  337.508637]  hub_port_connect+0x85/0xa60
[  337.509099]  port_event+0x533/0x7e0
[  337.509504]  ? lock_timer_base+0x6b/0x90
[  337.509944]  hub_event+0x148/0x3b0
[  337.510314]  process_one_work+0x20f/0x410
[  337.510744]  worker_thread+0x34/0x400
[  337.511093]  kthread+0x120/0x140
[  337.511402]  ? process_one_work+0x410/0x410
[  337.511829]  ? __kthread_parkme+0x70/0x70
[  337.512261]  ret_from_fork+0x35/0x40
[  337.512642] ---[ end trace 2791137f885bc22a ]---
[  337.568678] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
[  337.569512] #PF error: [INSTR]
[  337.569843] PGD 0 P4D 0 
[  337.570112] Oops: 0010 [#1] SMP PTI
[  337.570475] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W  OE     5.0.0-31-generic #33-Ubuntu
[  337.571380] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
[  337.572229] RIP: 0010:          (null)
[  337.572617] Code: Bad RIP value.
[  337.572954] RSP: 0018:ffff9b5447a03ea0 EFLAGS: 00010206
[  337.573493] RAX: dead000000000200 RBX: 0000000000000100 RCX: ffff9b5447a03ed8
[  337.574299] RDX: 00000001000024a2 RSI: 0000000000000000 RDI: ffff9b54463a84b8
[  337.575127] RBP: ffff9b5447a03ec8 R08: ffff9b5447a1a780 R09: ffff9b5447a1a670
[  337.575940] R10: ffff9b5447a1a628 R11: ffff9b5447a03ee0 R12: ffff9b54463a84b8
[  337.576657] R13: ffff9b54463a84b8 R14: 0000000000000000 R15: ffff9b5447a03ed8
[  337.577375] FS:  0000000000000000(0000) GS:ffff9b5447a00000(0000) knlGS:0000000000000000
[  337.578192] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  337.578771] CR2: ffffffffffffffd6 CR3: 0000000006a9e001 CR4: 0000000000360ef0
[  337.579530] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  337.580247] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  337.580960] Call Trace:
[  337.581220]  <IRQ>
[  337.581433]  call_timer_fn+0x30/0x130
[  337.581824]  run_timer_softirq+0x3e4/0x420
[  337.582242]  ? ktime_get+0x40/0xa0
[  337.582620]  ? lapic_next_deadline+0x26/0x30
[  337.583053]  ? clockevents_program_event+0x93/0xf0
[  337.583557]  __do_softirq+0xdc/0x2f3
[  337.583924]  irq_exit+0xc0/0xd0
[  337.584245]  smp_apic_timer_interrupt+0x79/0x140
[  337.584711]  apic_timer_interrupt+0xf/0x20
[  337.585125]  </IRQ>
[  337.585343] RIP: 0010:native_safe_halt+0x12/0x20
[  337.585813] Code: 48 02 20 48 8b 00 a8 08 75 c3 e9 7c ff ff ff 90 90 90 90 90 90 90 90 90 55 48 89 e5 e9 07 00 00 00 0f 00 2d 52 f1 5c 00 fb f4 <5d> c3 66 66 2e 0f 1f 84 00 00 00 00 00 90 55 48 89 e5 e9 07 00 00
[  337.587668] RSP: 0018:ffffffffb7c03e08 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
[  337.588422] RAX: ffffffffb703ae00 RBX: 0000000000000000 RCX: 0000000000000001
[  337.589133] RDX: 000000000006c206 RSI: 0000000000000083 RDI: 0000000000000000
[  337.589859] RBP: ffffffffb7c03e08 R08: 0000004f1842a22b R09: 0000000000000000
[  337.590573] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
[  337.591287] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
[  337.592002]  ? __sched_text_end+0x1/0x1
[  337.592392]  default_idle+0x22/0x150
[  337.592758]  arch_cpu_idle+0x15/0x20
[  337.593123]  default_idle_call+0x2c/0x30
[  337.593522]  do_idle+0x1f8/0x280
[  337.593856]  cpu_startup_entry+0x1d/0x20
[  337.594260]  rest_init+0xae/0xb0
[  337.594569]  arch_call_rest_init+0xe/0x1b
[  337.594939]  start_kernel+0x4f5/0x516
[  337.595287]  x86_64_start_reservations+0x24/0x26
[  337.595711]  x86_64_start_kernel+0x74/0x77
[  337.596090]  secondary_startup_64+0xa4/0xb0
[  337.596472] Modules linked in: it66121(OE) fl2000(OE) drm_kms_helper fb_sys_fops syscopyarea sysfillrect sysimgblt drm kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel aes_x86_64 crypto_simd cryptd glue_helper input_leds psmouse serio_raw floppy mac_hid pata_acpi qemu_fw_cfg i2c_piix4 9pnet_virtio 9p 9pnet fscache
[  337.599283] CR2: 0000000000000000
[  337.599604] ---[ end trace 2791137f885bc22b ]---
[  337.600012] RIP: 0010:          (null)
[  337.600353] Code: Bad RIP value.
[  337.600641] RSP: 0018:ffff9b5447a03ea0 EFLAGS: 00010206
[  337.601101] RAX: dead000000000200 RBX: 0000000000000100 RCX: ffff9b5447a03ed8
[  337.601823] RDX: 00000001000024a2 RSI: 0000000000000000 RDI: ffff9b54463a84b8
[  337.602545] RBP: ffff9b5447a03ec8 R08: ffff9b5447a1a780 R09: ffff9b5447a1a670
[  337.603167] R10: ffff9b5447a1a628 R11: ffff9b5447a03ee0 R12: ffff9b54463a84b8
[  337.603789] R13: ffff9b54463a84b8 R14: 0000000000000000 R15: ffff9b5447a03ed8
[  337.604411] FS:  0000000000000000(0000) GS:ffff9b5447a00000(0000) knlGS:0000000000000000
[  337.605117] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  337.605620] CR2: ffffffffffffffd6 CR3: 0000000006a9e001 CR4: 0000000000360ef0
[  337.606250] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  337.606885] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  337.607508] Kernel panic - not syncing: Fatal exception in interrupt
[  337.608929] Kernel Offset: 0x35600000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[  337.609873] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---
QEMU: Terminated

Which Linux kernels are compatible with fl2k_drm?

I have Linux 5.0.0-37-generic but I will face with error after make command.

~/fl2000_drm/fl2000.h:36:10: fatal error: drm/drm_probe_helper.h: No such file or directory

My Linux kernel doesn't contain this drm_probe_helper.h, should I update my kernel?

compiling on 5.12

compiling on 5.12 resulted in this in the terminal (it didn't pass the make phase)

~/D/fl2000_drm-master> make
make CHECK="/usr/bin/sparse" -C /lib/modules/5.12.13-1-MANJARO/build M=/home/joni909/Downloads/fl2000_drm-master modules

make[1]: Entering directory '/usr/lib/modules/5.12.13-1-MANJARO/build'
CC [M] /home/joni909/Downloads/fl2000_drm-master/fl2000_gem.o
/home/joni909/Downloads/fl2000_drm-master/fl2000_gem.c: In function ‘fl2000_gem_prime_import_sg_table’:
/home/joni909/Downloads/fl2000_drm-master/fl2000_gem.c:234:15: error: implicit declaration of function ‘drm_prime_sg_to_page_addr_arrays’; did you mean ‘drm_prime_sg_to_dma_addr_array’? [-Werror=implicit-function-declaration]

234 | ret = drm_prime_sg_to_page_addr_arrays(sgt, obj->pages, NULL, obj->num_pages);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| drm_prime_sg_to_dma_addr_array
/home/joni909/Downloads/fl2000_drm-master/fl2000_gem.c: At top level:
/home/joni909/Downloads/fl2000_drm-master/fl2000_gem.c:270:17: error: initialization of ‘int (*)(struct drm_gem_object *, struct dma_buf_map )’ from incompatible pointer type ‘void * ()(struct drm_gem_object *)’ [-Werror=incompatible-pointer-
types]

270 | .vmap = fl2000_gem_prime_vmap,
| ^~~~~~~~~~~~~~~~~~~~~
/home/joni909/Downloads/fl2000_drm-master/fl2000_gem.c:270:17: note: (near initialization for ‘fl2000_gem_default_funcs.vmap’)
/home/joni909/Downloads/fl2000_drm-master/fl2000_gem.c:271:19: error: initialization of ‘void (*)(struct drm_gem_object *, struct dma_buf_map )’ from incompatible pointer type ‘void ()(struct drm_gem_object *, void *)’ [-Werror=incompatible-pointer-types]

271 | .vunmap = fl2000_gem_prime_vunmap,
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/joni909/Downloads/fl2000_drm-master/fl2000_gem.c:271:19: note: (near initialization for ‘fl2000_gem_default_funcs.vunmap’)
cc1: some warnings being treated as errors

make[2]: *** [scripts/Makefile.build:271: /home/joni909/Downloads/fl2000_drm-master/fl2000_gem.o] Error 1
make[1]: *** [Makefile:1859: /home/joni909/Downloads/fl2000_drm-master] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.12.13-1-MANJARO/build'
make: *** [Makefile:21: modules] Error 2

Compilation fails at fl2000_gem_prime_vunmap/fl2000_gem_prime_vmap: Missing dma_buf_map (kernel 5.11.0)

Compiling on Ubuntu 21.04 (Kernel 5.11.0-18), I get the following errors:

  CC [M]  /tmp/fl2000_drm/fl2000_gem.o
/tmp/fl2000_drm/fl2000_gem.c:270:10: error: initialization of ‘int (*)(struct drm_gem_object *, struct dma_buf_map *)’ from incompatible pointer type ‘void * (*)(struct drm_gem_object *)’ [-Werror=incompatible-pointer-types]
  270 |  .vmap = fl2000_gem_prime_vmap,
      |          ^~~~~~~~~~~~~~~~~~~~~
/tmp/fl2000_drm/fl2000_gem.c:270:10: note: (near initialization for ‘fl2000_gem_default_funcs.vmap’)
/tmp/fl2000_drm/fl2000_gem.c:271:12: error: initialization of ‘void (*)(struct drm_gem_object *, struct dma_buf_map *)’ from incompatible pointer type ‘void (*)(struct drm_gem_object *, void *)’ [-Werror=incompatible-pointer-types]
  271 |  .vunmap = fl2000_gem_prime_vunmap,
      |            ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/fl2000_drm/fl2000_gem.c:271:12: note: (near initialization for ‘fl2000_gem_default_funcs.vunmap’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:287: /tmp/fl2000_drm/fl2000_gem.o] Error 1

It seems that an additional dma_buf_map parameter is required.

Unable to compile on Kernel 5.10.5

Hi, first of all I wanted to thank you for making this driver.
However, the driver is unable to be compiled and used on my machine.
Here's my configuration and my build log:

make log
OS: EndeavousOS (Arch)
Kernel: 5.10.5-arch1-1

Thank you.

installation problem

saikat@saikat-ROG-Strix:~/Downloads/fl2000_drm-master$ make
make CHECK="/usr/bin/sparse" -C /lib/modules/5.13.0-28-generic/build M=/home/saikat/Downloads/fl2000_drm-master modules
make[1]: Entering directory '/usr/src/linux-headers-5.13.0-28-generic'
CC [M] /home/saikat/Downloads/fl2000_drm-master/fl2000_gem.o
/home/saikat/Downloads/fl2000_drm-master/fl2000_gem.c: In function ‘fl2000_gem_prime_import_sg_table’:
/home/saikat/Downloads/fl2000_drm-master/fl2000_gem.c:234:8: error: implicit declaration of function ‘drm_prime_sg_to_page_addr_arrays’; did you mean ‘drm_prime_sg_to_dma_addr_array’? [-Werror=implicit-function-declaration]
234 | ret = drm_prime_sg_to_page_addr_arrays(sgt, obj->pages, NULL, obj->num_pages);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| drm_prime_sg_to_dma_addr_array
/home/saikat/Downloads/fl2000_drm-master/fl2000_gem.c: At top level:
/home/saikat/Downloads/fl2000_drm-master/fl2000_gem.c:270:10: error: initialization of ‘int (*)(struct drm_gem_object *, struct dma_buf_map )’ from incompatible pointer type ‘void * ()(struct drm_gem_object )’ [-Werror=incompatible-pointer-types]
270 | .vmap = fl2000_gem_prime_vmap,
| ^~~~~~~~~~~~~~~~~~~~~
/home/saikat/Downloads/fl2000_drm-master/fl2000_gem.c:270:10: note: (near initialization for ‘fl2000_gem_default_funcs.vmap’)
/home/saikat/Downloads/fl2000_drm-master/fl2000_gem.c:271:12: error: initialization of ‘void (
)(struct drm_gem_object *, struct dma_buf_map )’ from incompatible pointer type ‘void ()(struct drm_gem_object *, void *)’ [-Werror=incompatible-pointer-types]
271 | .vunmap = fl2000_gem_prime_vunmap,
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/saikat/Downloads/fl2000_drm-master/fl2000_gem.c:271:12: note: (near initialization for ‘fl2000_gem_default_funcs.vunmap’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:281: /home/saikat/Downloads/fl2000_drm-master/fl2000_gem.o] Error 1
make[1]: *** [Makefile:1879: /home/saikat/Downloads/fl2000_drm-master] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.13.0-28-generic'
make: *** [Makefile:21: modules] Error 2

esxi support

Hi Quite great project. But also, it can be quite great if you can add a support for esxi. like esxi 6.0 you passthrougt a usb port and then get the device via lsusb.. but do actually get the driver to load and bypass the vmware svga driver of the console.
Thanks hope this can be a great feature.

Warning in kernel log

[   35.333688] ------------[ cut here ]------------
[   35.334158] WARNING: CPU: 0 PID: 185 at kernel/smp.c:424 smp_call_function_many+0xab/0x270
[   35.335136] Modules linked in: it66121(OE) fl2000(OE) drm_kms_helper fb_sys_fops syscopyarea sysfillrect sysimgblt drm usbmon joydev hid_multitouch hid_generic intel_rapl_msr intel_rapl_common kvm_intel kvm usbhid hid crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd glue_helper psmouse input_leds mac_hid serio_raw e1000 qemu_fw_cfg i2c_i801 ahci libahci lpc_ich 9pnet_virtio 9p 9pnet fscache
[   35.339492] CPU: 0 PID: 185 Comm: kworker/u2:5 Tainted: G           OE     5.4.0-48-generic #52-Ubuntu
[   35.340412] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1 04/01/2014
[   35.341287] Workqueue: events_unbound commit_work [drm_kms_helper]
[   35.341909] RIP: 0010:smp_call_function_many+0xab/0x270
[   35.342499] Code: d2 6f 01 89 4d d0 72 26 48 83 c4 18 5b 41 5c 41 5d 41 5e 41 5f 5d c3 8b 05 02 47 a4 01 85 c0 75 a6 80 3d bf 6e 6f 01 00 75 9d <0f> 0b eb 99 48 c7 c2 a0 b2 c4 b5 4c 89 fe 89 df e8 40 41 96 00 8b
[   35.344344] RSP: 0018:ffffac6d80327bd0 EFLAGS: 00010046
[   35.344875] RAX: 0000000000000000 RBX: ffffffffb44884b0 RCX: 0000000000000000
[   35.345688] RDX: 0000000000000000 RSI: ffffffffb44884b0 RDI: ffffffffb5c4b2a0
[   35.346530] RBP: ffffac6d80327c10 R08: 0000000000000000 R09: 000000000000167a
[   35.347371] R10: 0000000000000438 R11: ffff98a4b8ce06c0 R12: ffffffffb44884b0
[   35.348212] R13: 0000000000000000 R14: 0000000000000001 R15: ffffffffb5c4b2a0
[   35.349054] FS:  0000000000000000(0000) GS:ffff98a4bba00000(0000) knlGS:0000000000000000
[   35.349736] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   35.350184] CR2: 00007f7ab7b66000 CR3: 000000017992a002 CR4: 0000000000360ef0
[   35.350739] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   35.351293] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[   35.351848] Call Trace:
[   35.352047]  ? load_new_mm_cr3+0xf0/0xf0
[   35.352381]  on_each_cpu+0x2d/0x60
[   35.352649]  flush_tlb_kernel_range+0x38/0x90
[   35.352989]  __purge_vmap_area_lazy+0x70/0x6d0
[   35.353340]  ? vunmap_page_range+0x20d/0x390
[   35.353674]  free_vmap_area_noflush+0xe1/0xf0
[   35.354014]  remove_vm_area+0x9a/0xb0
[   35.354301]  __vunmap+0x5f/0x210
[   35.354555]  vunmap+0x30/0x40
[   35.354797]  drm_gem_shmem_vunmap+0x7f/0xa0 [drm]
[   35.355182]  fl2000_display_update+0x189/0x1b0 [fl2000]
[   35.355592]  drm_simple_kms_plane_atomic_update+0x2a/0x30 [drm_kms_helper]
[   35.356124]  drm_atomic_helper_commit_planes+0xbd/0x220 [drm_kms_helper]
[   35.356643]  drm_atomic_helper_commit_tail+0x2c/0x70 [drm_kms_helper]
[   35.357141]  commit_tail+0xd7/0x110 [drm_kms_helper]
[   35.357530]  commit_work+0x12/0x20 [drm_kms_helper]
[   35.357911]  process_one_work+0x1eb/0x3b0
[   35.358226]  worker_thread+0x4d/0x400
[   35.358514]  kthread+0x104/0x140
[   35.358769]  ? process_one_work+0x3b0/0x3b0
[   35.359097]  ? kthread_park+0x90/0x90
[   35.359386]  ret_from_fork+0x35/0x40
[   35.359668] ---[ end trace eccb984b27f8d3df ]---

kernel NULL pointer dereference when starting X server

With FRAMEBUFFER=/dev/fb0 startx

X.Org X Server 1.20.8
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.0-177-generic x86_64 Ubuntu
Current Operating System: Linux (none) 5.4.0-28-generic #32-Ubuntu SMP Wed Apr 22 17:40:10 UTC 2020 x86_64
Kernel command line: virtme_root_mods=1 earlyprintk=serial,ttyS0,115200 console=ttyS0 psmouse.proto=exps "virtme_stty_con=rows 123 cols 237 iutf8" TERM=xterm-256color virtme_chdir=home/klogg/workspace/fl2000_drm init=/bin/sh -- -c "mkdir -p /run/virtme/guesttools;/bin/mount -n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any virtme.guesttools /run/virtme/guesttools;exec /run/virtme/guesttools/virtme-init"
Build Date: 06 April 2020 09:39:29AM
xorg-server 2:1.20.8-2ubuntu2 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.38.4
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Tue May 5 22:44:21 2020
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
MESA-LOADER: failed to open fl2000_drm (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri)
failed to load driver: ### fl2000_drm
[ 162.401144] usb 2-1.2: it66121_connector_mode_valid
[ 162.403673] usb 2-1.2: DRM mode validation: "800x480": 66 32000 800 840 888 928 480 493 496 525 0x48 0xa
[ 162.424915] usb 2-1.2: it66121_connector_mode_valid
[ 162.427289] usb 2-1.2: DRM mode validation: "800x480": 66 32000 800 840 888 928 480 493 496 525 0x48 0xa
(II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
[ 175.685335] usb 2-1.2: it66121_connector_mode_valid
[ 175.685726] usb 2-1.2: DRM mode validation: "800x480": 66 32000 800 840 888 928 480 493 496 525 0x48 0xa
[ 179.495154] IPMI message handler: version 39.2
[ 179.497976] ipmi device interface
[ 179.908619] BUG: kernel NULL pointer dereference, address: 0000000000000000
[ 179.909150] #PF: supervisor read access in kernel mode
[ 179.909541] #PF: error_code(0x0000) - not-present page
[ 179.909932] PGD 0 P4D 0
[ 179.910130] Oops: 0000 [#1] SMP PTI
[ 179.910399] CPU: 0 PID: 7 Comm: kworker/0:1 Tainted: G OE 5.4.0-28-generic #32-Ubuntu
[ 179.911078] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1 04/01/2014
[ 179.911740] Workqueue: 0x0 (fl2000_streaming)
[ 179.912081] RIP: 0010:pwq_activate_delayed_work+0x2a/0x100
[ 179.912499] Code: 0f 1f 44 00 00 55 48 89 e5 41 55 41 54 53 48 8b 07 48 89 fb 49 89 c5 45 30 ed a8 04 b8 00 00 00 00 4c 0f 44 e8 0f 1f 44 00 00 <4d> 8b 45 00 49 8b 40 20 4d 8d 48 20 49 39 c1 0f 84 a7 00 00 00 48
[ 179.913894] RSP: 0018:ffffb2c8c0047e20 EFLAGS: 00010046
[ 179.914289] RAX: 0000000000000000 RBX: ffff94b738f94e30 RCX: ffffd2c8bfc03260
[ 179.914825] RDX: ffff94b738f94e38 RSI: 0000000000000000 RDI: ffff94b738f94e30
[ 179.915361] RBP: ffffb2c8c0047e38 R08: 000000000000277a R09: ffffb2c8c0047d58
[ 179.915899] R10: ffff94b73b15debc R11: 0000000000000018 R12: ffffd2c8bfc03200
[ 179.916435] R13: 0000000000000000 R14: 0000000000000000 R15: ffff94b73b15de40
[ 179.916972] FS: 0000000000000000(0000) GS:ffff94b73ba00000(0000) knlGS:0000000000000000
[ 179.917578] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 179.918012] CR2: 00000000000000b0 CR3: 000000016b96a003 CR4: 0000000000360ef0
[ 179.918548] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 179.919084] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 179.919620] Call Trace:
[ 179.919813] pwq_dec_nr_in_flight+0x62/0xa0
[ 179.920136] process_one_work+0x270/0x3b0
[ 179.920447] worker_thread+0x4d/0x400
[ 179.920728] kthread+0x104/0x140
[ 179.920978] ? process_one_work+0x3b0/0x3b0
[ 179.921297] ? kthread_park+0x90/0x90
[ 179.921579] ret_from_fork+0x35/0x40
[ 179.921854] Modules linked in: ipmi_devintf ipmi_msghandler it66121(OE) fl2000(OE) drm_kms_helper fb_sys_fops syscopyarea sysfillrect sysimgblt drm usbmon intel_rapl_msr intel_rapl_common kvm_intel kvm crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd glue_helper input_leds lpc_ich ahci psmouse libahci serio_raw i2c_i801 qemu_fw_cfg e1000 mac_hid 9pnet_virtio 9p 9pnet fscache
[ 179.924533] CR2: 0000000000000000
[ 179.924788] ---[ end trace dd3ac184d1fd37fc ]---
[ 179.925140] RIP: 0010:pwq_activate_delayed_work+0x2a/0x100
[ 179.925555] Code: 0f 1f 44 00 00 55 48 89 e5 41 55 41 54 53 48 8b 07 48 89 fb 49 89 c5 45 30 ed a8 04 b8 00 00 00 00 4c 0f 44 e8 0f 1f 44 00 00 <4d> 8b 45 00 49 8b 40 20 4d 8d 48 20 49 39 c1 0f 84 a7 00 00 00 48
[ 179.926949] RSP: 0018:ffffb2c8c0047e20 EFLAGS: 00010046
[ 179.927345] RAX: 0000000000000000 RBX: ffff94b738f94e30 RCX: ffffd2c8bfc03260
[ 179.927870] RDX: ffff94b738f94e38 RSI: 0000000000000000 RDI: ffff94b738f94e30
[ 179.928406] RBP: ffffb2c8c0047e38 R08: 000000000000277a R09: ffffb2c8c0047d58
[ 179.928941] R10: ffff94b73b15debc R11: 0000000000000018 R12: ffffd2c8bfc03200
[ 179.929476] R13: 0000000000000000 R14: 0000000000000000 R15: ffff94b73b15de40
[ 179.930012] FS: 0000000000000000(0000) GS:ffff94b73ba00000(0000) knlGS:0000000000000000
[ 179.930618] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 179.931051] CR2: 00000000000000b0 CR3: 000000016b96a003 CR4: 0000000000360ef0
[ 179.931590] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 179.932126] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Driver installed but display still not working

Hello,

I have installed the driver according to the steps mentioned in the README but i still dont get my display to be working , are there any other steps required to get it all working ?
Thanks in advance

insmod: ERROR: could not insert module fl2000.ko: Unknown symbol in module

Hi!
After cloning and making, I tried to insmod the driver, but I got the following error:

$ sudo insmod fl2000.ko 
insmod: ERROR: could not insert module fl2000.ko: Unknown symbol in module

Inspecting using dmesg, I got the following messages:

$ dmesg
[ 1166.265137] fl2000: Unknown symbol drm_kms_helper_poll_fini (err -2)
[ 1166.265294] fl2000: Unknown symbol drm_kms_helper_poll_init (err -2)
[ 1166.265326] fl2000: Unknown symbol drm_plane_enable_fb_damage_clips (err -2)
[ 1166.265356] fl2000: Unknown symbol drm_fb_helper_lastclose (err -2)
[ 1166.265447] fl2000: Unknown symbol drm_atomic_helper_shutdown (err -2)
[ 1166.265480] fl2000: Unknown symbol drm_gem_fb_simple_display_pipe_prepare_fb (err -2)
[ 1166.265723] fl2000: Unknown symbol drm_atomic_helper_commit (err -2)
[ 1166.265753] fl2000: Unknown symbol drm_atomic_helper_check (err -2)
[ 1166.265944] fl2000: Unknown symbol drm_atomic_helper_damage_merged (err -2)
[ 1166.265999] fl2000: Unknown symbol drm_gem_fb_create_with_dirty (err -2)
[ 1166.266140] fl2000: Unknown symbol drm_gem_fb_get_obj (err -2)
[ 1166.266270] fl2000: Unknown symbol drm_fbdev_generic_setup (err -2)
[ 1166.266304] fl2000: Unknown symbol drm_simple_display_pipe_init (err -2)
[ 1166.266396] fl2000: Unknown symbol drm_kms_helper_hotplug_event (err -2)

I'm using Ubuntu 20.04, GCC version 9.3.0, my adapter ID is 1d5c:2000, and my kernel version is 5.4.0-59-generic.

Can you help me, please?
Thanks!

Implement scatterlists for large bulk transfers

For huge resolutions better to allocate sg memory because continuous chunks of DMA coherent RAM may not be available. Check against MAX_ORDER for allocation, use synchronous transfers(?)

Getting black screen before insert module

Before running insmod command I'm getting a black screen on both laptop screen and screen with the adapter. I just can see the cursor.

No idea why. I have used before and it have worked correctly only. A little bit slow, but works.

Tested on Ubuntu 20.04 with kernels:
5.8.18-050818-generic
5.4.0-66-generic

Doesn't work Ubuntu

fl2000_drm$ make
make CHECK="/usr/bin/sparse" -C /lib/modules/5.11.0-36-generic/build M=/home/killer/Documents/00002_GIT/fl2000_drm modules
make[1]: Entering directory '/usr/src/linux-headers-5.11.0-36-generic'

ERROR: Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.

make[1]: *** [Makefile:745: include/config/auto.conf] Error 1
make[1]: Leaving directory '/usr/src/linux-headers-5.11.0-36-generic'
make: *** [Makefile:21: modules] Error 2

then go to source it does this

:/usr/src/linux-hwe-5.11-headers-5.11.0-36$ sudo make oldconfig && make prepare
[sudo] password for killer:
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/confdata.o
HOSTCC scripts/kconfig/expr.o
LEX scripts/kconfig/lexer.lex.c
flex: -Cf/-CF and %option yylineno are incompatible
make[1]: *** [scripts/Makefile.host:9: scripts/kconfig/lexer.lex.c] Error 1
make: *** [Makefile:629: oldconfig] Error 2

not working on Manjaro, kernel 5.10.30

I am trying to test the driver on Manjaro with kernel 5.10.30. I have successfully built the module and loaded the drm, drm_kms_helper and fl2000 modules. I have also added quirks=1D5C:2000:USB_QUIRK_NO_LPM to boot params. However, after plugging the dongle, nothing apparently happens.

lsusb lists the device as:

Bus 002 Device 008: ID 1d5c:2000 Fresco Logic FL2000/FL2000DX VGA/DVI/HDMI Adapter
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/8p, 10000M
    |__ Port 1: Dev 8, If 0, Class=, Driver=fl2000_usb, 5000M
    |__ Port 1: Dev 8, If 1, Class=, Driver=fl2000_usb, 5000M
    |__ Port 1: Dev 8, If 2, Class=, Driver=fl2000_usb, 5000M
    |__ Port 1: Dev 8, If 3, Class=Mass Storage, Driver=usb-storage, 5000M

And dmesg shows:

[ 1132.833822] usb 1-1: new high-speed USB device number 17 using xhci_hcd
[ 1133.014164] usb 1-1: New USB device found, idVendor=1a40, idProduct=0801, bcdDevice= 1.00
[ 1133.014171] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 1133.014175] usb 1-1: Product: USB 2.0 Hub
[ 1133.015176] hub 1-1:1.0: USB hub found
[ 1133.015218] hub 1-1:1.0: 4 ports detected
[ 1133.173527] usb 2-1: new SuperSpeed Gen 1 USB device number 8 using xhci_hcd
[ 1133.203811] usb 2-1: config 1 interface 1 altsetting 0 has a duplicate endpoint with address 0x81, skipping
[ 1133.203813] usb 2-1: config 1 interface 1 altsetting 0 has a duplicate endpoint with address 0x1, skipping
[ 1133.203813] usb 2-1: config 1 interface 1 altsetting 1 has a duplicate endpoint with address 0x81, skipping
[ 1133.203814] usb 2-1: config 1 interface 1 altsetting 1 has a duplicate endpoint with address 0x1, skipping
[ 1133.203815] usb 2-1: config 1 interface 1 altsetting 2 has a duplicate endpoint with address 0x81, skipping
[ 1133.203816] usb 2-1: config 1 interface 1 altsetting 2 has a duplicate endpoint with address 0x1, skipping
[ 1133.203816] usb 2-1: config 1 interface 1 altsetting 3 has a duplicate endpoint with address 0x81, skipping
[ 1133.203817] usb 2-1: config 1 interface 1 altsetting 3 has a duplicate endpoint with address 0x1, skipping
[ 1133.203818] usb 2-1: config 1 interface 1 altsetting 4 has a duplicate endpoint with address 0x81, skipping
[ 1133.203818] usb 2-1: config 1 interface 1 altsetting 4 has a duplicate endpoint with address 0x1, skipping
[ 1133.203819] usb 2-1: config 1 interface 1 altsetting 5 has a duplicate endpoint with address 0x81, skipping
[ 1133.203820] usb 2-1: config 1 interface 1 altsetting 5 has a duplicate endpoint with address 0x1, skipping
[ 1133.203821] usb 2-1: config 1 interface 1 altsetting 6 has a duplicate endpoint with address 0x81, skipping
[ 1133.203821] usb 2-1: config 1 interface 1 altsetting 6 has a duplicate endpoint with address 0x1, skipping
[ 1133.203824] usb 2-1: New USB device found, idVendor=1d5c, idProduct=2000, bcdDevice= 2.00
[ 1133.203825] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 1133.205429] usb-storage 2-1:1.3: USB Mass Storage device detected
[ 1133.205639] scsi host5: usb-storage 2-1:1.3º
[ 1133.343880] usb 1-1.2: new full-speed USB device number 18 using xhci_hcd
[ 1133.480989] usb 1-1.2: New USB device found, idVendor=0d8c, idProduct=013c, bcdDevice= 1.00
[ 1133.480996] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1133.481000] usb 1-1.2: Product: USB PnP Sound Device
[ 1133.481003] usb 1-1.2: Manufacturer: C-Media Electronics Inc.      
[ 1133.499085] input: C-Media Electronics Inc.       USB PnP Sound Device as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0D8C:013C.0007/input/input30
[ 1133.563835] hid-generic 0003:0D8C:013C.0007: input,hidraw0: USB HID v1.00 Device [C-Media Electronics Inc.       USB PnP Sound Device] on usb-0000:00:14.0-1.2/input3
[ 1134.223821] scsi 5:0:0:0: Direct-Access                               A001 PQ: 0 ANSI: 4
[ 1134.224054] sd 5:0:0:0: Attached scsi generic sg1 type 0
[ 1134.224487] sd 5:0:0:0: [sdb] 2047 4096-byte logical blocks: (8.38 MB/8.00 MiB)
[ 1134.224621] sd 5:0:0:0: [sdb] Write Protect is off
[ 1134.224622] sd 5:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 1134.224727] sd 5:0:0:0: [sdb] No Caching mode page found
[ 1134.224729] sd 5:0:0:0: [sdb] Assuming drive cache: write through
[ 1134.296277]  sdb:
[ 1134.297678] sd 5:0:0:0: [sdb] Attached SCSI disk
[ 1164.633903] usb 2-1: reset SuperSpeed Gen 1 USB device number 8 using xhci_hcd

IT66121

First TKS for your work.
Compilation worked
insmod for both module worked
doned on debian kernel 5.8

but after connection

Bus 002 Device 005: ID 1d5c:2000 Fresco Logic FL2000/FL2000DX VGA/DVI/HDMI Adapter

there was an error :

CPU: 2 PID: 5968 Comm: kworker/2:1 Tainted: G WCIOE 5.8.0-0.bpo.2-amd64 #1 Debian 5.8.10-1~bpo10+1
[ 1765.944322] Hardware name: Dell Inc. XPS 13 9350/09JHRY, BIOS 1.12.2 12/15/2019
[ 1765.944368] Workqueue: usb_hub_wq hub_event [usbcore]
[ 1765.944377] RIP: 0010:__flush_work+0x1c3/0x1e0
[ 1765.944383] Code: eb e6 4c 8b 6b 20 e9 e6 fe ff ff 8b 4d 00 48 8b 55 08 83 e1 08 48 0f ba 6d 00 03 80 c9 f0 e9 46 ff ff ff 0f 0b e9 65 ff ff ff <0f> 0b 45 31 f6 e9 5b ff ff ff e8 ee 20 75 00 66 66 2e 0f 1f 84 00
[ 1765.944387] RSP: 0018:ffffa79f84297b40 EFLAGS: 00010246
[ 1765.944392] RAX: 0000000000000000 RBX: ffff953403d04f90 RCX: 0000000000000000
[ 1765.944396] RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff953403d04f90
[ 1765.944399] RBP: ffff953403d04f90 R08: ffffffffc03af228 R09: 0000000000000000
[ 1765.944401] R10: 0000000000000000 R11: ffffffff8ee50840 R12: 0000000000000000
[ 1765.944404] R13: ffffa79f84297be0 R14: 0000000000000001 R15: ffff9532b8821430
[ 1765.944408] FS: 0000000000000000(0000) GS:ffff95342f300000(0000) knlGS:0000000000000000
[ 1765.944412] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1765.944416] CR2: 00007fb049ffd000 CR3: 000000010e00a005 CR4: 00000000003606e0
[ 1765.944419] Call Trace:
[ 1765.944435] ? finish_wait+0x3c/0x80
[ 1765.944480] ? usb_kill_urb+0xac/0xc0 [usbcore]
[ 1765.944487] ? work_busy+0x80/0x80
[ 1765.944493] __cancel_work_timer+0x10a/0x190
[ 1765.944502] ? _cond_resched+0x15/0x30
[ 1765.944546] ? usb_poison_urb+0x4c/0xb0 [usbcore]
[ 1765.944563] fl2000_intr_destroy+0x41/0x90 [fl2000]
[ 1765.944613] usb_unbind_interface+0x76/0x260 [usbcore]
[ 1765.944629] device_release_driver_internal+0xe5/0x1c0
[ 1765.944639] bus_remove_device+0xdb/0x140
[ 1765.944646] device_del+0x171/0x3f0
[ 1765.944691] ? usb_remove_ep_devs+0x1b/0x30 [usbcore]
[ 1765.944734] usb_disable_device+0x8c/0x1a0 [usbcore]
[ 1765.944760] usb_disconnect+0xbc/0x260 [usbcore]
[ 1765.944798] hub_event+0xa18/0x1580 [usbcore]
[ 1765.944815] ? __switch_to+0x7a/0x3b0
[ 1765.944823] process_one_work+0x1ad/0x370
[ 1765.944832] ? create_worker+0x1a0/0x1a0
[ 1765.944837] worker_thread+0x30/0x390
[ 1765.944843] ? create_worker+0x1a0/0x1a0
[ 1765.944850] kthread+0x116/0x130
[ 1765.944858] ? kthread_park+0x80/0x80
[ 1765.944866] ret_from_fork+0x22/0x30
[ 1765.944874] ---[ end trace 3e5c0c57e7060676 ]---
[ 1849.686732] usb 2-1: new SuperSpeed Gen 1 USB device number 6 using xhci_hcd
[ 1849.707177] usb 2-1: config 1 interface 1 altsetting 0 has a duplicate endpoint with address 0x81, skipping
[ 1849.707182] usb 2-1: config 1 interface 1 altsetting 0 has a duplicate endpoint with address 0x1, skipping
[ 1849.707185] usb 2-1: config 1 interface 1 altsetting 1 has a duplicate endpoint with address 0x81, skipping
[ 1849.707189] usb 2-1: config 1 interface 1 altsetting 1 has a duplicate endpoint with address 0x1, skipping
[ 1849.707193] usb 2-1: config 1 interface 1 altsetting 2 has a duplicate endpoint with address 0x81, skipping
[ 1849.707196] usb 2-1: config 1 interface 1 altsetting 2 has a duplicate endpoint with address 0x1, skipping
[ 1849.707200] usb 2-1: config 1 interface 1 altsetting 3 has a duplicate endpoint with address 0x81, skipping
[ 1849.707203] usb 2-1: config 1 interface 1 altsetting 3 has a duplicate endpoint with address 0x1, skipping
[ 1849.707206] usb 2-1: config 1 interface 1 altsetting 4 has a duplicate endpoint with address 0x81, skipping
[ 1849.707209] usb 2-1: config 1 interface 1 altsetting 4 has a duplicate endpoint with address 0x1, skipping
[ 1849.707212] usb 2-1: config 1 interface 1 altsetting 5 has a duplicate endpoint with address 0x81, skipping
[ 1849.707215] usb 2-1: config 1 interface 1 altsetting 5 has a duplicate endpoint with address 0x1, skipping
[ 1849.707219] usb 2-1: config 1 interface 1 altsetting 6 has a duplicate endpoint with address 0x81, skipping
[ 1849.707222] usb 2-1: config 1 interface 1 altsetting 6 has a duplicate endpoint with address 0x1, skipping
[ 1849.707232] usb 2-1: New USB device found, idVendor=1d5c, idProduct=2000, bcdDevice= 2.00
[ 1849.707236] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 1849.735667] usb 2-1: Configured FL2000 registers
[ 1849.735808] i2c i2c-9: Detecting IT66121 at address 0x4C on usb-0000:00:14.0-1
[ 1849.739283] i2c i2c-9: I2C error detected: status 15
[ 1849.739293] i2c i2c-9: I2C transfer failed (-5)
[ 1849.739314] i2c i2c-9: Connected FL2000 I2C adapter
[ 1849.739723] usb-storage 2-1:1.3: USB Mass Storage device detected
[ 1849.739979] scsi host8: usb-storage 2-1:1.3
[ 1850.756566] scsi 8:0:0:0: Direct-Access A001 PQ: 0 ANSI: 4
[ 1850.757295] sd 8:0:0:0: Attached scsi generic sg0 type 0
[ 1850.758224] sd 8:0:0:0: [sda] 2047 4096-byte logical blocks: (8.38 MB/8.00 MiB)
[ 1850.758430] sd 8:0:0:0: [sda] Write Protect is off
[ 1850.758436] sd 8:0:0:0: [sda] Mode Sense: 03 00 00 00
[ 1850.758669] sd 8:0:0:0: [sda] No Caching mode page found
[ 1850.758681] sd 8:0:0:0: [sda] Assuming drive cache: write through
[ 1850.781876] sda:
[ 1850.782845] sd 8:0:0:0: [sda] Attached SCSI disk

error on disconnected also :

[ 1765.944122] WARNING: CPU: 2 PID: 5968 at kernel/workqueue.c:3037 __flush_work+0x1c3/0x1e0
[ 1765.944132] Modules linked in: nls_ascii nls_cp437 it66121(OE) fl2000(OE) sd_mod sg uas usb_storage btrfs blake2b_generic xor zstd_compress raid6_pq ufs qnx4 hfsplus hfs cdrom minix vfat msdos fat jfs xfs uhid algif_hash rfcomm xt_MASQUERADE nf_conntrack_netlink xfrm_user xfrm_algo nft_counter nft_chain_nat xt_addrtype nft_compat nf_tables nfnetlink xt_conntrack nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c br_netfilter bridge stp llc overlay ctr ccm ashmem_linux(C) binder_linux iptable_filter fuse cpufreq_powersave cpufreq_conservative cpufreq_userspace cmac bnep binfmt_misc squashfs zstd_decompress loop snd_hda_codec_hdmi snd_soc_skl snd_soc_hdac_hda snd_hda_ext_core snd_soc_sst_ipc snd_hda_codec_realtek snd_soc_sst_dsp snd_hda_codec_generic snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_compress snd_hda_intel iwlmvm snd_intel_dspcfg mac80211 x86_pkg_temp_thermal snd_hda_codec intel_powerclamp coretemp libarc4 btusb btrtl kvm_intel iwlwifi snd_hda_core btbcm btintel
[ 1765.944216] uvcvideo bluetooth joydev videobuf2_vmalloc videobuf2_memops snd_hwdep intel_rapl_msr dell_laptop videobuf2_v4l2 jitterentropy_rng videobuf2_common kvm ledtrig_audio dell_smm_hwmon snd_pcm dell_wmi irqbypass cfg80211 rapl drbg intel_cstate snd_timer ansi_cprng intel_uncore snd iTCO_wdt ecdh_generic intel_pmc_bxt dell_smbios videodev dcdbas ecc wmi_bmof iTCO_vendor_support dell_wmi_descriptor serio_raw intel_wmi_thunderbolt pcspkr watchdog soundcore mc hid_multitouch rfkill mei_me intel_pch_thermal processor_thermal_device intel_xhci_usb_role_switch intel_rapl_common intel_soc_dts_iosf roles ac mei int3400_thermal intel_hid evdev acpi_pad acpi_thermal_rel int3403_thermal int340x_thermal_zone sparse_keymap acpi_cpufreq sunrpc evdi(OE) parport_pc ppdev lp parport ip_tables x_tables autofs4 ext4 crc16 mbcache jbd2 crc32c_generic algif_skcipher af_alg dm_crypt dm_mod hid_generic usbhid crc32_pclmul crc32c_intel i915 ghash_clmulni_intel rtsx_pci_sdmmc mmc_core nvme ahci libahci
[ 1765.944286] aesni_intel libaes crypto_simd cryptd glue_helper nvme_core libata t10_pi i2c_algo_bit crc_t10dif psmouse drm_kms_helper xhci_pci crct10dif_generic scsi_mod xhci_hcd i2c_i801 rtsx_pci i2c_smbus crct10dif_pclmul crct10dif_common cec drm usbcore intel_lpss_pci intel_lpss idma64 usb_common i2c_hid fan hid wmi battery video button
[ 1765.944319] CPU: 2 PID: 5968 Comm: kworker/2:1 Tainted: G WCIOE 5.8.0-0.bpo.2-amd64 #1 Debian 5.8.10-1~bpo10+1
[ 1765.944322] Hardware name: Dell Inc. XPS 13 9350/09JHRY, BIOS 1.12.2 12/15/2019
[ 1765.944368] Workqueue: usb_hub_wq hub_event [usbcore]
[ 1765.944377] RIP: 0010:__flush_work+0x1c3/0x1e0
[ 1765.944383] Code: eb e6 4c 8b 6b 20 e9 e6 fe ff ff 8b 4d 00 48 8b 55 08 83 e1 08 48 0f ba 6d 00 03 80 c9 f0 e9 46 ff ff ff 0f 0b e9 65 ff ff ff <0f> 0b 45 31 f6 e9 5b ff ff ff e8 ee 20 75 00 66 66 2e 0f 1f 84 00
[ 1765.944387] RSP: 0018:ffffa79f84297b40 EFLAGS: 00010246
[ 1765.944392] RAX: 0000000000000000 RBX: ffff953403d04f90 RCX: 0000000000000000
[ 1765.944396] RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff953403d04f90
[ 1765.944399] RBP: ffff953403d04f90 R08: ffffffffc03af228 R09: 0000000000000000
[ 1765.944401] R10: 0000000000000000 R11: ffffffff8ee50840 R12: 0000000000000000
[ 1765.944404] R13: ffffa79f84297be0 R14: 0000000000000001 R15: ffff9532b8821430
[ 1765.944408] FS: 0000000000000000(0000) GS:ffff95342f300000(0000) knlGS:0000000000000000
[ 1765.944412] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1765.944416] CR2: 00007fb049ffd000 CR3: 000000010e00a005 CR4: 00000000003606e0
[ 1765.944419] Call Trace:
[ 1765.944435] ? finish_wait+0x3c/0x80
[ 1765.944480] ? usb_kill_urb+0xac/0xc0 [usbcore]
[ 1765.944487] ? work_busy+0x80/0x80
[ 1765.944493] __cancel_work_timer+0x10a/0x190
[ 1765.944502] ? _cond_resched+0x15/0x30
[ 1765.944546] ? usb_poison_urb+0x4c/0xb0 [usbcore]
[ 1765.944563] fl2000_intr_destroy+0x41/0x90 [fl2000]
[ 1765.944613] usb_unbind_interface+0x76/0x260 [usbcore]
[ 1765.944629] device_release_driver_internal+0xe5/0x1c0
[ 1765.944639] bus_remove_device+0xdb/0x140
[ 1765.944646] device_del+0x171/0x3f0
[ 1765.944691] ? usb_remove_ep_devs+0x1b/0x30 [usbcore]
[ 1765.944734] usb_disable_device+0x8c/0x1a0 [usbcore]
[ 1765.944760] usb_disconnect+0xbc/0x260 [usbcore]
[ 1765.944798] hub_event+0xa18/0x1580 [usbcore]
[ 1765.944815] ? __switch_to+0x7a/0x3b0
[ 1765.944823] process_one_work+0x1ad/0x370
[ 1765.944832] ? create_worker+0x1a0/0x1a0
[ 1765.944837] worker_thread+0x30/0x390
[ 1765.944843] ? create_worker+0x1a0/0x1a0
[ 1765.944850] kthread+0x116/0x130
[ 1765.944858] ? kthread_park+0x80/0x80
[ 1765.944866] ret_from_fork+0x22/0x30
[ 1765.944874] ---[ end trace 3e5c0c57e7060676 ]---

if someone has some clues…

Compilation failed on Linux 5.7

Make fails with:
fl2000_drm/fl2000.h:28:10: fatal error: drm/drmP.h: No such file or directory

It seems as though drmP was replaced in a recent kernel version, seems as early as 5.5

Fix streaming work cancellation races

Example:

[  323.292062] usb 2-1.1: it66121_bridge_disable
[  323.319057] ------------[ cut here ]------------
[  323.321130] WARNING: CPU: 0 PID: 7 at kernel/workqueue.c:620 __cancel_work_timer+0x116/0x190
[  323.324672] Modules linked in: it66121(OE) fl2000(OE) drm_kms_helper fb_sys_fops syscopyarea sysfillrect sysimgblt drm usbmon intel_rapl_msr intel_rapl_common kvm_intel kvm crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd glue_helper input_leds psmouse i2c_i801 ahci lpc_ich libahci serio_raw e1000 qemu_fw_cfg mac_hid 9pnet_virtio 9p 9pnet fscache
[  323.338414] CPU: 0 PID: 7 Comm: kworker/0:1 Tainted: G           OE     5.4.0-31-generic #35-Ubuntu
[  323.341671] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1 04/01/2014
[  323.344096] Workqueue: events drm_mode_rmfb_work_fn [drm]
[  323.345565] RIP: 0010:__cancel_work_timer+0x116/0x190
[  323.346657] Code: 00 00 0f 85 8e 00 00 00 48 83 c4 40 5b 41 5c 41 5d 41 5e 5d c3 be 01 00 00 00 4c 89 e7 e8 c2 fb ff ff 49 8b 04 24 a8 01 75 8a <0f> 0b eb 86 48 8d 45 c0 ba 02 00 00 00 48 8d 75 a8 48 c7 c7 a0 df
[  323.350567] RSP: 0018:ffffbfe3c0047c08 EFLAGS: 00010246
[  323.351490] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
[  323.352674] RDX: ffffbfe3c0047bb0 RSI: 0000000000000000 RDI: ffffbfe3c0047ba8
[  323.353854] RBP: ffffbfe3c0047c68 R08: 0000000000000006 R09: 000000000028be9b
[  323.355032] R10: 0000000000000a33 R11: 0000000000000000 R12: ffff9865b68a25a0
[  323.356090] R13: 0000000000000000 R14: ffff9865bb1e6000 R15: ffff9865b75b9e00
[  323.357083] FS:  0000000000000000(0000) GS:ffff9865bba00000(0000) knlGS:0000000000000000
[  323.358203] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  323.359002] CR2: 00007f5734b56e6c CR3: 000000017a20a002 CR4: 0000000000360ef0
[  323.359991] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  323.360926] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  323.361776] Call Trace:
[  323.362090]  ? devres_find+0x9e/0xc0
[  323.362545]  cancel_work_sync+0x10/0x20
[  323.363013]  fl2000_stream_disable+0x35/0x50 [fl2000]
[  323.363623]  fl2000_display_disable+0x1a/0x30 [fl2000]
[  323.364249]  drm_simple_kms_crtc_disable+0x23/0x30 [drm_kms_helper]
[  323.365021]  drm_atomic_helper_commit_modeset_disables+0x37a/0x470 [drm_kms_helper]
[  323.365876]  ? wait_for_completion_interruptible+0x37/0x160
[  323.366496]  drm_atomic_helper_commit_tail+0x1f/0x70 [drm_kms_helper]
[  323.367176]  commit_tail+0xd7/0x110 [drm_kms_helper]
[  323.367703]  drm_atomic_helper_commit+0x118/0x120 [drm_kms_helper]
[  323.368368]  drm_atomic_commit+0x4a/0x50 [drm]
[  323.368847]  drm_framebuffer_remove+0x392/0x3f0 [drm]
[  323.369387]  drm_mode_rmfb_work_fn+0x41/0x50 [drm]
[  323.369893]  process_one_work+0x1eb/0x3b0
[  323.370319]  worker_thread+0x4d/0x400
[  323.370682]  kthread+0x104/0x140
[  323.370990]  ? process_one_work+0x3b0/0x3b0
[  323.371385]  ? kthread_park+0x90/0x90
[  323.371732]  ret_from_fork+0x35/0x40
[  323.372071] ---[ end trace 556acee6e6632c7a ]---
[  323.372658] usb 2-1.1: Mode requested:  "800x480": 66 32000 800 840 888 928 480 493 496 525 0x48 0xa
[  323.373501] usb 2-1.1: Mode configured: "800x480": 66 32000 800 840 888 928 480 493 496 525 0x48 0xa
[  323.400767] usb 2-1.1: Setting AVI infoframe for mode: "800x480": 66 32000 800 840 888 928 480 493 496 525 0x48 0xa
[  324.081679] usb 2-1.1: it66121_bridge_enable
root@(none):/home/klogg/workspace/fl2000_drm# 
root@(none):/home/klogg/workspace/fl2000_drm# [  325.005439] BUG: kernel NULL pointer dereference, address: 0000000000000008
[  325.008183] #PF: supervisor read access in kernel mode
[  325.008711] #PF: error_code(0x0000) - not-present page
[  325.009095] PGD 0 P4D 0 
[  325.009290] Oops: 0000 [#1] SMP PTI
[  325.009555] CPU: 0 PID: 7 Comm: kworker/0:1 Tainted: G        W  OE     5.4.0-31-generic #35-Ubuntu
[  325.010224] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1 04/01/2014
[  325.010873] Workqueue:  0x0 (events)
[  325.011151] RIP: 0010:process_one_work+0x34/0x3b0
[  325.011496] Code: 57 49 89 ff 41 56 41 55 41 54 53 48 89 f3 48 83 ec 08 48 8b 06 4c 8b 67 40 49 89 c5 45 30 ed a8 04 b8 00 00 00 00 4c 0f 44 e8 <49> 8b 45 08 44 8b b0 00 01 00 00 41 83 e6 20 44 89 75 d4 41 f6 44
[  325.012866] RSP: 0018:ffffbfe3c0047e70 EFLAGS: 00010046
[  325.013247] RAX: 0000000000000000 RBX: ffffdfe3bfc03258 RCX: ffff9865bb1e6000
[  325.013777] RDX: 0000000100001855 RSI: ffffdfe3bfc03258 RDI: ffff9865bb15d0c0
[  325.014307] RBP: ffffbfe3c0047ea0 R08: 0000000000000000 R09: 0000000000000000
[  325.014911] R10: ffff9865bba17848 R11: 0000000000000000 R12: ffff9865bba2a680
[  325.015531] R13: 0000000000000000 R14: ffff9865bb15d0c0 R15: ffff9865bb15d0c0
[  325.016152] FS:  0000000000000000(0000) GS:ffff9865bba00000(0000) knlGS:0000000000000000
[  325.016862] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  325.017364] CR2: 00000000000000b0 CR3: 0000000176a4a005 CR4: 0000000000360ef0
[  325.017985] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  325.018600] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  325.019198] Call Trace:
[  325.019413]  worker_thread+0x4d/0x400
[  325.019730]  kthread+0x104/0x140
[  325.020013]  ? process_one_work+0x3b0/0x3b0
[  325.020383]  ? kthread_park+0x90/0x90
[  325.020713]  ret_from_fork+0x35/0x40
[  325.021030] Modules linked in: it66121(OE) fl2000(OE) drm_kms_helper fb_sys_fops syscopyarea sysfillrect sysimgblt drm usbmon intel_rapl_msr intel_rapl_common kvm_intel kvm crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd glue_helper input_leds psmouse i2c_i801 ahci lpc_ich libahci serio_raw e1000 qemu_fw_cfg mac_hid 9pnet_virtio 9p 9pnet fscache
[  325.023922] CR2: 0000000000000008
[  325.024218] ---[ end trace 556acee6e6632c7b ]---
[  325.024628] RIP: 0010:process_one_work+0x34/0x3b0
[  325.025044] Code: 57 49 89 ff 41 56 41 55 41 54 53 48 89 f3 48 83 ec 08 48 8b 06 4c 8b 67 40 49 89 c5 45 30 ed a8 04 b8 00 00 00 00 4c 0f 44 e8 <49> 8b 45 08 44 8b b0 00 01 00 00 41 83 e6 20 44 89 75 d4 41 f6 44
[  325.026664] RSP: 0018:ffffbfe3c0047e70 EFLAGS: 00010046
[  325.027114] RAX: 0000000000000000 RBX: ffffdfe3bfc03258 RCX: ffff9865bb1e6000
[  325.027641] RDX: 0000000100001855 RSI: ffffdfe3bfc03258 RDI: ffff9865bb15d0c0
[  325.028168] RBP: ffffbfe3c0047ea0 R08: 0000000000000000 R09: 0000000000000000
[  325.028699] R10: ffff9865bba17848 R11: 0000000000000000 R12: ffff9865bba2a680
[  325.029226] R13: 0000000000000000 R14: ffff9865bb15d0c0 R15: ffff9865bb15d0c0
[  325.029753] FS:  0000000000000000(0000) GS:ffff9865bba00000(0000) knlGS:0000000000000000
[  325.030348] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  325.030764] CR2: 00000000000000b0 CR3: 0000000176a4a005 CR4: 0000000000360ef0
[  325.031309] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  325.031836] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Compile issue - "No rule to make target"

Sorry, I'm a bit of a noob, so maybe I should know my way out of this.
It seems Mr Make can't find his way into a directory:

make[1]: Entering directory '/usr/src/linux-headers-5.15.15-76051515-generic'
make[2]: *** No rule to make target 'arch/x86/entry/syscalls/syscall_32.tbl', needed by 'arch/x86/include/generated/uapi/asm/unistd_32.h'. Stop.
make[1]: *** [arch/x86/Makefile:213: archheaders] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.15-76051515-generic'
make: *** [Makefile:21: modules] Error 2

Pretty sure I'm in the right directory - just in home/fl2000_drm
What do I need to do to continue the compile?

getting error message on make

hello,
i cloned the repo, cd into the folder and ran make, got the following error messge.

i run debian 10

make CHECK="/usr/bin/sparse" -C /lib/modules/4.19.0-6-amd64/build M=/home/pashi/fl2000_drm modules make[1]: Entering directory '/usr/lib/modules/4.19.0-6-amd64/build' make[1]: *** No rule to make target 'modules'. Stop. make[1]: Leaving directory '/usr/lib/modules/4.19.0-6-amd64/build' make: *** [Makefile:21: modules] Error 2

Compilation failed on linux kernel 5.1.6

Error message for command make is:

/home/tinytangent/fl2000_drm/fl2000_drm.c: In function ‘fl2000_bind’:
/home/tinytangent/fl2000_drm/fl2000_drm.c:222:8: error: implicit declaration of function ‘drm_fb_cma_fbdev_init’; did you mean ‘drm_fb_helper_init’? [-Werror=implicit-function-declaration]
ret = drm_fb_cma_fbdev_init(drm, BPP, MAX_CONN);
^~~~~~~~~~~~~~~~~~~~~
drm_fb_helper_init
/home/tinytangent/fl2000_drm/fl2000_drm.c:228:2: error: implicit declaration of function ‘drm_kms_helper_poll_init’; did you mean ‘drm_fb_helper_defio_init’? [-Werror=implicit-function-declaration]
drm_kms_helper_poll_init(drm);
^~~~~~~~~~~~~~~~~~~~~~~~
drm_fb_helper_defio_init
/home/tinytangent/fl2000_drm/fl2000_drm.c: In function ‘fl2000_unbind’:
/home/tinytangent/fl2000_drm/fl2000_drm.c:254:2: error: implicit declaration of function ‘drm_fb_cma_fbdev_fini’; did you mean ‘drm_fb_helper_fini’? [-Werror=implicit-function-declaration]
drm_fb_cma_fbdev_fini(drm);
^~~~~~~~~~~~~~~~~~~~~
drm_fb_helper_fini

Maybe the kernel API is changed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.