intel_extreme: fix assigning pipes to displays
The previous code did not handle correctly the case where a display requested a fixed mapping, and cloud end up assigning the same pipe to multiple displays. But we want a separate pipe for each display, allowing multihead support later on. Rewrite the algorithm to first assign pipes to devices with fixed constraints, and in a second pass assing the remaining pipes to other displays.
This commit is contained in:
@@ -433,20 +433,36 @@ assign_pipes()
|
|||||||
// assigned when the count is > 1;
|
// assigned when the count is > 1;
|
||||||
|
|
||||||
uint32 current = 0;
|
uint32 current = 0;
|
||||||
|
|
||||||
|
bool assigned[gInfo->pipe_count];
|
||||||
|
memset(assigned, 0, gInfo->pipe_count);
|
||||||
|
|
||||||
|
// Some ports need to be assigned to a fixed pipe on old hardware (or due
|
||||||
|
// to limitations in the current driver on current hardware). Assign those
|
||||||
|
// first
|
||||||
for (uint32 i = 0; i < gInfo->port_count; i++) {
|
for (uint32 i = 0; i < gInfo->port_count; i++) {
|
||||||
if (gInfo->ports[i] == NULL)
|
if (gInfo->ports[i] == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pipe_index preference = gInfo->ports[i]->PipePreference();
|
pipe_index preference = gInfo->ports[i]->PipePreference();
|
||||||
if (preference != INTEL_PIPE_ANY) {
|
if (preference != INTEL_PIPE_ANY) {
|
||||||
// Some ports *really* need to be assigned a pipe due to
|
|
||||||
// implementation bugs.
|
|
||||||
int index = (preference == INTEL_PIPE_B) ? 1 : 0;
|
int index = (preference == INTEL_PIPE_B) ? 1 : 0;
|
||||||
|
if (assigned[index]) {
|
||||||
|
TRACE("Pipe %d is already assigned, it will drive multiple "
|
||||||
|
"displays\n", index);
|
||||||
|
}
|
||||||
gInfo->ports[i]->SetPipe(gInfo->pipes[index]);
|
gInfo->ports[i]->SetPipe(gInfo->pipes[index]);
|
||||||
|
assigned[index] = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// In a second pass, assign the remaining ports to the remaining pipes
|
||||||
|
for (uint32 i = 0; i < gInfo->port_count; i++) {
|
||||||
if (gInfo->ports[i]->IsConnected()) {
|
if (gInfo->ports[i]->IsConnected()) {
|
||||||
|
while (current < gInfo->pipe_count && assigned[current])
|
||||||
|
current++;
|
||||||
|
|
||||||
if (current >= gInfo->pipe_count) {
|
if (current >= gInfo->pipe_count) {
|
||||||
ERROR("%s: No pipes left to assign to port %s!\n", __func__,
|
ERROR("%s: No pipes left to assign to port %s!\n", __func__,
|
||||||
gInfo->ports[i]->PortName());
|
gInfo->ports[i]->PortName());
|
||||||
@@ -454,7 +470,6 @@ assign_pipes()
|
|||||||
}
|
}
|
||||||
|
|
||||||
gInfo->ports[i]->SetPipe(gInfo->pipes[current]);
|
gInfo->ports[i]->SetPipe(gInfo->pipes[current]);
|
||||||
current++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user