[PATCH 2/3] drm: qxl: Open code probing sequence for qxl

Gustavo Padovan gustavo at padovan.org
Mon Jan 16 21:16:15 UTC 2017


Hi Gabriel,

2017-01-12 Gabriel Krisman Bertazi <krisman at collabora.co.uk>:

> This avoids using the deprecated drm_get_pci_dev() and load() hook
> interfaces in the qxl driver.
> 
> The only tricky part is to ensure TTM debugfs initialization
> happens after the debugfs root node is created, which is done by moving
> that code into the debufs_init() hook.  Since the hook is called 3 times
> for each minor function, we make sure it is only executed for the
> primary minor.
> 
> Tested on qemu with igt and running a WM on top of X.
> 
> Signed-off-by: Gabriel Krisman Bertazi <krisman at collabora.co.uk>
> CC: Dave Airlie <airlied at redhat.com>
> CC: Daniel Vetter <daniel.vetter at ffwll.ch>
> CC: dri-devel at lists.freedesktop.org
> ---
>  drivers/gpu/drm/qxl/qxl_debugfs.c | 12 ++++++++
>  drivers/gpu/drm/qxl/qxl_drv.c     | 58 +++++++++++++++++++++++++++++++++++++--
>  drivers/gpu/drm/qxl/qxl_drv.h     |  7 ++++-
>  drivers/gpu/drm/qxl/qxl_kms.c     | 40 ++-------------------------
>  drivers/gpu/drm/qxl/qxl_ttm.c     |  8 +-----
>  5 files changed, 77 insertions(+), 48 deletions(-)
> 
> diff --git a/drivers/gpu/drm/qxl/qxl_debugfs.c b/drivers/gpu/drm/qxl/qxl_debugfs.c
> index 241af9131dc8..417b538b3ed8 100644
> --- a/drivers/gpu/drm/qxl/qxl_debugfs.c
> +++ b/drivers/gpu/drm/qxl/qxl_debugfs.c
> @@ -84,8 +84,20 @@ int
>  qxl_debugfs_init(struct drm_minor *minor)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> +	int r;
> +	struct qxl_device *dev =
> +		(struct qxl_device *) minor->dev->dev_private;
> +
>  	drm_debugfs_create_files(qxl_debugfs_list, QXL_DEBUGFS_ENTRIES,
>  				 minor->debugfs_root, minor);
> +
> +	if (minor->type == DRM_MINOR_PRIMARY) {

I'm not confortable with exposing minor->type here and making qxl
the first driver to use it outside of drm core. Don't we have any other
way. 

I see that inside qxl_debugfs_add_files() we have a check for already
registered files. Wouldn't that or some modification around work for
this?

Gustavo


More information about the dri-devel mailing list