Author: imp
Date: Tue Aug 28 14:46:55 2018
New Revision: 338348
URL: https://svnweb.freebsd.org/changeset/base/338348

Log:
  Add big, nasty abandonware tags to this code.
  
  This code works for some people, but hasn't been updated in a long
  time. Still allow people to use this code for the moment, but put a
  big, nasty obsolete message to inform and encourage people to move to
  the port.
  
  Approved by: re@ (gjb)
  Differential Review: https://reviews.freebsd.org/D16894

Modified:
  head/sys/dev/drm/drm.h
  head/sys/dev/drm/drm_drv.c
  head/sys/dev/drm2/drm_os_freebsd.c
  head/sys/dev/drm2/drm_os_freebsd.h

Modified: head/sys/dev/drm/drm.h
==============================================================================
--- head/sys/dev/drm/drm.h      Tue Aug 28 14:46:49 2018        (r338347)
+++ head/sys/dev/drm/drm.h      Tue Aug 28 14:46:55 2018        (r338348)
@@ -1145,4 +1145,15 @@ typedef struct drm_mm_init_arg drm_mm_init_arg_t;
 typedef enum drm_bo_type drm_bo_type_t;
 #endif
 
+#define DRM_PORT "graphics/drm-legacy-kmod"
+
+#define DRM_OBSOLETE(dev)                                                      
\
+    do {                                                                       
\
+       device_printf(dev, 
"=======================================================\n"); \
+       device_printf(dev, "This code is obsolete abandonware. Install the " 
DRM_PORT " pkg\n"); \
+       device_printf(dev, 
"=======================================================\n"); \
+       gone_in_dev(dev, 13, "drm drivers");                                    
\
+    } while (0)
+
+
 #endif

Modified: head/sys/dev/drm/drm_drv.c
==============================================================================
--- head/sys/dev/drm/drm_drv.c  Tue Aug 28 14:46:49 2018        (r338347)
+++ head/sys/dev/drm/drm_drv.c  Tue Aug 28 14:46:55 2018        (r338348)
@@ -174,7 +174,8 @@ int drm_probe(device_t kdev, drm_pci_id_list_t *idlist
                        DRM_DEBUG("desc : %s\n", device_get_desc(kdev));
                        device_set_desc(kdev, id_entry->name);
                }
-               return 0;
+               DRM_OBSOLETE(kdev);
+               return BUS_PROBE_GENERIC;
        }
 
        return ENXIO;

Modified: head/sys/dev/drm2/drm_os_freebsd.c
==============================================================================
--- head/sys/dev/drm2/drm_os_freebsd.c  Tue Aug 28 14:46:49 2018        
(r338347)
+++ head/sys/dev/drm2/drm_os_freebsd.c  Tue Aug 28 14:46:55 2018        
(r338348)
@@ -126,7 +126,8 @@ drm_probe_helper(device_t kdev, const drm_pci_id_list_
                            device_get_nameunit(kdev), id_entry->name);
                        device_set_desc(kdev, id_entry->name);
                }
-               return (0);
+               DRM_OBSOLETE(kdev);
+               return (-BUS_PROBE_GENERIC);
        }
 
        return (-ENXIO);

Modified: head/sys/dev/drm2/drm_os_freebsd.h
==============================================================================
--- head/sys/dev/drm2/drm_os_freebsd.h  Tue Aug 28 14:46:49 2018        
(r338347)
+++ head/sys/dev/drm2/drm_os_freebsd.h  Tue Aug 28 14:46:55 2018        
(r338348)
@@ -154,6 +154,20 @@ typedef void                       irqreturn_t;
        *(volatile u_int64_t *)(((vm_offset_t)(map)->handle) +          \
            (vm_offset_t)(offset)) = htole64(val)
 
+#ifdef __LP64__
+#define DRM_PORT "graphics/drm-stable-kmod"
+#else
+#define DRM_PORT "graphics/drm-legacy-kmod"
+#endif
+
+#define DRM_OBSOLETE(dev)                                                      
\
+    do {                                                                       
\
+       device_printf(dev, 
"=======================================================\n"); \
+       device_printf(dev, "This code is obsolete abandonware. Install the " 
DRM_PORT " pkg\n"); \
+       device_printf(dev, 
"=======================================================\n"); \
+       gone_in_dev(dev, 13, "drm2 drivers");                                   
\
+    } while (0)
+
 /* DRM_READMEMORYBARRIER() prevents reordering of reads.
  * DRM_WRITEMEMORYBARRIER() prevents reordering of writes.
  * DRM_MEMORYBARRIER() prevents reordering of reads and writes.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to