1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
4 * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
10 int viafb_ioctl_get_viafb_info(u_long arg
)
12 struct viafb_ioctl_info viainfo
;
14 memset(&viainfo
, 0, sizeof(struct viafb_ioctl_info
));
16 viainfo
.viafb_id
= VIAID
;
17 viainfo
.vendor_id
= PCI_VIA_VENDOR_ID
;
19 switch (viaparinfo
->chip_info
->gfx_chip_name
) {
20 case UNICHROME_CLE266
:
21 viainfo
.device_id
= UNICHROME_CLE266_DID
;
25 viainfo
.device_id
= UNICHROME_K400_DID
;
29 viainfo
.device_id
= UNICHROME_K800_DID
;
33 viainfo
.device_id
= UNICHROME_PM800_DID
;
37 viainfo
.device_id
= UNICHROME_CN700_DID
;
41 viainfo
.device_id
= UNICHROME_CX700_DID
;
44 case UNICHROME_K8M890
:
45 viainfo
.device_id
= UNICHROME_K8M890_DID
;
48 case UNICHROME_P4M890
:
49 viainfo
.device_id
= UNICHROME_P4M890_DID
;
52 case UNICHROME_P4M900
:
53 viainfo
.device_id
= UNICHROME_P4M900_DID
;
57 viainfo
.version
= VERSION_MAJOR
;
58 viainfo
.revision
= VERSION_MINOR
;
60 if (copy_to_user((void __user
*)arg
, &viainfo
, sizeof(viainfo
)))
66 /* Hot-Plug Priority: DVI > CRT*/
67 int viafb_ioctl_hotplug(int hres
, int vres
, int bpp
)
69 int DVIsense
, status
= 0;
70 DEBUG_MSG(KERN_INFO
"viafb_ioctl_hotplug!!\n");
72 if (viaparinfo
->chip_info
->tmds_chip_info
.tmds_chip_name
!=
73 NON_TMDS_TRANSMITTER
) {
74 DVIsense
= viafb_dvi_sense();
77 DEBUG_MSG(KERN_INFO
"DVI Attached...\n");
78 if (viafb_DeviceStatus
!= DVI_Device
) {
82 viafb_DeviceStatus
= DVI_Device
;
84 return viafb_DeviceStatus
;
88 DEBUG_MSG(KERN_INFO
"DVI De-attached...\n");
91 if ((viafb_DeviceStatus
!= CRT_Device
) && (status
== 0)) {
96 viafb_DeviceStatus
= CRT_Device
;
98 return viafb_DeviceStatus
;