From: "Rafał Miłecki" <zajec5@gmail.com>
To: Dave Airlie <airlied@linux.ie>, dri-devel@lists.freedesktop.org
Cc: "Christian König" <deathsimple@vodafone.de>
Subject: [next][PATCH 3/5] drm/radeon/kms: get rid of r600_hdmi_find_free_block
Date: Sat, 28 Apr 2012 23:35:22 +0200 [thread overview]
Message-ID: <1335648924-3754-4-git-send-email-zajec5@gmail.com> (raw)
In-Reply-To: <1335648924-3754-1-git-send-email-zajec5@gmail.com>
R6xx has routable blocks, but there's nothing wrong in assignment based
on dig_encoder. We didn't really need that algorithm.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
drivers/gpu/drm/radeon/r600_hdmi.c | 45 ++++++-----------------------------
1 files changed, 8 insertions(+), 37 deletions(-)
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c
index 06e273e..834ca02 100644
--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -421,40 +421,6 @@ void r600_hdmi_update_audio_settings(struct drm_encoder *encoder)
r600_hdmi_audio_workaround(encoder);
}
-static int r600_hdmi_find_free_block(struct drm_device *dev)
-{
- struct radeon_device *rdev = dev->dev_private;
- struct drm_encoder *encoder;
- struct radeon_encoder *radeon_encoder;
- bool free_blocks[3] = { true, true, true };
-
- list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
- radeon_encoder = to_radeon_encoder(encoder);
- switch (radeon_encoder->hdmi_offset) {
- case R600_HDMI_BLOCK1:
- free_blocks[0] = false;
- break;
- case R600_HDMI_BLOCK2:
- free_blocks[1] = false;
- break;
- case R600_HDMI_BLOCK3:
- free_blocks[2] = false;
- break;
- }
- }
-
- if (rdev->family == CHIP_RS600 || rdev->family == CHIP_RS690 ||
- rdev->family == CHIP_RS740) {
- return free_blocks[0] ? R600_HDMI_BLOCK1 : 0;
- } else if (rdev->family >= CHIP_R600) {
- if (free_blocks[0])
- return R600_HDMI_BLOCK1;
- else if (free_blocks[1])
- return R600_HDMI_BLOCK2;
- }
- return 0;
-}
-
static void r600_hdmi_assign_block(struct drm_encoder *encoder)
{
struct drm_device *dev = encoder->dev;
@@ -488,9 +454,14 @@ static void r600_hdmi_assign_block(struct drm_encoder *encoder)
} else if (ASIC_IS_DCE3(rdev)) {
radeon_encoder->hdmi_offset = dig->dig_encoder ?
R600_HDMI_BLOCK3 : R600_HDMI_BLOCK1;
- } else if (rdev->family >= CHIP_R600 || rdev->family == CHIP_RS600 ||
- rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) {
- radeon_encoder->hdmi_offset = r600_hdmi_find_free_block(dev);
+ } else if (rdev->family >= CHIP_R600) {
+ /* 2 routable blocks, but using dig_encoder should be fine */
+ radeon_encoder->hdmi_offset = dig->dig_encoder ?
+ R600_HDMI_BLOCK2 : R600_HDMI_BLOCK1;
+ } else if (rdev->family == CHIP_RS600 || rdev->family == CHIP_RS690 ||
+ rdev->family == CHIP_RS740) {
+ /* Only 1 routable block */
+ radeon_encoder->hdmi_offset = R600_HDMI_BLOCK1;
}
}
--
1.7.7
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2012-04-28 21:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-28 21:35 [next][PATCH 0/5] radeon HDMI cleaning Rafał Miłecki
2012-04-28 21:35 ` [next][PATCH 1/5] drm/radeon/kms: move audio params to separated struct Rafał Miłecki
2012-04-28 21:35 ` [next][PATCH 2/5] drm/radeon/kms: get rid of hdmi_config_offset Rafał Miłecki
2012-04-28 21:35 ` Rafał Miłecki [this message]
2012-04-28 21:35 ` [next][PATCH 4/5] drm/radeon/kms: keep HDMI state in separated variable Rafał Miłecki
2012-04-28 21:35 ` [next][PATCH 5/5] drm/radeon/kms/hdmi: use relative offsets, official regs Rafał Miłecki
2012-04-29 12:26 ` [next][PATCH 0/5] radeon HDMI cleaning Christian König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1335648924-3754-4-git-send-email-zajec5@gmail.com \
--to=zajec5@gmail.com \
--cc=airlied@linux.ie \
--cc=deathsimple@vodafone.de \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox