Example #1
0
static DFBResult
drmkmsInitOutput( CoreScreen                  *screen,
                  void                        *driver_data,
                  void                        *screen_data,
                  int                          output,
                  DFBScreenOutputDescription  *description,
                  DFBScreenOutputConfig       *config )
{
     DRMKMSData       *drmkms    = driver_data;
     DRMKMSDataShared *shared    = drmkms->shared;

     D_DEBUG_AT( DRMKMS_Screen, "%s()\n", __FUNCTION__ );

     direct_snputs( description->name, "DRMKMS Output", DFB_SCREEN_OUTPUT_DESC_NAME_LENGTH );


     description->caps            = DSOCAPS_RESOLUTION;

     switch (drmkms->connector[output]->connector_type) {
          case DRM_MODE_CONNECTOR_VGA:
               description->all_connectors = DSOC_VGA;
               description->all_signals    = DSOS_VGA;
               break;
          case DRM_MODE_CONNECTOR_SVIDEO:
               description->all_connectors = DSOC_YC;
               description->all_signals    = DSOS_YC;
               break;
          case DRM_MODE_CONNECTOR_Composite:
               description->all_connectors = DSOC_CVBS;
               description->all_signals    = DSOS_CVBS;
               break;
          case DRM_MODE_CONNECTOR_Component:
               description->all_connectors = DSOC_COMPONENT;
               description->all_signals    = DSOS_YCBCR;
               break;
          case DRM_MODE_CONNECTOR_HDMIA:
          case DRM_MODE_CONNECTOR_HDMIB:
               description->all_connectors = DSOC_HDMI;
               description->all_signals    = DSOS_HDMI;
               break;
          default:
               description->all_connectors = DSOC_UNKNOWN;
               description->all_signals    = DSOC_UNKNOWN;
     }

     description->all_resolutions = drmkms_modes_to_dsor_bitmask( output );

     config->flags                = DSOCONF_RESOLUTION;

     drmkms_mode_to_dsor_dsef( &shared->mode[output], &config->resolution, NULL );

     return DFB_OK;
}
Example #2
0
static DFBResult
drmkmsInitEncoder( CoreScreen                  *screen,
                   void                        *driver_data,
                   void                        *screen_data,
                   int                          encoder,
                   DFBScreenEncoderDescription *description,
                   DFBScreenEncoderConfig      *config )
{
     DRMKMSData       *drmkms    = driver_data;
     DRMKMSDataShared *shared    = drmkms->shared;

     D_DEBUG_AT( DRMKMS_Screen, "%s()\n", __FUNCTION__ );

     direct_snputs( description->name, "DRMKMS Encoder", DFB_SCREEN_ENCODER_DESC_NAME_LENGTH );

     description->caps = DSECAPS_RESOLUTION | DSECAPS_FREQUENCY;

     config->flags     = DSECONF_RESOLUTION | DSECONF_FREQUENCY | DSECONF_MIXER;
     config->mixer     = encoder;

     if (drmkms->encoder[encoder]) {
          switch (drmkms->encoder[encoder]->encoder_type) {
               case DRM_MODE_ENCODER_DAC:
                    description->type = DSET_CRTC;
                    break;
               case DRM_MODE_ENCODER_LVDS:
               case DRM_MODE_ENCODER_TMDS:
                    description->type = DSET_DIGITAL;
                    break;
               case DRM_MODE_ENCODER_TVDAC:
                    description->type = DSET_TV;
                    break;
               default:
                    description->type = DSET_UNKNOWN;
          }

          drmkms_mode_to_dsor_dsef( &shared->mode[encoder], &config->resolution, &config->frequency );

          description->all_resolutions = drmkms_modes_to_dsor_bitmask( encoder );
     }
     else {
          description->type            = DSET_DIGITAL;
          description->all_resolutions = DSOR_1280_720;

          config->resolution           = DSOR_1280_720;
          config->frequency            = DSEF_60HZ;
     }

     return DFB_OK;
}