drm/komeda: Accept null writeback configurations for writeback
User may send null writeback configurations for writeback connector like: - Only bind the writeback connector to crtc. - set a fb_id(0) to writeback_fb_id_property All above configurations are meaningless for writeback, but since they are still valid configurations, accept them. Depends on: - https://patchwork.freedesktop.org/series/60856/ Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
This commit is contained in:

committed by
Liviu Dudau

parent
420810cec6
commit
f461d6591f
@@ -13,11 +13,7 @@ komeda_wb_init_data_flow(struct komeda_layer *wb_layer,
|
|||||||
struct komeda_crtc_state *kcrtc_st,
|
struct komeda_crtc_state *kcrtc_st,
|
||||||
struct komeda_data_flow_cfg *dflow)
|
struct komeda_data_flow_cfg *dflow)
|
||||||
{
|
{
|
||||||
struct drm_framebuffer *fb = conn_st->writeback_job ?
|
struct drm_framebuffer *fb = conn_st->writeback_job->fb;
|
||||||
conn_st->writeback_job->fb : NULL;
|
|
||||||
|
|
||||||
if (!fb)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
memset(dflow, 0, sizeof(*dflow));
|
memset(dflow, 0, sizeof(*dflow));
|
||||||
|
|
||||||
@@ -42,10 +38,15 @@ komeda_wb_encoder_atomic_check(struct drm_encoder *encoder,
|
|||||||
struct drm_connector_state *conn_st)
|
struct drm_connector_state *conn_st)
|
||||||
{
|
{
|
||||||
struct komeda_crtc_state *kcrtc_st = to_kcrtc_st(crtc_st);
|
struct komeda_crtc_state *kcrtc_st = to_kcrtc_st(crtc_st);
|
||||||
|
struct drm_writeback_job *writeback_job = conn_st->writeback_job;
|
||||||
struct komeda_layer *wb_layer;
|
struct komeda_layer *wb_layer;
|
||||||
struct komeda_data_flow_cfg dflow;
|
struct komeda_data_flow_cfg dflow;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
if (!writeback_job || !writeback_job->fb) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!crtc_st->active) {
|
if (!crtc_st->active) {
|
||||||
DRM_DEBUG_ATOMIC("Cannot write the composition result out on a inactive CRTC.\n");
|
DRM_DEBUG_ATOMIC("Cannot write the composition result out on a inactive CRTC.\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
Reference in New Issue
Block a user