|
34 | 34 |
|
35 | 35 | #include <drm/drm_atomic.h>
|
36 | 36 | #include <drm/drm_atomic_helper.h>
|
37 |
| -#include <drm/drm_atomic_state_helper.h> |
38 | 37 | #include <drm/drm_crtc.h>
|
39 | 38 | #include <drm/drm_damage_helper.h>
|
40 |
| -#include <drm/drm_edid.h> |
41 | 39 | #include <drm/drm_format_helper.h>
|
42 | 40 | #include <drm/drm_fourcc.h>
|
43 | 41 | #include <drm/drm_gem_atomic_helper.h>
|
@@ -1309,103 +1307,6 @@ static int ast_crtc_init(struct drm_device *dev)
|
1309 | 1307 | return 0;
|
1310 | 1308 | }
|
1311 | 1309 |
|
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 |
| - |
1409 | 1310 | /*
|
1410 | 1311 | * Mode config
|
1411 | 1312 | */
|
@@ -1457,7 +1358,6 @@ static const struct drm_mode_config_funcs ast_mode_config_funcs = {
|
1457 | 1358 | int ast_mode_config_init(struct ast_device *ast)
|
1458 | 1359 | {
|
1459 | 1360 | struct drm_device *dev = &ast->base;
|
1460 |
| - struct drm_connector *physical_connector = NULL; |
1461 | 1361 | int ret;
|
1462 | 1362 |
|
1463 | 1363 | ret = drmm_mutex_init(dev, &ast->modeset_lock);
|
@@ -1502,29 +1402,22 @@ int ast_mode_config_init(struct ast_device *ast)
|
1502 | 1402 | ret = ast_vga_output_init(ast);
|
1503 | 1403 | if (ret)
|
1504 | 1404 | return ret;
|
1505 |
| - physical_connector = &ast->output.vga.connector.base; |
1506 | 1405 | }
|
1507 | 1406 | if (ast->tx_chip_types & AST_TX_SIL164_BIT) {
|
1508 | 1407 | ret = ast_sil164_output_init(ast);
|
1509 | 1408 | if (ret)
|
1510 | 1409 | return ret;
|
1511 |
| - physical_connector = &ast->output.sil164.connector.base; |
1512 | 1410 | }
|
1513 | 1411 | if (ast->tx_chip_types & AST_TX_DP501_BIT) {
|
1514 | 1412 | ret = ast_dp501_output_init(ast);
|
1515 | 1413 | if (ret)
|
1516 | 1414 | return ret;
|
1517 |
| - physical_connector = &ast->output.dp501.connector.base; |
1518 | 1415 | }
|
1519 | 1416 | if (ast->tx_chip_types & AST_TX_ASTDP_BIT) {
|
1520 | 1417 | ret = ast_astdp_output_init(ast);
|
1521 | 1418 | if (ret)
|
1522 | 1419 | return ret;
|
1523 |
| - physical_connector = &ast->output.astdp.connector.base; |
1524 | 1420 | }
|
1525 |
| - ret = ast_bmc_output_init(ast, physical_connector); |
1526 |
| - if (ret) |
1527 |
| - return ret; |
1528 | 1421 |
|
1529 | 1422 | drm_mode_config_reset(dev);
|
1530 | 1423 |
|
|
0 commit comments