With a quick workaround you can. Set a screensaver to turn on. Say your display goes to sleep after 5 minutes of inactivity, set the screensaver to start after 5 minutes as well. Despite the screensaver, your display will still go to sleep. Then in the security pref. pane, check the "require password to wake computer from sleep or screensaver"