diff mbox series

[v3,17/23] drm/qxl: use generic fbdev emulation

Message ID 20190118122020.27596-18-kraxel@redhat.com (mailing list archive)
State New, archived
Headers show
Series drm/qxl: ttm fixes, cleanups, allocation tweaks, multihead, fbdev | expand

Commit Message

Gerd Hoffmann Jan. 18, 2019, 12:20 p.m. UTC
Switch qxl over to the new generic fbdev emulation.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/qxl/qxl_display.c | 7 -------
 drivers/gpu/drm/qxl/qxl_drv.c     | 2 ++
 2 files changed, 2 insertions(+), 7 deletions(-)

Comments

Noralf Trønnes Jan. 25, 2019, 5:25 p.m. UTC | #1
Den 18.01.2019 13.20, skrev Gerd Hoffmann:
> Switch qxl over to the new generic fbdev emulation.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  drivers/gpu/drm/qxl/qxl_display.c | 7 -------
>  drivers/gpu/drm/qxl/qxl_drv.c     | 2 ++
>  2 files changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
> index ef832f98ab..9c751f01e3 100644
> --- a/drivers/gpu/drm/qxl/qxl_display.c
> +++ b/drivers/gpu/drm/qxl/qxl_display.c
> @@ -1221,18 +1221,11 @@ int qxl_modeset_init(struct qxl_device *qdev)
>  	qxl_display_read_client_monitors_config(qdev);
>  
>  	drm_mode_config_reset(&qdev->ddev);
> -
> -	/* primary surface must be created by this point, to allow
> -	 * issuing command queue commands and having them read by
> -	 * spice server. */
> -	qxl_fbdev_init(qdev);
>  	return 0;
>  }
>  
>  void qxl_modeset_fini(struct qxl_device *qdev)
>  {
> -	qxl_fbdev_fini(qdev);
> -
>  	qxl_destroy_monitors_object(qdev);
>  	drm_mode_config_cleanup(&qdev->ddev);
>  }
> diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
> index 13c8a662f9..3fce7d16df 100644
> --- a/drivers/gpu/drm/qxl/qxl_drv.c
> +++ b/drivers/gpu/drm/qxl/qxl_drv.c
> @@ -93,6 +93,8 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	if (ret)
>  		goto modeset_cleanup;
>  
> +	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");

I couldn't find that this was part of old fbdev code, so it would be
nice to mention it in the commit message.

Acked-by: Noralf Trønnes <noralf@tronnes.org>


> +	drm_fbdev_generic_setup(&qdev->ddev, 32);
>  	return 0;
>  
>  modeset_cleanup:
>
Gerd Hoffmann Jan. 28, 2019, 8:59 a.m. UTC | #2
On Fri, Jan 25, 2019 at 06:25:27PM +0100, Noralf Trønnes wrote:
> 
> 
> Den 18.01.2019 13.20, skrev Gerd Hoffmann:
> > Switch qxl over to the new generic fbdev emulation.
> > 
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > ---
> >  drivers/gpu/drm/qxl/qxl_display.c | 7 -------
> >  drivers/gpu/drm/qxl/qxl_drv.c     | 2 ++
> >  2 files changed, 2 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
> > index ef832f98ab..9c751f01e3 100644
> > --- a/drivers/gpu/drm/qxl/qxl_display.c
> > +++ b/drivers/gpu/drm/qxl/qxl_display.c
> > @@ -1221,18 +1221,11 @@ int qxl_modeset_init(struct qxl_device *qdev)
> >  	qxl_display_read_client_monitors_config(qdev);
> >  
> >  	drm_mode_config_reset(&qdev->ddev);
> > -
> > -	/* primary surface must be created by this point, to allow
> > -	 * issuing command queue commands and having them read by
> > -	 * spice server. */
> > -	qxl_fbdev_init(qdev);
> >  	return 0;
> >  }
> >  
> >  void qxl_modeset_fini(struct qxl_device *qdev)
> >  {
> > -	qxl_fbdev_fini(qdev);
> > -
> >  	qxl_destroy_monitors_object(qdev);
> >  	drm_mode_config_cleanup(&qdev->ddev);
> >  }
> > diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
> > index 13c8a662f9..3fce7d16df 100644
> > --- a/drivers/gpu/drm/qxl/qxl_drv.c
> > +++ b/drivers/gpu/drm/qxl/qxl_drv.c
> > @@ -93,6 +93,8 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> >  	if (ret)
> >  		goto modeset_cleanup;
> >  
> > +	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
> 
> I couldn't find that this was part of old fbdev code, so it would be
> nice to mention it in the commit message.

It actually is, but a bit hidden because it doesn't use a helper you can
easily grep for.  Instead sets fb_info->apertures->ranges[0] in
qxlfb_create(), which has the same effect.

cheers,
  Gerd
Noralf Trønnes Jan. 28, 2019, 10:39 a.m. UTC | #3
Den 28.01.2019 09.59, skrev Gerd Hoffmann:
> On Fri, Jan 25, 2019 at 06:25:27PM +0100, Noralf Trønnes wrote:
>>
>>
>> Den 18.01.2019 13.20, skrev Gerd Hoffmann:
>>> Switch qxl over to the new generic fbdev emulation.
>>>
>>> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>>> ---
>>>  drivers/gpu/drm/qxl/qxl_display.c | 7 -------
>>>  drivers/gpu/drm/qxl/qxl_drv.c     | 2 ++
>>>  2 files changed, 2 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
>>> index ef832f98ab..9c751f01e3 100644
>>> --- a/drivers/gpu/drm/qxl/qxl_display.c
>>> +++ b/drivers/gpu/drm/qxl/qxl_display.c
>>> @@ -1221,18 +1221,11 @@ int qxl_modeset_init(struct qxl_device *qdev)
>>>  	qxl_display_read_client_monitors_config(qdev);
>>>  
>>>  	drm_mode_config_reset(&qdev->ddev);
>>> -
>>> -	/* primary surface must be created by this point, to allow
>>> -	 * issuing command queue commands and having them read by
>>> -	 * spice server. */
>>> -	qxl_fbdev_init(qdev);
>>>  	return 0;
>>>  }
>>>  
>>>  void qxl_modeset_fini(struct qxl_device *qdev)
>>>  {
>>> -	qxl_fbdev_fini(qdev);
>>> -
>>>  	qxl_destroy_monitors_object(qdev);
>>>  	drm_mode_config_cleanup(&qdev->ddev);
>>>  }
>>> diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
>>> index 13c8a662f9..3fce7d16df 100644
>>> --- a/drivers/gpu/drm/qxl/qxl_drv.c
>>> +++ b/drivers/gpu/drm/qxl/qxl_drv.c
>>> @@ -93,6 +93,8 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>>>  	if (ret)
>>>  		goto modeset_cleanup;
>>>  
>>> +	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
>>
>> I couldn't find that this was part of old fbdev code, so it would be
>> nice to mention it in the commit message.
> 
> It actually is, but a bit hidden because it doesn't use a helper you can
> easily grep for.  Instead sets fb_info->apertures->ranges[0] in
> qxlfb_create(), which has the same effect.
> 

Indeed,

Acked-by: Noralf Trønnes <noralf@tronnes.org>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index ef832f98ab..9c751f01e3 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -1221,18 +1221,11 @@  int qxl_modeset_init(struct qxl_device *qdev)
 	qxl_display_read_client_monitors_config(qdev);
 
 	drm_mode_config_reset(&qdev->ddev);
-
-	/* primary surface must be created by this point, to allow
-	 * issuing command queue commands and having them read by
-	 * spice server. */
-	qxl_fbdev_init(qdev);
 	return 0;
 }
 
 void qxl_modeset_fini(struct qxl_device *qdev)
 {
-	qxl_fbdev_fini(qdev);
-
 	qxl_destroy_monitors_object(qdev);
 	drm_mode_config_cleanup(&qdev->ddev);
 }
diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
index 13c8a662f9..3fce7d16df 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.c
+++ b/drivers/gpu/drm/qxl/qxl_drv.c
@@ -93,6 +93,8 @@  qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret)
 		goto modeset_cleanup;
 
+	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
+	drm_fbdev_generic_setup(&qdev->ddev, 32);
 	return 0;
 
 modeset_cleanup: