cam: kms_sink: Use the first suitable pipeline found
When searching for a suitable pipeline, we mistakenly only break from
the inner loop. This results in the last suitable output being selected.
Pick the first one instead.
Fixes: 1de0f90dd4
("cam: kms_sink: Print display pipelineconfiguration")
Signed-off-by: Eric Curtin <ecurtin@redhat.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
7653021549
commit
ca20503f62
2 changed files with 12 additions and 5 deletions
|
@ -136,7 +136,7 @@ int KMSSink::configure(const libcamera::CameraConfiguration &config)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int KMSSink::configurePipeline(const libcamera::PixelFormat &format)
|
int KMSSink::selectPipeline(const libcamera::PixelFormat &format)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* If the requested format has an alpha channel, also consider the X
|
* If the requested format has an alpha channel, also consider the X
|
||||||
|
@ -174,25 +174,31 @@ int KMSSink::configurePipeline(const libcamera::PixelFormat &format)
|
||||||
crtc_ = crtc;
|
crtc_ = crtc;
|
||||||
plane_ = plane;
|
plane_ = plane;
|
||||||
format_ = format;
|
format_ = format;
|
||||||
break;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plane->supportsFormat(xFormat)) {
|
if (plane->supportsFormat(xFormat)) {
|
||||||
crtc_ = crtc;
|
crtc_ = crtc;
|
||||||
plane_ = plane;
|
plane_ = plane;
|
||||||
format_ = xFormat;
|
format_ = xFormat;
|
||||||
break;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!crtc_) {
|
return -EPIPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int KMSSink::configurePipeline(const libcamera::PixelFormat &format)
|
||||||
|
{
|
||||||
|
const int ret = selectPipeline(format);
|
||||||
|
if (ret) {
|
||||||
std::cerr
|
std::cerr
|
||||||
<< "Unable to find display pipeline for format "
|
<< "Unable to find display pipeline for format "
|
||||||
<< format.toString() << std::endl;
|
<< format.toString() << std::endl;
|
||||||
|
|
||||||
return -EPIPE;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout
|
std::cout
|
||||||
|
|
|
@ -47,6 +47,7 @@ private:
|
||||||
libcamera::Request *camRequest_;
|
libcamera::Request *camRequest_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int selectPipeline(const libcamera::PixelFormat &format);
|
||||||
int configurePipeline(const libcamera::PixelFormat &format);
|
int configurePipeline(const libcamera::PixelFormat &format);
|
||||||
void requestComplete(DRM::AtomicRequest *request);
|
void requestComplete(DRM::AtomicRequest *request);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue