[PATCH v1 3/4] drm/mga: drop use of drmP.h

Daniel Vetter daniel at ffwll.ch
Tue Jun 11 08:54:35 UTC 2019


On Tue, Jun 11, 2019 at 09:53:51AM +0200, Thomas Zimmermann wrote:
> Hi
> 
> Am 08.06.19 um 10:19 schrieb Sam Ravnborg:
> > Drop the use of the deprecated drmP.h header file.
> > Clean up list of include files and sort them.
> > 
> > Signed-off-by: Sam Ravnborg <sam at ravnborg.org>
> > Cc: Thomas Zimmermann <tzimmermann at suse.de>
> > Cc: Daniel Vetter <daniel at ffwll.ch>
> > Cc: David Airlie <airlied at linux.ie>
> > ---
> >  drivers/gpu/drm/mga/mga_dma.c   | 2 --
> >  drivers/gpu/drm/mga/mga_drv.c   | 7 +++----
> >  drivers/gpu/drm/mga/mga_ioc32.c | 3 +--
> >  drivers/gpu/drm/mga/mga_irq.c   | 2 --
> >  drivers/gpu/drm/mga/mga_state.c | 2 --
> >  drivers/gpu/drm/mga/mga_warp.c  | 4 +---
> >  6 files changed, 5 insertions(+), 15 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/mga/mga_dma.c b/drivers/gpu/drm/mga/mga_dma.c
> > index 123be2f3a151..139554a3733d 100644
> > --- a/drivers/gpu/drm/mga/mga_dma.c
> > +++ b/drivers/gpu/drm/mga/mga_dma.c
> > @@ -37,8 +37,6 @@
> >  
> >  #include <linux/delay.h>
> >  
> > -#include <drm/drmP.h>
> > -#include <drm/mga_drm.h>
> >  #include "mga_drv.h"
> >  
> >  #define MGA_DEFAULT_USEC_TIMEOUT	10000
> > diff --git a/drivers/gpu/drm/mga/mga_drv.c b/drivers/gpu/drm/mga/mga_drv.c
> > index 6e1d1054ad06..71128e6f6ae9 100644
> > --- a/drivers/gpu/drm/mga/mga_drv.c
> > +++ b/drivers/gpu/drm/mga/mga_drv.c
> > @@ -31,12 +31,11 @@
> >  
> >  #include <linux/module.h>
> >  
> > -#include <drm/drmP.h>
> > -#include <drm/mga_drm.h>
> > -#include "mga_drv.h"
> > -
> > +#include <drm/drm_drv.h>
> >  #include <drm/drm_pciids.h>
> >  
> > +#include "mga_drv.h"
> > +
> 
> Unless it violates an existing convention, I'd suggest the following
> order for headers (here and in the other patches):
> 
>  c file header ("mga_foo.h" for mga_foo.c)
>  driver header ("mga_drv.h")
>  public linux/drm headers
>  other driver headers ("mga_nonfoo.h", etc)
> 
> I know that it's nitpicking, but this maximizes the chance that the
> driver's header files include all dependencies they need.

Hm I think generally we go the other way round in linux:

#include <asm/*.h>
#include <linux/*.h>
#include <drm/*.h>

#include "*.h"

Cheers, Daniel

> 
> Best regards
> Thomas
> 
> 
> >  static struct pci_device_id pciidlist[] = {
> >  	mga_PCI_IDS
> >  };
> > diff --git a/drivers/gpu/drm/mga/mga_ioc32.c b/drivers/gpu/drm/mga/mga_ioc32.c
> > index 245fb2e359cf..6ccd270789c6 100644
> > --- a/drivers/gpu/drm/mga/mga_ioc32.c
> > +++ b/drivers/gpu/drm/mga/mga_ioc32.c
> > @@ -30,10 +30,9 @@
> >   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> >   * IN THE SOFTWARE.
> >   */
> > +
> >  #include <linux/compat.h>
> >  
> > -#include <drm/drmP.h>
> > -#include <drm/mga_drm.h>
> >  #include "mga_drv.h"
> >  
> >  typedef struct drm32_mga_init {
> > diff --git a/drivers/gpu/drm/mga/mga_irq.c b/drivers/gpu/drm/mga/mga_irq.c
> > index c6a3fab5b0c4..7c48f4d090ac 100644
> > --- a/drivers/gpu/drm/mga/mga_irq.c
> > +++ b/drivers/gpu/drm/mga/mga_irq.c
> > @@ -31,8 +31,6 @@
> >   *    Eric Anholt <anholt at FreeBSD.org>
> >   */
> >  
> > -#include <drm/drmP.h>
> > -#include <drm/mga_drm.h>
> >  #include "mga_drv.h"
> >  
> >  u32 mga_get_vblank_counter(struct drm_device *dev, unsigned int pipe)
> > diff --git a/drivers/gpu/drm/mga/mga_state.c b/drivers/gpu/drm/mga/mga_state.c
> > index 296a1db7e5ee..77a0b006f066 100644
> > --- a/drivers/gpu/drm/mga/mga_state.c
> > +++ b/drivers/gpu/drm/mga/mga_state.c
> > @@ -32,8 +32,6 @@
> >   *    Gareth Hughes <gareth at valinux.com>
> >   */
> >  
> > -#include <drm/drmP.h>
> > -#include <drm/mga_drm.h>
> >  #include "mga_drv.h"
> >  
> >  /* ================================================================
> > diff --git a/drivers/gpu/drm/mga/mga_warp.c b/drivers/gpu/drm/mga/mga_warp.c
> > index 0b76352260a9..b5ef1d2c8b1c 100644
> > --- a/drivers/gpu/drm/mga/mga_warp.c
> > +++ b/drivers/gpu/drm/mga/mga_warp.c
> > @@ -29,11 +29,9 @@
> >  
> >  #include <linux/firmware.h>
> >  #include <linux/ihex.h>
> > -#include <linux/platform_device.h>
> >  #include <linux/module.h>
> > +#include <linux/platform_device.h>
> >  
> > -#include <drm/drmP.h>
> > -#include <drm/mga_drm.h>
> >  #include "mga_drv.h"
> >  
> >  #define FIRMWARE_G200 "matrox/g200_warp.fw"
> > 
> 
> -- 
> Thomas Zimmermann
> Graphics Driver Developer
> SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
> GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
> HRB 21284 (AG Nürnberg)
> 




-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list