mbox series

[0/2] of: Register platform device for each framebuffer

Message ID 20220413092454.1073-1-tzimmermann@suse.de
Headers show
Series of: Register platform device for each framebuffer | expand

Message

Thomas Zimmermann April 13, 2022, 9:24 a.m. UTC
Move the detection of OF framebuffers from fbdev into of platform code
and register a Linux platform device for each framebuffer. Allows for
DRM-based OF drivers and real hot-unplugging of the framebuffer.

This patchset has been tested with qemu's ppc64le emulation, which
provides a framebuffer via OF display node. If someone has an older
32-bit system with BootX available, please test.

Thomas Zimmermann (2):
  of: Create platform devices for OF framebuffers
  fbdev: Remove hot-unplug workaround for framebuffers without device

 drivers/of/platform.c            | 73 ++++++++++++++++++++++--
 drivers/video/fbdev/core/fbmem.c |  9 +--
 drivers/video/fbdev/offb.c       | 98 +++++++++++++++++++++-----------
 3 files changed, 135 insertions(+), 45 deletions(-)


base-commit: 74ee32cc715cd9557c62aba937d6995851c68fe7
prerequisite-patch-id: c2b2f08f0eccc9f5df0c0da49fa1d36267deb11d
prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24
prerequisite-patch-id: 6e1032c6302461624f33194c8b8f37103a3fa6ef
prerequisite-patch-id: dbf45768338ff1d944d093dc54bdffb3dc054b44
prerequisite-patch-id: 9c12c87b13a3519a93b81ca18299fae96ae4fefe
prerequisite-patch-id: 3f204510fcbf9530d6540bd8e6128cce598988b6
prerequisite-patch-id: ab7611d28d07723ab1dd392dcf9a6345de3b1040

Comments

Thomas Zimmermann April 18, 2022, 6:09 p.m. UTC | #1
Hi

Am 13.04.22 um 14:51 schrieb Rob Herring:
...
>> +
>>   /**
>>    * of_platform_populate() - Populate platform_devices from device tree data
>>    * @root: parent of the first level to probe or NULL for the root of the tree
>> @@ -541,9 +595,7 @@ static int __init of_platform_default_populate_init(void)
>>                  of_node_put(node);
>>          }
>>
>> -       node = of_get_compatible_child(of_chosen, "simple-framebuffer");
>> -       of_platform_device_create(node, NULL, NULL);
>> -       of_node_put(node);
>> +       of_platform_populate_framebuffers();
>>
>>          /* Populate everything else. */
>>          of_platform_default_populate(NULL, NULL, NULL);
> 
> I'm pretty sure it's just this call that's the problem for PPC though
> none of the above existed when adding this caused a regression. Can we
> remove the ifdef and just make this call conditional on
> !IS_ENABLED(CONFIG_PPC).

That didn't work. The boot process stops at some point. I'll send you an 
updated patch that covers most of the function with IS_ENABLED(CONFIG_PPC)

Best regards
Thomas

> 
> 
>> @@ -551,6 +603,20 @@ static int __init of_platform_default_populate_init(void)
>>          return 0;
>>   }
>>   arch_initcall_sync(of_platform_default_populate_init);
>> +#else
>> +static int __init of_platform_default_populate_init(void)
>> +{
>> +       device_links_supplier_sync_state_pause();
>> +
>> +       if (!of_have_populated_dt())
>> +               return -ENODEV;
>> +
>> +       of_platform_populate_framebuffers();
>> +
>> +       return 0;
>> +}
>> +arch_initcall_sync(of_platform_default_populate_init);
>> +#endif
>>
>>   static int __init of_platform_sync_state_init(void)
>>   {
>> @@ -558,7 +624,6 @@ static int __init of_platform_sync_state_init(void)
>>          return 0;
>>   }
>>   late_initcall_sync(of_platform_sync_state_init);
>> -#endif
>>
>>   int of_platform_device_destroy(struct device *dev, void *data)
>>   {