Skip to content

Commit 219b45d

Browse files
author
Thomas Zimmermann
committed
drm/mgag200: Remove BMC output
Mgag200's BMC connector tracks the status of an underlying physical connector and updates the BMC status accordingly. This functionality works around GNOME's settings app, which cannot handle multiple outputs on the same CRTC. The workaround is now obsolete as the VGA-BMC connector handles BMC support internally. Hence, remove the driver's code and the BMC output entirely. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Jocelyn Falempe <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 0f9ff36 commit 219b45d

File tree

9 files changed

+0
-140
lines changed

9 files changed

+0
-140
lines changed

drivers/gpu/drm/mgag200/mgag200_bmc.c

Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99

1010
#include "mgag200_drv.h"
1111

12-
static struct mgag200_bmc_connector *to_mgag200_bmc_connector(struct drm_connector *connector)
13-
{
14-
return container_of(connector, struct mgag200_bmc_connector, base);
15-
}
16-
1712
void mgag200_bmc_stop_scanout(struct mga_device *mdev)
1813
{
1914
u8 tmp;
@@ -102,100 +97,3 @@ void mgag200_bmc_start_scanout(struct mga_device *mdev)
10297
tmp &= ~0x10;
10398
WREG_DAC(MGA1064_GEN_IO_DATA, tmp);
10499
}
105-
106-
static const struct drm_encoder_funcs mgag200_bmc_encoder_funcs = {
107-
.destroy = drm_encoder_cleanup,
108-
};
109-
110-
static int mgag200_bmc_connector_helper_detect_ctx(struct drm_connector *connector,
111-
struct drm_modeset_acquire_ctx *ctx,
112-
bool force)
113-
{
114-
struct mgag200_bmc_connector *bmc_connector = to_mgag200_bmc_connector(connector);
115-
struct drm_connector *physical_connector = bmc_connector->physical_connector;
116-
117-
/*
118-
* Most user-space compositors cannot handle more than one connected
119-
* connector per CRTC. Hence, we only mark the BMC as connected if the
120-
* physical connector is disconnected. If the physical connector's status
121-
* is connected or unknown, the BMC remains disconnected. This has no
122-
* effect on the output of the BMC.
123-
*
124-
* FIXME: Remove this logic once user-space compositors can handle more
125-
* than one connector per CRTC. The BMC should always be connected.
126-
*/
127-
128-
if (physical_connector && physical_connector->status == connector_status_disconnected)
129-
return connector_status_connected;
130-
131-
return connector_status_disconnected;
132-
}
133-
134-
static int mgag200_bmc_connector_helper_get_modes(struct drm_connector *connector)
135-
{
136-
struct drm_device *dev = connector->dev;
137-
struct mga_device *mdev = to_mga_device(dev);
138-
const struct mgag200_device_info *minfo = mdev->info;
139-
140-
return drm_add_modes_noedid(connector, minfo->max_hdisplay, minfo->max_vdisplay);
141-
}
142-
143-
static const struct drm_connector_helper_funcs mgag200_bmc_connector_helper_funcs = {
144-
.get_modes = mgag200_bmc_connector_helper_get_modes,
145-
.detect_ctx = mgag200_bmc_connector_helper_detect_ctx,
146-
};
147-
148-
static const struct drm_connector_funcs mgag200_bmc_connector_funcs = {
149-
.reset = drm_atomic_helper_connector_reset,
150-
.fill_modes = drm_helper_probe_single_connector_modes,
151-
.destroy = drm_connector_cleanup,
152-
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
153-
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
154-
};
155-
156-
static int mgag200_bmc_connector_init(struct drm_device *dev,
157-
struct mgag200_bmc_connector *bmc_connector,
158-
struct drm_connector *physical_connector)
159-
{
160-
struct drm_connector *connector = &bmc_connector->base;
161-
int ret;
162-
163-
ret = drm_connector_init(dev, connector, &mgag200_bmc_connector_funcs,
164-
DRM_MODE_CONNECTOR_VIRTUAL);
165-
if (ret)
166-
return ret;
167-
drm_connector_helper_add(connector, &mgag200_bmc_connector_helper_funcs);
168-
169-
bmc_connector->physical_connector = physical_connector;
170-
171-
return 0;
172-
}
173-
174-
int mgag200_bmc_output_init(struct mga_device *mdev, struct drm_connector *physical_connector)
175-
{
176-
struct drm_device *dev = &mdev->base;
177-
struct drm_crtc *crtc = &mdev->crtc;
178-
struct drm_encoder *encoder;
179-
struct mgag200_bmc_connector *bmc_connector;
180-
struct drm_connector *connector;
181-
int ret;
182-
183-
encoder = &mdev->output.bmc.encoder;
184-
ret = drm_encoder_init(dev, encoder, &mgag200_bmc_encoder_funcs,
185-
DRM_MODE_ENCODER_VIRTUAL, NULL);
186-
if (ret)
187-
return ret;
188-
encoder->possible_crtcs = drm_crtc_mask(crtc);
189-
190-
bmc_connector = &mdev->output.bmc.bmc_connector;
191-
ret = mgag200_bmc_connector_init(dev, bmc_connector, physical_connector);
192-
if (ret)
193-
return ret;
194-
connector = &bmc_connector->base;
195-
196-
ret = drm_connector_attach_encoder(connector, encoder);
197-
if (ret)
198-
return ret;
199-
200-
return 0;
201-
}

drivers/gpu/drm/mgag200/mgag200_drv.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,6 @@ static inline struct mgag200_crtc_state *to_mgag200_crtc_state(struct drm_crtc_s
188188
return container_of(base, struct mgag200_crtc_state, base);
189189
}
190190

191-
struct mgag200_bmc_connector {
192-
struct drm_connector base;
193-
struct drm_connector *physical_connector;
194-
};
195-
196191
enum mga_type {
197192
G200_PCI,
198193
G200_AGP,
@@ -283,10 +278,6 @@ struct mga_device {
283278
struct drm_encoder encoder;
284279
struct drm_connector connector;
285280
} vga;
286-
struct {
287-
struct drm_encoder encoder;
288-
struct mgag200_bmc_connector bmc_connector;
289-
} bmc;
290281
} output;
291282
};
292283

@@ -446,6 +437,5 @@ int mgag200_vga_output_init(struct mga_device *mdev);
446437
/* mgag200_bmc.c */
447438
void mgag200_bmc_stop_scanout(struct mga_device *mdev);
448439
void mgag200_bmc_start_scanout(struct mga_device *mdev);
449-
int mgag200_bmc_output_init(struct mga_device *mdev, struct drm_connector *physical_connector);
450440

451441
#endif /* __MGAG200_DRV_H__ */

drivers/gpu/drm/mgag200/mgag200_g200eh.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,6 @@ static int mgag200_g200eh_pipeline_init(struct mga_device *mdev)
219219
if (ret)
220220
return ret;
221221

222-
ret = mgag200_bmc_output_init(mdev, &mdev->output.vga.connector);
223-
if (ret)
224-
return ret;
225-
226222
return 0;
227223
}
228224

drivers/gpu/drm/mgag200/mgag200_g200eh3.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@ static int mgag200_g200eh3_pipeline_init(struct mga_device *mdev)
123123
if (ret)
124124
return ret;
125125

126-
ret = mgag200_bmc_output_init(mdev, &mdev->output.vga.connector);
127-
if (ret)
128-
return ret;
129-
130126
return 0;
131127
}
132128

drivers/gpu/drm/mgag200/mgag200_g200er.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,6 @@ static int mgag200_g200er_pipeline_init(struct mga_device *mdev)
259259
if (ret)
260260
return ret;
261261

262-
ret = mgag200_bmc_output_init(mdev, &mdev->output.vga.connector);
263-
if (ret)
264-
return ret;
265-
266262
return 0;
267263
}
268264

drivers/gpu/drm/mgag200/mgag200_g200ev.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,6 @@ static int mgag200_g200ev_pipeline_init(struct mga_device *mdev)
260260
if (ret)
261261
return ret;
262262

263-
ret = mgag200_bmc_output_init(mdev, &mdev->output.vga.connector);
264-
if (ret)
265-
return ret;
266-
267263
return 0;
268264
}
269265

drivers/gpu/drm/mgag200/mgag200_g200ew3.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,6 @@ static int mgag200_g200ew3_pipeline_init(struct mga_device *mdev)
132132
if (ret)
133133
return ret;
134134

135-
ret = mgag200_bmc_output_init(mdev, &mdev->output.vga.connector);
136-
if (ret)
137-
return ret;
138-
139135
return 0;
140136
}
141137

drivers/gpu/drm/mgag200/mgag200_g200se.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,6 @@ static int mgag200_g200se_pipeline_init(struct mga_device *mdev)
391391
if (ret)
392392
return ret;
393393

394-
ret = mgag200_bmc_output_init(mdev, &mdev->output.vga.connector);
395-
if (ret)
396-
return ret;
397-
398394
return 0;
399395
}
400396

drivers/gpu/drm/mgag200/mgag200_g200wb.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,6 @@ static int mgag200_g200wb_pipeline_init(struct mga_device *mdev)
266266
if (ret)
267267
return ret;
268268

269-
ret = mgag200_bmc_output_init(mdev, &mdev->output.vga.connector);
270-
if (ret)
271-
return ret;
272-
273269
return 0;
274270
}
275271

0 commit comments

Comments
 (0)