Skip to content

Commit 5e9c0d1

Browse files
author
Thomas Zimmermann
committed
drm/ast: Remove BMC output
Ast'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 all code for physical outputs handle BMC support internally. Hence, remove the driver's code and the BMC output entirely. v3: - remove struct ast_bmc_connector Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Jocelyn Falempe <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 2a2391f commit 5e9c0d1

File tree

2 files changed

+0
-126
lines changed

2 files changed

+0
-126
lines changed

drivers/gpu/drm/ast/ast_drv.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -162,21 +162,6 @@ to_ast_connector(struct drm_connector *connector)
162162
return container_of(connector, struct ast_connector, base);
163163
}
164164

165-
/*
166-
* BMC
167-
*/
168-
169-
struct ast_bmc_connector {
170-
struct drm_connector base;
171-
struct drm_connector *physical_connector;
172-
};
173-
174-
static inline struct ast_bmc_connector *
175-
to_ast_bmc_connector(struct drm_connector *connector)
176-
{
177-
return container_of(connector, struct ast_bmc_connector, base);
178-
}
179-
180165
/*
181166
* Device
182167
*/
@@ -222,10 +207,6 @@ struct ast_device {
222207
struct drm_encoder encoder;
223208
struct ast_connector connector;
224209
} astdp;
225-
struct {
226-
struct drm_encoder encoder;
227-
struct ast_bmc_connector bmc_connector;
228-
} bmc;
229210
} output;
230211

231212
bool support_wide_screen;

drivers/gpu/drm/ast/ast_mode.c

Lines changed: 0 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@
3434

3535
#include <drm/drm_atomic.h>
3636
#include <drm/drm_atomic_helper.h>
37-
#include <drm/drm_atomic_state_helper.h>
3837
#include <drm/drm_crtc.h>
3938
#include <drm/drm_damage_helper.h>
40-
#include <drm/drm_edid.h>
4139
#include <drm/drm_format_helper.h>
4240
#include <drm/drm_fourcc.h>
4341
#include <drm/drm_gem_atomic_helper.h>
@@ -1309,103 +1307,6 @@ static int ast_crtc_init(struct drm_device *dev)
13091307
return 0;
13101308
}
13111309

1312-
/*
1313-
* BMC virtual Connector
1314-
*/
1315-
1316-
static const struct drm_encoder_funcs ast_bmc_encoder_funcs = {
1317-
.destroy = drm_encoder_cleanup,
1318-
};
1319-
1320-
static int ast_bmc_connector_helper_detect_ctx(struct drm_connector *connector,
1321-
struct drm_modeset_acquire_ctx *ctx,
1322-
bool force)
1323-
{
1324-
struct ast_bmc_connector *bmc_connector = to_ast_bmc_connector(connector);
1325-
struct drm_connector *physical_connector = bmc_connector->physical_connector;
1326-
1327-
/*
1328-
* Most user-space compositors cannot handle more than one connected
1329-
* connector per CRTC. Hence, we only mark the BMC as connected if the
1330-
* physical connector is disconnected. If the physical connector's status
1331-
* is connected or unknown, the BMC remains disconnected. This has no
1332-
* effect on the output of the BMC.
1333-
*
1334-
* FIXME: Remove this logic once user-space compositors can handle more
1335-
* than one connector per CRTC. The BMC should always be connected.
1336-
*/
1337-
1338-
if (physical_connector && physical_connector->status == connector_status_disconnected)
1339-
return connector_status_connected;
1340-
1341-
return connector_status_disconnected;
1342-
}
1343-
1344-
static int ast_bmc_connector_helper_get_modes(struct drm_connector *connector)
1345-
{
1346-
return drm_add_modes_noedid(connector, 4096, 4096);
1347-
}
1348-
1349-
static const struct drm_connector_helper_funcs ast_bmc_connector_helper_funcs = {
1350-
.get_modes = ast_bmc_connector_helper_get_modes,
1351-
.detect_ctx = ast_bmc_connector_helper_detect_ctx,
1352-
};
1353-
1354-
static const struct drm_connector_funcs ast_bmc_connector_funcs = {
1355-
.reset = drm_atomic_helper_connector_reset,
1356-
.fill_modes = drm_helper_probe_single_connector_modes,
1357-
.destroy = drm_connector_cleanup,
1358-
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
1359-
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
1360-
};
1361-
1362-
static int ast_bmc_connector_init(struct drm_device *dev,
1363-
struct ast_bmc_connector *bmc_connector,
1364-
struct drm_connector *physical_connector)
1365-
{
1366-
struct drm_connector *connector = &bmc_connector->base;
1367-
int ret;
1368-
1369-
ret = drm_connector_init(dev, connector, &ast_bmc_connector_funcs,
1370-
DRM_MODE_CONNECTOR_VIRTUAL);
1371-
if (ret)
1372-
return ret;
1373-
1374-
drm_connector_helper_add(connector, &ast_bmc_connector_helper_funcs);
1375-
1376-
bmc_connector->physical_connector = physical_connector;
1377-
1378-
return 0;
1379-
}
1380-
1381-
static int ast_bmc_output_init(struct ast_device *ast,
1382-
struct drm_connector *physical_connector)
1383-
{
1384-
struct drm_device *dev = &ast->base;
1385-
struct drm_crtc *crtc = &ast->crtc;
1386-
struct drm_encoder *encoder = &ast->output.bmc.encoder;
1387-
struct ast_bmc_connector *bmc_connector = &ast->output.bmc.bmc_connector;
1388-
struct drm_connector *connector = &bmc_connector->base;
1389-
int ret;
1390-
1391-
ret = drm_encoder_init(dev, encoder,
1392-
&ast_bmc_encoder_funcs,
1393-
DRM_MODE_ENCODER_VIRTUAL, "ast_bmc");
1394-
if (ret)
1395-
return ret;
1396-
encoder->possible_crtcs = drm_crtc_mask(crtc);
1397-
1398-
ret = ast_bmc_connector_init(dev, bmc_connector, physical_connector);
1399-
if (ret)
1400-
return ret;
1401-
1402-
ret = drm_connector_attach_encoder(connector, encoder);
1403-
if (ret)
1404-
return ret;
1405-
1406-
return 0;
1407-
}
1408-
14091310
/*
14101311
* Mode config
14111312
*/
@@ -1457,7 +1358,6 @@ static const struct drm_mode_config_funcs ast_mode_config_funcs = {
14571358
int ast_mode_config_init(struct ast_device *ast)
14581359
{
14591360
struct drm_device *dev = &ast->base;
1460-
struct drm_connector *physical_connector = NULL;
14611361
int ret;
14621362

14631363
ret = drmm_mutex_init(dev, &ast->modeset_lock);
@@ -1502,29 +1402,22 @@ int ast_mode_config_init(struct ast_device *ast)
15021402
ret = ast_vga_output_init(ast);
15031403
if (ret)
15041404
return ret;
1505-
physical_connector = &ast->output.vga.connector.base;
15061405
}
15071406
if (ast->tx_chip_types & AST_TX_SIL164_BIT) {
15081407
ret = ast_sil164_output_init(ast);
15091408
if (ret)
15101409
return ret;
1511-
physical_connector = &ast->output.sil164.connector.base;
15121410
}
15131411
if (ast->tx_chip_types & AST_TX_DP501_BIT) {
15141412
ret = ast_dp501_output_init(ast);
15151413
if (ret)
15161414
return ret;
1517-
physical_connector = &ast->output.dp501.connector.base;
15181415
}
15191416
if (ast->tx_chip_types & AST_TX_ASTDP_BIT) {
15201417
ret = ast_astdp_output_init(ast);
15211418
if (ret)
15221419
return ret;
1523-
physical_connector = &ast->output.astdp.connector.base;
15241420
}
1525-
ret = ast_bmc_output_init(ast, physical_connector);
1526-
if (ret)
1527-
return ret;
15281421

15291422
drm_mode_config_reset(dev);
15301423

0 commit comments

Comments
 (0)