[PATCH 1/2] drm: Mark up legacy/dri1 drivers with DRM_LEGACY
Frank Binns
frank.binns at imgtec.com
Thu Aug 4 07:22:57 UTC 2016
On 03/08/16 20:11, Daniel Vetter wrote:
> It's super confusing that new drivers need to be marked with
> DRIVER_MODESET when really it means DRIVER_MODERN. Much better to
> invert the meaning and rename it to something that's suitably
> off-putting.
>
> Since there's over 100 places using DRIVER_MODESET we need to roll out
> this change without a flag day.
>
> v2: Update docs.
>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
Reviewed-by: Frank Binns <frank.binns at imgtec.com>
> ---
> Documentation/gpu/drm-internals.rst | 9 ++++++---
> drivers/gpu/drm/i810/i810_drv.c | 4 +---
> drivers/gpu/drm/mga/mga_drv.c | 2 +-
> drivers/gpu/drm/r128/r128_drv.c | 2 +-
> drivers/gpu/drm/savage/savage_drv.c | 2 +-
> drivers/gpu/drm/sis/sis_drv.c | 2 +-
> drivers/gpu/drm/tdfx/tdfx_drv.c | 1 +
> drivers/gpu/drm/via/via_drv.c | 2 +-
> include/drm/drmP.h | 1 +
> 9 files changed, 14 insertions(+), 11 deletions(-)
>
> diff --git a/Documentation/gpu/drm-internals.rst b/Documentation/gpu/drm-internals.rst
> index 3bb26135971f..37284bcc7764 100644
> --- a/Documentation/gpu/drm-internals.rst
> +++ b/Documentation/gpu/drm-internals.rst
> @@ -53,9 +53,12 @@ u32 driver_features;
> DRIVER_USE_AGP
> Driver uses AGP interface, the DRM core will manage AGP resources.
>
> -DRIVER_REQUIRE_AGP
> - Driver needs AGP interface to function. AGP initialization failure
> - will become a fatal error.
> +DRIVER_LEGACY
> + Denote a legacy driver using shadow attach. Don't use.
> +
> +DRIVER_KMS_LEGACY_CONTEXT
> + Used only by nouveau for backwards compatibility with existing userspace.
> + Don't use.
>
> DRIVER_PCI_DMA
> Driver is capable of PCI DMA, mapping of PCI DMA buffers to
> diff --git a/drivers/gpu/drm/i810/i810_drv.c b/drivers/gpu/drm/i810/i810_drv.c
> index 44f4a131c8dd..0be55dc1ef4b 100644
> --- a/drivers/gpu/drm/i810/i810_drv.c
> +++ b/drivers/gpu/drm/i810/i810_drv.c
> @@ -56,9 +56,7 @@ static const struct file_operations i810_driver_fops = {
> };
>
> static struct drm_driver driver = {
> - .driver_features =
> - DRIVER_USE_AGP |
> - DRIVER_HAVE_DMA,
> + .driver_features = DRIVER_USE_AGP | DRIVER_HAVE_DMA | DRIVER_LEGACY,
> .dev_priv_size = sizeof(drm_i810_buf_priv_t),
> .load = i810_driver_load,
> .lastclose = i810_driver_lastclose,
> diff --git a/drivers/gpu/drm/mga/mga_drv.c b/drivers/gpu/drm/mga/mga_drv.c
> index 5e2f131a6a72..25b2a1a424e6 100644
> --- a/drivers/gpu/drm/mga/mga_drv.c
> +++ b/drivers/gpu/drm/mga/mga_drv.c
> @@ -58,7 +58,7 @@ static const struct file_operations mga_driver_fops = {
>
> static struct drm_driver driver = {
> .driver_features =
> - DRIVER_USE_AGP | DRIVER_PCI_DMA |
> + DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_LEGACY |
> DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED,
> .dev_priv_size = sizeof(drm_mga_buf_priv_t),
> .load = mga_driver_load,
> diff --git a/drivers/gpu/drm/r128/r128_drv.c b/drivers/gpu/drm/r128/r128_drv.c
> index c57b4de63caf..a982be57d1ef 100644
> --- a/drivers/gpu/drm/r128/r128_drv.c
> +++ b/drivers/gpu/drm/r128/r128_drv.c
> @@ -56,7 +56,7 @@ static const struct file_operations r128_driver_fops = {
>
> static struct drm_driver driver = {
> .driver_features =
> - DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_SG |
> + DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_SG | DRIVER_LEGACY |
> DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED,
> .dev_priv_size = sizeof(drm_r128_buf_priv_t),
> .load = r128_driver_load,
> diff --git a/drivers/gpu/drm/savage/savage_drv.c b/drivers/gpu/drm/savage/savage_drv.c
> index 21aed1febeb4..3b807135a5cd 100644
> --- a/drivers/gpu/drm/savage/savage_drv.c
> +++ b/drivers/gpu/drm/savage/savage_drv.c
> @@ -50,7 +50,7 @@ static const struct file_operations savage_driver_fops = {
>
> static struct drm_driver driver = {
> .driver_features =
> - DRIVER_USE_AGP | DRIVER_HAVE_DMA | DRIVER_PCI_DMA,
> + DRIVER_USE_AGP | DRIVER_HAVE_DMA | DRIVER_PCI_DMA | DRIVER_LEGACY,
> .dev_priv_size = sizeof(drm_savage_buf_priv_t),
> .load = savage_driver_load,
> .firstopen = savage_driver_firstopen,
> diff --git a/drivers/gpu/drm/sis/sis_drv.c b/drivers/gpu/drm/sis/sis_drv.c
> index 79bce76cb8f7..ae9839886c4d 100644
> --- a/drivers/gpu/drm/sis/sis_drv.c
> +++ b/drivers/gpu/drm/sis/sis_drv.c
> @@ -102,7 +102,7 @@ static void sis_driver_postclose(struct drm_device *dev, struct drm_file *file)
> }
>
> static struct drm_driver driver = {
> - .driver_features = DRIVER_USE_AGP,
> + .driver_features = DRIVER_USE_AGP | DRIVER_LEGACY,
> .load = sis_driver_load,
> .unload = sis_driver_unload,
> .open = sis_driver_open,
> diff --git a/drivers/gpu/drm/tdfx/tdfx_drv.c b/drivers/gpu/drm/tdfx/tdfx_drv.c
> index fab5ebcb0fef..f418892b0c71 100644
> --- a/drivers/gpu/drm/tdfx/tdfx_drv.c
> +++ b/drivers/gpu/drm/tdfx/tdfx_drv.c
> @@ -56,6 +56,7 @@ static const struct file_operations tdfx_driver_fops = {
> };
>
> static struct drm_driver driver = {
> + .driver_features = DRIVER_LEGACY,
> .set_busid = drm_pci_set_busid,
> .fops = &tdfx_driver_fops,
> .name = DRIVER_NAME,
> diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
> index ed8aa8ff861a..e5582bab7e3c 100644
> --- a/drivers/gpu/drm/via/via_drv.c
> +++ b/drivers/gpu/drm/via/via_drv.c
> @@ -72,7 +72,7 @@ static const struct file_operations via_driver_fops = {
>
> static struct drm_driver driver = {
> .driver_features =
> - DRIVER_USE_AGP | DRIVER_HAVE_IRQ |
> + DRIVER_USE_AGP | DRIVER_HAVE_IRQ | DRIVER_LEGACY |
> DRIVER_IRQ_SHARED,
> .load = via_driver_load,
> .unload = via_driver_unload,
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 5f9caf7ee949..9c828d6f7cdc 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -146,6 +146,7 @@ void drm_err(const char *format, ...);
>
> /* driver capabilities and requirements mask */
> #define DRIVER_USE_AGP 0x1
> +#define DRIVER_LEGACY 0x2
> #define DRIVER_PCI_DMA 0x8
> #define DRIVER_SG 0x10
> #define DRIVER_HAVE_DMA 0x20
More information about the dri-devel
mailing list